Skip to content

Add formatDuration helper in src/utils #1

Open

Description

@jmmon

Add a small duration formatting helper for UI timers.

  • New file src/utils/duration.ts exporting formatDuration(ms: number): string.
  • Under 1000ms return the milliseconds with an ms suffix (e.g. 350 → 350ms).
  • 1000ms and above return seconds with one decimal place and an s suffix (1200 → 1.2s, 2000 → 2.0s).
  • Negative or non-finite input returns 0ms.
  • Tests colocated at src/utils/duration.spec.ts.

Activity

  1. jmmon commented on Oct 25, 2026

    @jmmon
    OwnerAuthor

    Factory run claimed this issue at 2026-10-25T19:52:05-04:00. Branch: factory/issue-1.

  2. jmmon commented on Oct 25, 2026

    @jmmon
    OwnerAuthor

    Factory run escalated: station spec failed

    [2026-10-25 19:52:04] factory start: issue #1 branch factory/issue-1
    [2026-10-25 19:52:08] station: spec
    [2026-10-25 19:52:36] spec missing STATUS marker
    [2026-10-25 19:52:36] escalating issue #1: station spec failed
    

    Local logs: factory/logs/issue-1/.

  3. jmmon commented on Oct 25, 2026

    @jmmon
    OwnerAuthor

    Factory run claimed this issue at 2026-10-25T19:53:23-04:00. Branch: factory/issue-1.

  4. jmmon commented on Oct 25, 2026

    @jmmon
    OwnerAuthor

    Factory run escalated: station implement failed

    [2026-10-25 19:52:04] factory start: issue #1 branch factory/issue-1
    [2026-10-25 19:52:08] station: spec
    [2026-10-25 19:52:36] spec missing STATUS marker
    [2026-10-25 19:52:36] escalating issue #1: station spec failed
    [2026-10-25 19:53:21] factory start: issue #1 branch factory/issue-1
    [2026-10-25 19:53:21] reset requested: removing worktrees and local branch
    [2026-10-25 19:53:25] station: spec
    [2026-10-25 19:53:50] station: tests
    [2026-10-25 19:54:25] station: implement
    [2026-10-25 19:54:25] implement attempt 1
    [2026-10-25 19:55:38] gate failed on attempt 1
    [2026-10-25 19:55:38] implement attempt 2
    [2026-10-25 19:56:58] gate failed on attempt 2
    [2026-10-25 19:56:58] implement attempt 3
    [2026-10-25 19:58:09] gate failed on attempt 3
    [2026-10-25 19:58:09] escalating issue #1: station implement failed
    

    Local logs: factory/logs/issue-1/.

  5. 7 remaining items

  6. jmmon commented on Oct 26, 2026

    @jmmon
    OwnerAuthor

    Factory run claimed this issue at 2026-10-25T20:13:16-04:00. Branch: factory/issue-1.

  7. jmmon commented on Oct 26, 2026

    @jmmon
    OwnerAuthor

    Factory run escalated: station implement failed

    [2026-10-25 19:52:04] factory start: issue #1 branch factory/issue-1
    [2026-10-25 19:52:08] station: spec
    [2026-10-25 19:52:36] spec missing STATUS marker
    [2026-10-25 19:52:36] escalating issue #1: station spec failed
    [2026-10-25 19:53:21] factory start: issue #1 branch factory/issue-1
    [2026-10-25 19:53:21] reset requested: removing worktrees and local branch
    [2026-10-25 19:53:25] station: spec
    [2026-10-25 19:53:50] station: tests
    [2026-10-25 19:54:25] station: implement
    [2026-10-25 19:54:25] implement attempt 1
    [2026-10-25 19:55:38] gate failed on attempt 1
    [2026-10-25 19:55:38] implement attempt 2
    [2026-10-25 19:56:58] gate failed on attempt 2
    [2026-10-25 19:56:58] implement attempt 3
    [2026-10-25 19:58:09] gate failed on attempt 3
    [2026-10-25 19:58:09] escalating issue #1: station implement failed
    [2026-10-25 20:00:00] factory start: issue #1 branch factory/issue-1
    [2026-10-25 20:00:00] reset requested: removing worktrees and local branch
    [2026-10-25 20:00:04] station: spec
    [2026-10-25 20:00:54] station: tests
    [2026-10-25 20:01:37] station: implement
    [2026-10-25 20:01:37] implement attempt 1
    [2026-10-25 20:02:16] prettier check failed on changed files
    [2026-10-25 20:02:16] implement attempt 2
    [2026-10-25 20:02:47] prettier check failed on changed files
    [2026-10-25 20:02:47] implement attempt 3
    [2026-10-25 20:13:14] factory start: issue #1 branch factory/issue-1
    [2026-10-25 20:13:14] reset requested: removing worktrees and local branch
    [2026-10-25 20:13:18] station: spec
    [2026-10-25 20:13:43] spec missing STATUS marker (attempt 1)
    [2026-10-25 20:13:48] station: tests
    [2026-10-25 20:14:15] station: implement
    [2026-10-25 20:14:15] implement attempt 1
    [2026-10-25 20:14:49] prettier check failed on changed files
    [2026-10-25 20:14:49] implement attempt 2
    [2026-10-25 20:15:18] prettier check failed on changed files
    [2026-10-25 20:15:18] implement attempt 3
    [2026-10-25 20:15:45] prettier check failed on changed files
    [2026-10-25 20:15:45] escalating issue #1: station implement failed
    

    Local logs: factory/logs/issue-1/.

  8. jmmon commented on Oct 26, 2026

    @jmmon
    OwnerAuthor

    Factory run claimed this issue at 2026-10-25T20:16:43-04:00. Branch: factory/issue-1.

  9. jmmon commented on Oct 26, 2026

    @jmmon
    OwnerAuthor

    Factory run claimed this issue at 2026-10-25T20:20:32-04:00. Branch: factory/issue-1.

  10. jmmon commented on Oct 26, 2026

    @jmmon
    OwnerAuthor

    Factory opened a draft PR: #2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions