Skip to content

fix(web): show hours in clock times past an hour - #3305

Merged
richiemcilroy merged 3 commits into
CapSoftware:mainfrom
patrickballard:fix/web-clock-hours
Nov 4, 2026
Merged

richiemcilroy merged 3 commits into
CapSoftware:mainfrom
patrickballard:fix/web-clock-hours

Conversation

@patrickballard

@patrickballard patrickballard commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Closes #3303.

Seven places on the web formatted times as minutes and seconds only, so anything past the hour mark read as a minute count, 65:05 instead of 1:05:05:

  • the web editor's playhead and duration readouts (EditVideoClient.tsx)
  • the web editor's transcript timestamps (TranscriptSidebar.tsx)
  • Slack link previews ("Watch this 65:05 recording on Cap")
  • the MCP transcript card's cue times
  • the trim tool
  • the speed tool
  • the web recorder's timer

This adds formatClock (M:SS, or H:MM:SS from an hour on) and formatClockWithHundredths (MM:SS.ss, or H:MM:SS.ss) to lib/player-time.ts, next to formatPlayerTime, and uses them in all seven. Under an hour each place prints exactly what it did before; Slack keeps its rounding to the nearest second.

formatClock is the share page's existing helper, moved into lib. timeline/timeline-format.ts and early-playback.ts now re-export it instead of keeping their own copies, and the timeline copy's handling of NaN and Infinity is the one kept. The MCP card imports it with a relative path, since it's bundled on its own, and lib/mcp-card-html.json is regenerated (mcp-card:check passes).

Tests

  • New __tests__/unit/clock-hours.test.ts, added to the web test list in CI: both helpers, the Slack preview text, and the web editor's transcript sidebar rendered with a line past the hour. Without the call-site changes, the Slack and transcript cases fail (Watch this 65:05 recording on Cap, 65:10 · 2 words).
  • A new case in speed-controller.test.ts loads a 90-minute video and checks the duration and the 1.5x estimate (1:30:00, 1:00:00). It fails without the change.
  • The existing player-time, early-playback-guard, slack-unfurl, transcript-sidebar-search and trimming-tool-effect tests pass.
  • Full web suite: 4700 passed. The one failure, homepage-seo.test.ts (it expects no FAQPage in the homepage schema), fails the same way on main. bun run typecheck: no errors. Biome: no new findings.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Adds shared clock helpers and shows hours across seven web surfaces.

  • Editor times show hours on long recordings.
  • The trim tool shows hours on long clips.
  • The speed tool shows hours in duration estimates.
  • The web recorder timer shows hours on long recordings.
  • Slack previews show hours for long recordings.
  • MCP transcript cards show hours in long cue times.

Reviews (2) · Last reviewed commit: "fix(web): show hours in the speed tool's..." · Reviewed by Greptile

@vercel

vercel Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

@patrickballard is attempting to deploy a commit to the Cap Software Inc Team on Vercel.

A member of the Team first needs to authorize it.

Comment thread apps/web/lib/player-time.ts Outdated
: `${mins}:${pad(secs)}`;
}

/** `MM:SS.ss`, or `H:MM:SS.ss` once the time reaches an hour. */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Comment breaks repository policy

The new comment above formatClockWithHundredths only describes its output. AGENTS.md allows comments only for non-obvious context and bans comments that narrate what the code does. Remove this comment before merging to meet that requirement; the helper and its tests already show the format.

Suggested change
/** `MM:SS.ss`, or `H:MM:SS.ss` once the time reaches an hour. */

Context Used: AGENTS.md (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/web/lib/player-time.ts
Line: 30

Comment:
**Comment breaks repository policy**

The new comment above `formatClockWithHundredths` only describes its output. `AGENTS.md` allows comments only for non-obvious context and bans comments that narrate what the code does. Remove this comment before merging to meet that requirement; the helper and its tests already show the format.

```suggestion

```

**Context Used:** AGENTS.md ([source](https://github.com/capsoftware/cap/blob/main/AGENTS.md))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 941ac2a, along with the matching comment on formatClock, which only restated its format too.

@richiemcilroy

Copy link
Copy Markdown
Member

Thanks! Can you get Greptile to 5/5? Then we'll take a look.

Six places formatted times as minutes and seconds only, so a point
1 h 5 m 5 s in read 65:05. Move the share page's formatClock into
lib/player-time next to formatPlayerTime, add formatClockWithHundredths
for the web editor's detailed readout, and use them in all six; shorter
times print as before.
They only restated each helper's output format, which AGENTS.md asks
comments not to do; the tests already show the formats.
The speed tool's duration and estimated output duration also counted
minutes past 59. Use formatClock, as the trim tool now does.
@patrickballard

Copy link
Copy Markdown
Contributor Author

@greptileai review

@greptile-apps

greptile-apps Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Want your agent to iterate on Greptile's feedback? Try greploops.

@richiemcilroy
richiemcilroy merged commit d97f803 into CapSoftware:main Nov 4, 2026
33 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Times past an hour show as minutes (65:05 instead of 1:05:05) across the desktop app, web, Chrome extension and mobile app

2 participants