fix(widescreen): the system overlay's header and prompts at their own shape on a wider picture, not stretched #3218

Merged
HumanBean merged 1 commit from dyst/Longshot:fix/widescreen-overlay into main 2026-12-05 17:25:34 +00:00
Member

Summary

On a picture wider than 16:9 with Ultrawide menus at Centred (blurred sides or black bars), the system screens' header and button prompts are stretched sideways: the file select's Back, the save screen's prompts, Options'. To see it on main: 21:9, Ultrawide menus Centred, title screen > Continue, the "Load" header and the prompt at the bottom right.

The Centred modes keep the system overlay (SystemOverlay_00) over the whole picture because it also draws the item wheel's background, so everything in it is drawn ratio / (16/9) as wide as it should be (1.34 at 21:9), and its prompts land behind the blurred sides. This keeps the overlay whole and draws two of its panes, N_Header_00 and N_Footer_00, at their own shape in the middle 16:9, with the rest of the menu. "Full width" still stretches, as it asks to. "Extended" already plans the overlay and is unchanged.

Read first: Rule::Squeeze in game/mods/widescreen/src/names.rs, whole_squeeze in ui.rs, placed and note_squeezed in panes.rs.

This replaces #2817 (opened against mod-api, closed); the same commit, on main.

Testing

Tested: Windows 11, RTX 3080 (NVIDIA 621.47), 3440x1440 (21:9), Ultrawide menus Centred, played by hand in a build of main f359e2621 with this commit and #2642's clickable prompts (the clicks' PR is separate; this commit does not need it). Title screen > Continue: the "Load" header and Back are in the middle 16:9 at their own shape, not stretched; saving from the System tab: the prompts sit in the middle, over the menu, not behind the blurred sides. The same run on main + #2642 alone, earlier the same day: Back stretched on Load, the save prompts behind the blurred sides.

cargo fmt --check, cargo test and cargo clippy of sysmod-widescreen: queued on this PC behind other builds; their results follow as a comment.

Still to test:

  • Windows, 32:9 and a narrower picture (16:10, 4:3): the file select's and Options' prompts, expecting them unstretched and, narrower than 16:9, as before (by hand)
  • Linux, AMD, 21:9: the same (by hand)
  • The item wheel's background at 21:9, Centred: expecting it over the whole picture, as before (by hand)

Measurements

Not measured: a layout being built costs one more name check (its root's); the two panes' matrices are set where the mod already sets the layout's.

Risks

The Widescreen mod only: a pane of SystemOverlay_00 that is not under its header or footer keeps its place. No setting, save or cache changes; a revert is enough.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named). Not run whole yet: the crate's tests above.
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here (a_system_overlay_kept_whole_has_its_header_and_prompts_at_their_own_shape_in_the_middle).
  • Screenshots of the same spot on main and here, for a change that shows on screen. None yet: the run was played by hand.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary On a picture wider than 16:9 with **Ultrawide menus** at Centred (blurred sides or black bars), the system screens' header and button prompts are stretched sideways: the file select's **Back**, the save screen's prompts, Options'. To see it on `main`: 21:9, Ultrawide menus Centred, title screen > Continue, the "Load" header and the prompt at the bottom right. The Centred modes keep the system overlay (`SystemOverlay_00`) over the whole picture because it also draws the item wheel's background, so everything in it is drawn ratio / (16/9) as wide as it should be (1.34 at 21:9), and its prompts land behind the blurred sides. This keeps the overlay whole and draws two of its panes, `N_Header_00` and `N_Footer_00`, at their own shape in the middle 16:9, with the rest of the menu. "Full width" still stretches, as it asks to. "Extended" already plans the overlay and is unchanged. Read first: `Rule::Squeeze` in `game/mods/widescreen/src/names.rs`, `whole_squeeze` in `ui.rs`, `placed` and `note_squeezed` in `panes.rs`. This replaces #2817 (opened against `mod-api`, closed); the same commit, on `main`. ## Testing **Tested:** Windows 11, RTX 3080 (NVIDIA 621.47), 3440x1440 (21:9), Ultrawide menus Centred, played by hand in a build of `main` f359e2621 with this commit and #2642's clickable prompts (the clicks' PR is separate; this commit does not need it). Title screen > Continue: the "Load" header and **Back** are in the middle 16:9 at their own shape, not stretched; saving from the System tab: the prompts sit in the middle, over the menu, not behind the blurred sides. The same run on `main` + #2642 alone, earlier the same day: Back stretched on Load, the save prompts behind the blurred sides. `cargo fmt --check`, `cargo test` and `cargo clippy` of `sysmod-widescreen`: queued on this PC behind other builds; their results follow as a comment. **Still to test:** - Windows, 32:9 and a narrower picture (16:10, 4:3): the file select's and Options' prompts, expecting them unstretched and, narrower than 16:9, as before (by hand) - Linux, AMD, 21:9: the same (by hand) - The item wheel's background at 21:9, Centred: expecting it over the whole picture, as before (by hand) ## Measurements Not measured: a layout being built costs one more name check (its root's); the two panes' matrices are set where the mod already sets the layout's. ## Risks The Widescreen mod only: a pane of `SystemOverlay_00` that is not under its header or footer keeps its place. No setting, save or cache changes; a revert is enough. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). Not run whole yet: the crate's tests above. - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here (`a_system_overlay_kept_whole_has_its_header_and_prompts_at_their_own_shape_in_the_middle`). - [ ] Screenshots of the same spot on `main` and here, for a change that shows on screen. None yet: the run was played by hand. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(widescreen): the system overlay's header and prompts at their own shape on a wider picture, not stretched
Some checks failed
CI / What the change needs (pull_request) Successful in 8s
CI / Third-party parts and guide screenshots (pull_request) Successful in 13s
PR description / Title and description (pull_request_target) Failing after 6s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 18s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 1m29s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 13m14s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 10m7s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 13m6s
CI / Website build and checks (pull_request) Failing after 43s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 49m29s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 1h0m5s
0d7807bfa3
With Ultrawide menus Centred the system overlay (SystemOverlay_00) is kept over the whole picture, as it draws the
item wheel's background, so its header and its button prompts (the file select's Back, the save list's) were
stretched by the picture's ratio over 16:9. Those two panes are drawn at their own shape in the middle 16:9.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Tested in game: Windows 11, RTX 3080 (NVIDIA 621.47), 3440x1440 (21:9), Ultrawide menus Centred, by hand on main f359e2621 + this + #2642's clicks: title > Continue's Load header and Back in the middle 16:9, unstretched; the save prompts over the menu, not behind the blurred sides (both were wrong in the same build without this commit).

Tested in game: Windows 11, RTX 3080 (NVIDIA 621.47), 3440x1440 (21:9), Ultrawide menus Centred, by hand on main f359e2621 + this + #2642's clicks: title > Continue's Load header and Back in the middle 16:9, unstretched; the save prompts over the menu, not behind the blurred sides (both were wrong in the same build without this commit).
dyst changed title from WIP: fix(widescreen): the system overlay's header and prompts at their own shape on a wider picture, not stretched to fix(widescreen): the system overlay's header and prompts at their own shape on a wider picture, not stretched 2026-12-05 01:45:11 +00:00
BeanBot left a comment

Recommendation: Approve. The fix corrects the reported layout in the author's 21:9 run, but restarting the widescreen mod misses existing overlay panes. The remaining affected screen layouts also need a visual check. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

The change keeps the system overlay over the full picture while squeezing its header and footer into the centered 16:9 area. It adds a small amount of layout bookkeeping, but that bookkeeping does not cover mod shutdown and restart.

Should fix (1): not blocking, but worth doing before merging.

  • L1 game/mods/widescreen/src/sites.rs:170: The squeeze list is populated only when a layout is built, so restarting the mod misses overlays that already exist. (more on the line) Do: Discover the relevant panes for existing layouts on first placement or otherwise repopulate them when the mod starts, and test stop/start with an already-built overlay.

Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)

  • L2 game/mods/widescreen/src/panes.rs:174: The visual change still needs the remaining layout cases checked. (more on the line) Do: Run those cases once in game and provide before-and-after screenshots of the same affected screen.

@fix can do L1.

Questions (1) (not confirmed from the code; they don't hold the recommendation)

  • game/mods/widescreen/src/panes.rs:174: Does marking the overlay's root transform dirty cause the game to recalculate the footer's transform on the next pass?

Checks: Still running: 11 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes: the author reports that the Load header and Back prompt were stretched on main and correctly shaped with this change at 3440×1440 on Windows with an RTX 3080. Save prompts also moved over the menu. Other aspect ratios and the item wheel remain untested.

Other systems: The change affects system overlay layouts on Windows and Linux, including centered menus and the item wheel. Extended and full-width modes follow different mask paths; the added unit test covers full width but not Extended or live mod reload.

Switches: None added, changed or removed.

Reviewed: 0d7807bfa3 against f359e26213: Read AGENTS.md, CONTRIBUTING.md, the available standards and pull request template, the commit and diff, and the changed code with its layout, state, mask and lifecycle callers. Skimmed existing tests and related layout helpers; no recorded runs, translations or generated files were changed. docs/review-checklist.md was not present.; nothing run (a code review).

Checked and fine:

  • The commit records AI assistance in its trailers.
  • The added game-free test exercises the footer transform and distinguishes centered from full-width behavior.
  • No game-derived files, generated files, API versions or switch definitions are changed.

Testing: No code, tests or project scripts were run, as requested. The supplied CI checks are still running.

Overlaps and merge order: The description says this replaces closed PR #2817; #2642 is separate and was present in the author's run.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as dyst took it out of WIP. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The fix corrects the reported layout in the author's 21:9 run, but restarting the widescreen mod misses existing overlay panes. The remaining affected screen layouts also need a visual check. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. The change keeps the system overlay over the full picture while squeezing its header and footer into the centered 16:9 area. It adds a small amount of layout bookkeeping, but that bookkeeping does not cover mod shutdown and restart. **Should fix (1)**: not blocking, but worth doing before merging. - **L1** `game/mods/widescreen/src/sites.rs:170`: The squeeze list is populated only when a layout is built, so restarting the mod misses overlays that already exist. (more on the line) **Do:** Discover the relevant panes for existing layouts on first placement or otherwise repopulate them when the mod starts, and test stop/start with an already-built overlay. **Testing before merging (1)** (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation) - **L2** `game/mods/widescreen/src/panes.rs:174`: The visual change still needs the remaining layout cases checked. (more on the line) **Do:** Run those cases once in game and provide before-and-after screenshots of the same affected screen. `@fix` can do L1. **Questions (1)** (not confirmed from the code; they don't hold the recommendation) - `game/mods/widescreen/src/panes.rs:174`: Does marking the overlay's root transform dirty cause the game to recalculate the footer's transform on the next pass? **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes: the author reports that the Load header and Back prompt were stretched on main and correctly shaped with this change at 3440×1440 on Windows with an RTX 3080. Save prompts also moved over the menu. Other aspect ratios and the item wheel remain untested. **Other systems:** The change affects system overlay layouts on Windows and Linux, including centered menus and the item wheel. Extended and full-width modes follow different mask paths; the added unit test covers full width but not Extended or live mod reload. **Switches:** None added, changed or removed. **Reviewed:** 0d7807bfa339 against f359e2621315: Read AGENTS.md, CONTRIBUTING.md, the available standards and pull request template, the commit and diff, and the changed code with its layout, state, mask and lifecycle callers. Skimmed existing tests and related layout helpers; no recorded runs, translations or generated files were changed. docs/review-checklist.md was not present.; nothing run (a code review). **Checked and fine:** - The commit records AI assistance in its trailers. - The added game-free test exercises the footer transform and distinguishes centered from full-width behavior. - No game-derived files, generated files, API versions or switch definitions are changed. **Testing:** No code, tests or project scripts were run, as requested. The supplied CI checks are still running. **Overlaps and merge order:** The description says this replaces closed PR #2817; #2642 is separate and was present in the author's run. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as dyst took it out of WIP. Nothing was run; a maintainer decides.</sub>
@ -171,2 +171,4 @@
return; // (off: the transforms are the game's)
}
let squeeze = self.shape.whole_squeeze;
if squeeze < 1.0 && self.squeezed.iter().any(|&(p, l)| p == pane && mem.alive(p, l)) {
Member

L2 (should fix): The visual change still needs the remaining layout cases checked.

When: The reported run covers 21:9 Load and save prompts, but does not show Options, the item wheel background, or the 32:9 and narrower layouts named in Still to test.

Do: Run those cases once in game and provide before-and-after screenshots of the same affected screen.

**L2** (should fix): The visual change still needs the remaining layout cases checked. *When:* The reported run covers 21:9 Load and save prompts, but does not show Options, the item wheel background, or the 32:9 and narrower layouts named in Still to test. **Do:** Run those cases once in game and provide before-and-after screenshots of the same affected screen.
@ -167,6 +167,7 @@ fn picture_draw(cx: &mut SiteCx<'_, '_>) -> i32 {
/// `ui.layoutBuilt`: a list widened as it is built.
fn layout_built(cx: &mut SiteCx<'_, '_>) -> i32 {
let layout = wide::site_built(cx.guest()).0;
with_ui(|ui| ui.note_squeezed(&GameMem, layout));
Member

L1 (should fix): The squeeze list is populated only when a layout is built, so restarting the mod misses overlays that already exist.

When: If the widescreen system mod is reloaded while SystemOverlay_00 remains built, release clears the list and the new handler receives no layoutBuilt event for that existing layout. Subsequent placements therefore do not squeeze its header or footer, leaving the reported stretching until the layout is rebuilt.

Do: Discover the relevant panes for existing layouts on first placement or otherwise repopulate them when the mod starts, and test stop/start with an already-built overlay.

**L1** (should fix): The squeeze list is populated only when a layout is built, so restarting the mod misses overlays that already exist. *When:* If the widescreen system mod is reloaded while SystemOverlay_00 remains built, release clears the list and the new handler receives no layoutBuilt event for that existing layout. Subsequent placements therefore do not squeeze its header or footer, leaving the reported stretching until the layout is rebuilt. **Do:** Discover the relevant panes for existing layouts on first placement or otherwise repopulate them when the mod starts, and test stop/start with an already-built overlay.
Author
Member

Checks on this PC (Windows 11, Rust 1.99.1 gnullvm), on the head 0d7807bfa: cargo fmt --check -p sysmod-widescreen clean; cargo test -p sysmod-widescreen 61 passed, 0 failed; cargo clippy -p sysmod-widescreen --all-targets nothing in this crate (its four warnings are main's, in build-core, build-assets and host-sys). The same with #3219's commit beneath it: the same results, and game-core 411 passed.

Checks on this PC (Windows 11, Rust 1.99.1 gnullvm), on the head 0d7807bfa: `cargo fmt --check -p sysmod-widescreen` clean; `cargo test -p sysmod-widescreen` 61 passed, 0 failed; `cargo clippy -p sysmod-widescreen --all-targets` nothing in this crate (its four warnings are main's, in `build-core`, `build-assets` and `host-sys`). The same with #3219's commit beneath it: the same results, and `game-core` 411 passed.
HumanBean deleted branch fix/widescreen-overlay 2026-12-05 17:25:35 +00:00
Author
Member

On BeanBot's review 3379 (merged at 0d7807bfa), followed up in #3281:

  • L1, a restart misses an overlay already built: confirmed in game and fixed there. Switched off and on while the game runs (setEnabled, as the Mods tab's switch does), the header and Back were stretched across the whole picture at 21:9, Centred, until the overlay was built again. The overlay is built once at boot, so in practice that means until the game restarts. A layout's root, the first time it is placed, now has its squeezed panes noted; the start's forced pass places the root before the panes made from it.
  • The question, does marking the root dirty remake the footer: no. The squeeze itself does not depend on it: while a change of shape is forced (the start included), ui.calcDirty and ui.paneDirty give every pane the transform bit for a few frames, so the header and footer are remade and placed directly. But the mod's stop marked only the panes it notes (the overlay's root), and in game the header and Back stayed squeezed with the mod off. The follow-up marks every pane of a layout with squeezed panes as the mod stops.
  • L2, the other layouts by hand: still to test, as #3218's Still to test lists them.
On BeanBot's review 3379 (merged at 0d7807bfa), followed up in #3281: - **L1, a restart misses an overlay already built:** confirmed in game and fixed there. Switched off and on while the game runs (`setEnabled`, as the Mods tab's switch does), the header and Back were stretched across the whole picture at 21:9, Centred, until the overlay was built again. The overlay is built once at boot, so in practice that means until the game restarts. A layout's root, the first time it is placed, now has its squeezed panes noted; the start's forced pass places the root before the panes made from it. - **The question, does marking the root dirty remake the footer:** no. The squeeze itself does not depend on it: while a change of shape is forced (the start included), `ui.calcDirty` and `ui.paneDirty` give every pane the transform bit for a few frames, so the header and footer are remade and placed directly. But the mod's stop marked only the panes it notes (the overlay's root), and in game the header and Back stayed squeezed with the mod off. The follow-up marks every pane of a layout with squeezed panes as the mod stops. - **L2, the other layouts by hand:** still to test, as #3218's Still to test lists them.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!3218
No description provided.