Skip to content

NoResults "Collecting results..." empty state says "about about X hours" #52241

Description

@noahtalerman

Fleet versions

Web browser and operating system: Chrome, macOS (local dev environment)


💥 Actual behavior

The "Collecting results..." empty state for a report (frontend/pages/queries/details/components/NoResults/NoResults.tsx) reads the word "about" twice, e.g.:

Hosts will start reporting results after they've been online for about about 12 hours.

The component's copy hardcodes the literal word "about" before an interpolated readableCheckbackTime value:

Hosts will start reporting results after they've been online for
about {readableCheckbackTime}.

readableCheckbackTime is built with date-fns' formatDistance, which itself prepends a qualifier like "about" for many ranges (e.g. it returns the string "about 12 hours"). Combined, the sentence doubles the word.

🛠️ Expected behavior

The empty state reads naturally with a single "about", e.g. "...online for about 12 hours."

🧑‍💻 Steps to reproduce

  • Have been confirmed to consistently lead to reproduction in multiple Fleet instances.
  1. Set a report's interval so its next expected check-back time falls in an hours-scale range (e.g. ~12 hours away).
  2. View the report before it has any results.
  3. Observe the "Collecting results..." empty state text reads "...online for about about 12 hours."

🕯️ More info (optional)

Found and fixed in the same session/branch (52106-report-interval-help-text, PR #52107) that introduced the surrounding copy change — this bug pre-dates that PR by way of the pre-existing about {readableCheckbackTime} pattern, but was only noticed once QA'ing the interval copy work. Fix: swap formatDistance for formatDistanceStrict, which returns the bare distance ("12 hours") without a qualifier prefix, so the single literal "about" in the copy is the only one left.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working as documented~frontendFrontend-related issue.~unreleased bugThis bug was found in an unreleased version of Fleet.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions