Skip to content

Show hours in trim-bar times past 60 minutes - #7

Open
Chessing234 wants to merge 2 commits into
omacom:masterfrom
Chessing234:fix/fmt-include-hours
Open

Chessing234 wants to merge 2 commits into
omacom:masterfrom
Chessing234:fix/fmt-include-hours

Conversation

@Chessing234

Copy link
Copy Markdown

Summary

  • Format.fmt treated minutes as unbounded, so hour-long clips rendered as 60:00.00.
  • Emit hh:mm:ss.cc once the duration reaches an hour.

Test plan

  • Trim a clip under 60 minutes and confirm mm:ss.cc
  • Seek past 3600s and confirm 01:00:00.00

Made with Cursor

Chessing234 and others added 2 commits September 5, 2026 10:16
fmt treated minutes as unbounded, so hour-long clips rendered as 60:00.00 instead of 01:00:00.00.

Signed-off-by: Taksh <takshkothari09@gmail.com>
The bubble's width was a fixed 82px, which is exactly what "mm:ss.cc" measures at 15px DemiBold monospace. An "hh:mm:ss.cc" time measures 99px, so past an hour the first and last characters rendered outside the bubble's background, on top of the filmstrip. Binding the width to the label keeps the bubble at 82px below an hour and grows it past one, and it also repairs the on-screen clamp on x, which used the bubble's width and so kept the background inside the track while the wider text ran off the end.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed by Claude Opus 5 in Claude Code, with an independent second opinion from Codex at xhigh reasoning. Anything that had to run ran on a disposable Omarchy VM, never on the machine holding the credentials.

The arithmetic holds. I exercised fmt on that VM over every centisecond from 0 to 8000 seconds: every output matches [hh:]mm:ss.cc, no field ever renders as 60, and every string converts back to exactly the centisecond it came from. The boundaries the header comment promises survive the change — 59.999 gives 01:00.00, 3599.994 gives 59:59.99, and 3599.995 gives 01:00:00.00 rather than 00:60.00 or 60:00.00. Deriving s from totalMinutes rather than from the new m is what makes the hour boundary come out right.

Nothing consumes the string as data. The only call sites are src/TrimBar.qml:186 and src/Main.qml:578, both text bindings; ffmpeg gets its -ss and -t from raw numbers in src/ffmpeg.cpp, and export filenames come from the source basename.

The layout did break, and I pushed a fix as 32c7318. src/TrimBar.qml gave the floating time bubble a fixed width: 82, which is exactly what mm:ss.cc measures at 15px DemiBold monospace. hh:mm:ss.cc measures 99px, and neither the Text nor the Rectangle clips, so past an hour the first and last characters were painted 8.5px outside the bubble's background, over the filmstrip. The x clamp compounded it: it keeps the 82px background inside the track, so with the wider string the text ran off the end of the trim bar. Those are measured numbers rather than estimates — I instantiated TrimBar under a real Hyprland session on the VM and read contentWidth off the label. The fix binds the bubble's width to the label plus the 10px of padding the old constant gave it, so a sub-hour time still gets a bubble exactly 82px wide in exactly the same place, and an hour-long one gets 109px. Re-measured the same way afterwards, with no binding loop.

The status line in Main.qml is fine. The widest hour-long form, 01:00:00.00 (01:00:00.00) · zoomed, measures 265px, and that label is centred with no width constraint in a window whose minimum is 640px.

./bin/test on the VM, after the fix: 27 passed, 0 failed, 0 skipped.

Codex agreed on the bubble, reaching the same mechanism and close to the same numbers, and added the 12-character 100:00:00.00 case, which the fix also covers. Its independence is not currently guaranteed — it can read this session's own working notes, so treat the agreement as weaker than the measurements. It did contribute one thing on its own terms: nothing in the suite exercises Format.fmt at all, so CI would stay green for either a returned 00:60.00 or for the overflow above. Adding that coverage is a judgement about test shape rather than a defect, so it is left for the maintainer instead of pushed to your branch. It also found that past 2^53 centiseconds floating-point precision breaks the residual and s can exceed 60; that is hundreds of millions of years of video, and the pre-existing code had the same property, so it is not a regression.

Waiting on the maintainer from here. Nothing outstanding for you.

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.

2 participants