Skip to content

fix(web): prevent video thumbnails showing 60 secs on near-minute durations (#3563) - #3572

Open
ghazy2001 wants to merge 1 commit into
CapSoftware:mainfrom
ghazy2001:fix/video-thumbnail-duration-rollover-3563
Open

ghazy2001 wants to merge 1 commit into
CapSoftware:mainfrom
ghazy2001:fix/video-thumbnail-duration-rollover-3563

Conversation

@ghazy2001

@ghazy2001 ghazy2001 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #3563
Linear: CAP-953

Video thumbnail cards on dashboards and public share cards were displaying "60 secs" for recordings with fractional durations between 59 and 60 seconds (such as 59.5s).

Root Cause

formatDuration in apps/web/components/VideoThumbnail.tsx computed totalMinutes = Math.floor(duration.asMinutes) and remainingSeconds = Math.ceil(duration.asSeconds % 60). When duration was e.g. 59.5s:

  • totalMinutes was floored to 0
  • remainingSeconds was ceil-rounded to 60
  • The function returned "60 secs" instead of rolling over to "1 min".

Changes

  • Centralized formatDuration in apps/web/lib/date-format.ts and re-exported it from VideoThumbnail.tsx.
  • Ceil-rounded the total seconds (Math.max(0, Math.ceil(durationSecs))) before deriving hours, minutes, and remaining seconds, matching the calculation in apps/mobile/src/utils/format.ts.
  • Near-minute fractional durations (e.g. 59.2s, 59.5s, 59.99s) now cleanly roll over into "1 min".
  • Added unit tests in apps/web/__tests__/unit/video-thumbnail-duration.test.ts covering sub-minute, sub-second, multi-minute, and hour boundary formatting.

Test plan

  • Ran unit tests with Bun:
    • bun test apps/web/__tests__/unit/video-thumbnail-duration.test.ts (4 pass, 17 assertions)
    • bun test apps/mobile/src/utils/format.test.ts (4 pass, 19 assertions)
  • Verified 59.0s formats as "59 secs", 59.5s formats as "1 min", and 60.0s formats as "1 min".

RetriggerView in GreptileConfidence Score: 5/5

This PR appears safe to merge.

Summary

Fixes thumbnail duration labels by rounding total seconds up before choosing seconds, minutes, or hours.

  • Video thumbnail cards roll near-minute durations into the next minute.

Reviews (1) · Last reviewed commit: "fix(web): prevent video thumbnails showi..." · Reviewed by Greptile

…ations (CapSoftware#3563)

Durations stored as fractional seconds between 59 and 60 seconds rendered as '60 secs' because minutes were floored before ceil-rounding remaining seconds.

Ceil total seconds before computing minutes and hours so near-minute durations roll over into '1 min' consistently with mobile and neighboring values.

Closes CapSoftware#3563
@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 10:00pm UTC

This branch was previously deployed

1 inactive deployment
Preview – cap-status — dab2123f 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