fix: normalize rounded duration units#552
Conversation
Assisted-by: Claude Code
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthrough
ChangesDuration formatting normalization
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. 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. Comment |
fix: normalize rounded duration units
Summary
formatDurationrounded values at unit boundaries without carrying the overflow, producing invalid values such as60.0sand1m 60s. This change normalizes rounded seconds before formatting minutes and hours.Fixes #521
Changes
Testing
sandbox-run "npm install --ignore-scripts && npx vitest run __tests__/lib/format-duration.test.ts"— passed (14 tests).sandbox-run "npm install --ignore-scripts && npx eslint lib/format-duration.ts __tests__/lib/format-duration.test.ts"— passed.sandbox-run "npm install --ignore-scripts && npx tsc --noEmit"— passed.sandbox-run "npm install --ignore-scripts && npx vitest run"— attempted; existing unrelated failures in hook integration/config tests prevented a clean full-suite result. The focused regression suite passed.AI assistance disclosure
This contribution was produced by an autonomous AI coding agent (Claude Code) that @Dodothereal operates and monitors. @Dodothereal is accountable for it, will address review feedback promptly, and will close this PR immediately if this kind of contribution is unwelcome in this project. Commits carry an
Assisted-by: Claude Codetrailer.Summary by CodeRabbit
Bug Fixes
60.0s,1m 60s, and59m 60s.Documentation