Skip to content

fix(web): show 1 min instead of 60 secs on video thumbnails - #3565

Open
AryaKesharwani wants to merge 1 commit into
CapSoftware:mainfrom
AryaKesharwani:fix/thumbnail-duration-60-secs
Open

AryaKesharwani wants to merge 1 commit into
CapSoftware:mainfrom
AryaKesharwani:fix/thumbnail-duration-60-secs

Conversation

@AryaKesharwani

@AryaKesharwani AryaKesharwani commented Oct 29, 2026 •

Copy link
Copy Markdown

Video cards showed "60 secs" for recordings between 59 and 60 seconds, because formatDuration floored minutes but rounded the leftover seconds up with Math.ceil, so they could reach 60 without rolling over.

Round the duration up to whole seconds once, before splitting it into hours/minutes/seconds. Short clips still never read "0 secs", and the seconds can no longer exceed 59.

Duration Before After
0.2 s 1 sec 1 sec
59.0 s 59 secs 59 secs
59.2 / 59.5 / 59.99 s 60 secs 1 min
60.0 s 1 min 1 min
3599.5 s 59 mins 1 hr
150 s / 7200 s 2 mins / 2 hrs unchanged

The only other change is at unit boundaries: a fractional second just under a whole minute or hour now rounds into it (e.g. 3599.5 s → 1 hr), matching the existing round-up of seconds.

formatDuration is exported so it can be unit-tested; no other code changes.

Validation: new video-thumbnail-duration.test.ts (4 tests) passes; the minute and hour rollover cases fail against the previous logic. Existing date-format.test.ts still passes. Verified in a local self-hosted web build: a seeded 59.5 s Cap showed 60 secs on My Caps before the change and 1 min after, next to 59.0 s (59 secs) and 60.0 s (1 min). Biome check passes on both touched files.

Closes #3563.

RetriggerView in GreptileConfidence Score: 5/5

This PR appears safe to merge.

Summary

Fixes video thumbnail labels by rounding up to whole seconds before choosing hours, minutes, or seconds.

  • Video thumbnails round the full duration before showing its largest unit.

Reviews (1) · Last reviewed commit: "fix(web): show 1 min instead of 60 secs ..." · Reviewed by Greptile

@vercel

vercel Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cap-status Skipped Skipped Oct 29, 2026 8:54pm UTC

@vercel
vercel Bot temporarily deployed to Preview – cap-status October 29, 2026 20:54 Inactive

This branch was previously deployed

1 inactive deployment
Preview – cap-status — 8b1e6309 Deployed Oct 29, 2026 by vercel[bot]
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.

Video thumbnails show "60 secs" for recordings just under a minute

1 participant