Repository navigation
Add an estimated local finish time to the player HUD - #1295
Conversation
|
Hi! This PR is ready for review. All four CI workflows passed on 2495ea4 (unit-test suites, ARMv7 build, and simulator checks). |
|
Can you show the screenshots? |
Yes, sorry @GLinnik21 ! attached |
Localization reviewCatalogs are complete. All 11 non-English catalogs (be, ca, de, es, fr, hu, it, nl, pl, pt, ru) have 1. The time itself is not locale-aware
Suggested fix: add a shared time-of-day formatter in
The time zone is fine: 2. Prepositions for 01:xx (ca / it / pt)"Acaba a les {time}", "Fine alle {time}" and "Fim às {time}" use the plural-hour form. For 01:00–01:59 the singular is required ("a la", "all'una", "à"). es / de / nl / hu already avoid this by having no preposition ("Fin {time}"); doing the same for ca / it / pt is the simplest fix. This also applies in 12-hour mode once item 1 is done. 3. Belarusian preposition"Канец у {time}": I'm not certain "у" is the right preposition before a clock time (it may need "а"). A native reviewer should confirm. Per 4. NitThe new Italian detail string uses a typographic Generated by Claude Code |
Follow-up: drop the
|
GLinnik21
left a comment
There was a problem hiding this comment.
Requesting changes
The structure is mostly sound. I read the diff and ran the repo's pr-reviewer agent over be8495d5b...5cd3533f5; it found the Sans-IO, ledger, layering and settings-machinery rules clean, and I confirmed the finding below against the code. Details of what was and wasn't checked are at the end. Two earlier comments cover the localization points; this review adds the architectural ones and collects what must change.
Must fix
1. The end-time lane is special-cased by package id, and installed HUD packages can never show the feature.
render.rs:644 passes end_time_width: (!compiled.builtin_classic).then_some(clock_rects.remaining.w), with builtin_classic: package.id == BUILTIN_CLASSIC_ID set in hud_format/compile.rs.
- For an installed package,
clock_rects.remaining.wis exactly the width of the widest remaining clock (hud_format/clocks.rs:73,rects():remaining_w = width(REMAINING_BOLD, true)). The label"{remaining} · …"is always wider than that, sowidth(label) < end_widthis never true. The setting silently does nothing on every installed HUD, although the PR body says custom layouts show it when there is room. This also holds for the shorter dot-and-time label proposed in my earlier comment: it is still wider than a lane sized to one clock. - The built-in
builtin:classicinstead gets the free track width, so it draws app text outside the remaining-clock rect the compiler emits. The HUD lint invariants (I4 decor z-order, I10 text fit) are judged only against that rect, so the built-in's new label is invisible to them. The renderer now behaves differently per package id, which cuts against D2 "One renderer" indocs/hud-plugins.md(the built-in must be expressible in the same format) and against AGENTS.md's "never write an ad-hoc mechanism when a shared one exists". - Suggested fix: make the lane a property the package declares (for example a playbar
clocks/end-time field in the schema, compiled intoClockRects), so lint I4/I10 and the parser fuzz cover it, andclassic.plxhuddeclares a wider lane. The id check goes away. This changes the schema, sodocs/hud-plugins.mdand thehud.formatreference need updating with it. If you decide not to extend the schema, state explicitly that the feature is built-in-only and drop the claim about custom layouts, but the id special-case would still need a documented reason.
2. Localization (from my earlier comments, still open): the time is always 24-hour HH:MM and ignores LocaleContext::clock() and the format locale; the player.hud.ends_at string should go in favour of a dot and the time through widgets::DottedRun, which also removes the ca/it/pt 01:xx and Belarusian preposition issues. The remaining label should be measured on a '0'-digit template so the fit decision doesn't flip as digits tick.
Minor
3. Misplaced doc comment. In media/src/route/prefs.rs (about lines 937–945) the new hud_end_time / restore_hud_end_time were inserted between the doc comment "What sits under the focused poster…" and pub fn under_posters. That comment now attaches to hud_end_time, and under_posters has none. Move the new functions above that comment.
Checked and clean
- Sans-IO: the wall clock and the
localtime_rconversion have one production caller,run::hud_modelin the app layer, andHudModel.end_timereaches the HUD as frame data, liketoday. No screen, appkit, ui or data step reads a clock or a global for this. Replay returnsNone. - Ledgers and layering:
ci/check-deps.sh,check-ledger-ratchet.py,check-module-layers.pyandcheck-language-lists.pypass on the PR head; the diff touches nothing underci/and adds nocfg(test)fork. - Settings: the per-profile setting uses the shared row, descriptor, live-cell and
choosemachinery, the same pattern asTrailerAutoplay. - Playback speed and
is_movie: the applied rate is a pure read ofPlaybackSession(URI is 1x, matching where speed is offered);is_movieis set consistently at every construction site.
Not verified
- Whether the built-in's wider label can overlap any other classic decor op besides the elapsed clock. The renderer only guards against the elapsed clock (
el_r + 20), and no lint covers the rest; this needs the simulator or the TV. - Whether simulator or controlled-run HUD captures of live (non-replay) playback now include a real wall-clock time and become nondeterministic.
- On-device validation is still pending per the PR body.
doc-claim-auditorhasn't been run overdocs/hud-plugins.md(D2/D3) and theClockRectscontract; the lane change above would make that worthwhile.
Generated by Claude Code
|
Thanks for the review @GLinnik21! I addressed the requested changes in 7786fb6.
All four GitHub Actions workflows passed, including the ARMv7 binary-size check and HUD parser fuzzing. |
GLinnik21
left a comment
There was a problem hiding this comment.
The follow-up covers everything from the first round, thanks. A few things left before merge:
docs/hud-plugins.md(~line 1264): the Classic listing is missing"end_time_width": 320in the playbar cell. The table below it already says 320.docs/localization.md(~line 143): "playback clocks remain durations" isn't quite true any more, since the HUD can now show a finish time of day. Please say so there.docs/parity-gaps.md(~line 1252): it says there's no "ends at" readout. Mark that half closed.end_time_widthneeds to go into HUD format 1.1, not 1.0, because the plugin is already released. That means.at((1, 1))on the field, 1.1 inSUPPORTED/CURRENT, a newsite/hud/schema/hud/1.1.json, Classic moved to 1.1, and the versioning text indocs/hud-plugins.mdupdated.
Still pending from the PR description: checking it on a TV.
Generated by Claude Code
This is really important since we have https://huds.plxnative.com/ |
|
Thanks for the follow-up, @GLinnik21 ! I addressed the remaining review points in the latest revision 5ffa1b2
All four GitHub Actions workflows passed on 5ffa1b2, including both unit-test configurations, the ARMv7 binary-size check, the simulator checks, and HUD parser fuzzing. |


Summary
playbar.end_time_width. Classic declares 320 px in HUD format 1.1, and installed 1.1 packages can opt in with the same field. The released HUD 1.0 schema is unchanged. The HUD lint checks the reserved space and both hour cycles.Validation
7786fb6, including both host unit-test configurations, the ARMv7 cross-build and binary-size budget, the simulator checks, and HUD parser fuzzing. View checksLocalization review
This AI-assisted follow-up removes the translated HUD sentence from all catalogs. The Settings copy carries over from the original change, with a straight apostrophe in the Italian detail. Native review of the retained Settings copy is pending confirmation.