GeezerVison is showing github.com — fix(shared): formatDuration renders "60s" instead of "1m" at the sub-minute boundary by arhxam · Pull Request #5026 · pingdotgg/t3code
Conversation
arhxam
commented
Jul 30, 2026
•
edited by macroscopeapp
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
What Changed
formatDuration (packages/shared/src/orchestrationTiming.ts) now rolls a sub-minute duration that rounds to 60 seconds up to "1m", instead of printing "60s". Added a test file covering the boundary and surrounding formats.
Why
The sub-minute branch used ${Math.round(durationMs / 1_000)}s, so any value in [59_500, 60_000) rounds to 60 and renders "60s". The >= 60_000 branch already guards exactly this rollover:
if (seconds === 60) return `${minutes + 1}m`;
…so the two branches disagreed: formatDuration(59_500) → "60s" while formatDuration(60_000) → "1m". This is user-visible via thread duration display (apps/mobile/src/lib/threadActivity.ts).
Verified before/after against the real module: 59_499 → "59s", 59_500 → "1m", 60_000 → "1m".
Checklist
- This PR is small and focused
- I explained what changed and why
- No UI changes (text formatting only; covered by a new unit test)
Note Low Risk
Display-only duration formatting in shared code; no auth, data, or API behavior changes.
Overview
formatDuration in orchestrationTiming.ts now treats sub-minute durations that round to 60 seconds (e.g. 59_500ms) as "1m" instead of "60s", matching the rollover logic already used for >= 60_000ms.
A new orchestrationTiming.test.ts covers ms/s formats, the 59.5s boundary, minute strings, and invalid inputs (NaN, negatives).
Reviewed by Cursor Bugbot for commit 8d31469. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix formatDuration rendering '60s' instead of '1m' at the sub-minute boundary
Durations that round to exactly 60 seconds (e.g. 59,500ms) were displayed as '60s' instead of '1m'. The fix adds a check in orchestrationTiming.ts that returns '1m' when the rounded seconds value equals 60. New tests in orchestrationTiming.test.ts cover this boundary along with sub-second, minute, and invalid-input cases.
Macroscope summarized 8d31469.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
`formatDuration` renders durations under a minute with
`${Math.round(durationMs / 1_000)}s`. For any value in [59_500, 60_000) that
rounds to 60 and prints "60s". The >= 60_000 branch already guards this exact
case (`if (seconds === 60) return `${minutes + 1}m``), so the sub-minute branch
was inconsistent with it: `formatDuration(59_500)` gave "60s" while
`formatDuration(60_000)` gives "1m".
Round first and roll 60 up to "1m". This is user-visible via thread duration
display (`apps/mobile/src/lib/threadActivity.ts`). Added a test file for
`formatDuration` covering the boundary and the surrounding formats.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Important
Review skipped
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: ae4bea6c-2f45-4c44-af63-a7bd6fd662f7
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Approvability
Verdict: Approved at 8d31469
Macroscope's review found this PR approvable — The PR makes a narrowly scoped correction to shared duration display logic, changing only the 59.5–60 second rounding boundary from "60s" to "1m". It adds focused regression coverage and has no schema, deployment, security, or other material runtime side effects.
Notes:
- Diff unchanged. Approvability was decided on eligibility alone.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Note Written by claude-opus-5-5 on behalf of Maria
Hi! We are cleaning up open PRs, and this one has merge conflicts with main, does not say which model created it and was opened more than two weeks ago. If this change is still important, please rebuild it on current main with a newer model and note the model in the PR description.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Oct 16, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
macroscope-review
Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews
size:XS
0-9 changed lines (additions + deletions).
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|