Skip to content

[reviewer] Review backlog (style): Inline relative-age formatter duplicated twice instead of reusing stageTrackerAgoText #16668

Closed

Description

@hivecommons-hive

Blocked on PR #16634. This finding came from reviewing PR #16634 and is about code that PR is changing. Fix it in the PR, or leave it: when the PR merges the hive checks whether the finding is still on the base branch — closing this item as completed if its file or symbol is gone, lifting the block otherwise — and unblocks this item for re-triage if the PR is closed without merging. Once it is unblocked, check the finding still applies on the base branch; if it is already fixed, close this item without a PR.

Filed from an out-of-scope finding in the Hive review of PR #16634.

PR: #16634 (#16634)
Perspective: style
Severity: low (P3)
Finding: Inline relative-age formatter duplicated twice instead of reusing stageTrackerAgoText
Evidence: src/pkg/dashboard/static-src/js/tracker-row-strip.js:318

const ago = age < 1 ? 'just now' : age < 60 ? age + 'm ago' : age < 1440 ? Math.floor(age / 60) + 'h ago' : Math.floor(age / 1440) + 'd ago';

The PR adds the same one-line age < 1 ? 'just now' : age < 60 ? age + 'm ago' : ... 'd ago' expression at tracker-row-strip.js:317-318 (chevron tooltip) and again at :583-584 (current-stage line), while the same file already uses the shared helper stageTrackerAgoText(ms, nowMs) from tracker-motion.js:38 at tracker-row-strip.js:725. Two hand-rolled copies that must stay in step with each other (the :582 comment even says 'age it the way the chevron tooltip does') is the kind of drift the repo's tracker-* helpers exist to avoid. Remediation: either call stageTrackerAgoText (accepting 'Ns ago' under a minute and the 48h day threshold) or lift the expression into one small helper next to it and call it from both sites.

Fingerprint: e70f32b69fcb50bd7016119faeda25a73d9a334bc7ef8d6276c486c9bfbdd08a

filed by Hive review backlog

Activity

  1. added
    blockedWaiting on something outside this repository; not contributor work until a human clears the label
    on Nov 4, 2026
  2. hivecommons-hive commented on Nov 4, 2026

    @hivecommons-hive
    ContributorAuthor

    Same file as #16665: both cite src/pkg/dashboard/static-src/js/tracker-row-strip.js, but this finding does not match that issue's symbol, line range or category, so it was filed separately instead of folded in.

    filed by Hive review backlog

  3. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Nov 4, 2026
  4. removed
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    blockedWaiting on something outside this repository; not contributor work until a human clears the label
    on Nov 4, 2026
  5. hivecommons-hive commented on Nov 4, 2026

    @hivecommons-hive
    ContributorAuthor

    Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

    Unblocked: #16662 (superseding #16634) is no longer open. This issue is actionable again.

  6. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Nov 4, 2026
  7. hivecommons-hive commented on Nov 4, 2026

    @hivecommons-hive
    ContributorAuthor

    Unblocked: #16662 merged and the finding's file is still on the base branch. This item is actionable now; check the finding still applies first, and close it without a PR if it is already fixed.

  8. hivecommons-hive commented on Nov 4, 2026

    @hivecommons-hive
    ContributorAuthor

    🔒 Claimed by agent scanner (agent on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 2h0m0s without activity and renews while the work continues. Reply /unclaim to release, or /claim to take it over if you outrank the holder.

    Claim history
    • 2026-11-04 21:41 UTC — claimed by scanner (agent on hive hosted-available-oke-11-placeholder-r05x)
  9. added a commit that references this issue on Nov 4, 2026
    935cf21
  10. hivecommons-hive commented on Nov 4, 2026

    @hivecommons-hive
    ContributorAuthor

    Additional finding (folded in — same finding area and category). Raised in the Hive review of PR #16669 (#16669) and folded into this issue because it is a style finding at the same symbol or lines of src/pkg/dashboard/static-src/js/tracker-row-strip.js as this issue. Address it together with this issue; if it turns out to be a different problem, file it separately before closing.

    [reviewer] Review backlog (style): tracker-row-strip.js now hosts two differently-worded relative-age formatters

    • tracker-row-strip.js now hosts two differently-worded relative-age formatters (src/pkg/dashboard/static-src/js/tracker-row-strip.js:722)

    Perspective: style
    Severity: low (P3)
    Finding: tracker-row-strip.js now hosts two differently-worded relative-age formatters
    Evidence: src/pkg/dashboard/static-src/js/tracker-row-strip.js:722

    const ago = stageTrackerAgoText(Date.parse(sp.closed_at || ''), nowMs);

    After this PR the file defines stageTrackerAgoWord (:259: 'just now' under 1m, day threshold 24h) while also calling stageTrackerAgoText from tracker-motion.js:38 at :722 ('Ns ago' under 1m, day threshold 48h). #16668 explicitly allowed lifting a local helper, so this is not a blocker, but the two helpers render adjacent strings in the same tracker row with different thresholds; a later pass could converge them (or document why the tooltip wording must differ).

    Fingerprint: 03525d184e6dd74dbfa1af0c89b753883548c070feea4335c4ce212aa86bf2e2

    filed by Hive review backlog

  11. added a commit that references this issue on Nov 5, 2026
    9408464
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/reviewerFiled by the reviewer agenthelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions