fix(menu): menu and FPS counter scaling, row highlights aligned with proper padding #3071

Merged
HumanBean merged 5 commits from Veix/Longshot:fix/menu-size-rows into main 2026-12-03 15:03:50 +00:00
Member

Summary

Fix menu and FPS counter scaling, and align row highlights with proper padding.

Three things in the Insert menu and the FPS counter since the mod API:

  • Menu size changed almost nothing. It reached only the frame around the page (the banner, its texts, the margins,
    the controller bar). The page's rows, texts and dropdowns are drawn at the UI's scale, which follows the window alone
    (game_ui::core::screen_for), and the page's density was 1 at every Menu size (longshot-game/src/ui.rs). Small and
    Medium looked the same, and Small was far too big. Now the page is drawn at the Menu size's share of Medium:
    0.87x at Small, 1x at Medium, 1.33x at Large, the steps the frame around it already takes. The renderer gives the
    share with the unit (menu_unit_now in vk_menu.cpp, from ui::unit itself), so the factors stay in vk_ui_theme.h
    alone: MkwUiInput.menu_share, MKW_UI_VERSION 11 (ui_draw.h, game/crates/ui/src/input.rs).
  • The FPS counter's Small did not match the menu's. Its sizes were 1.0, 1.5 and 2.0 (Small, Medium, Large), so its
    Small was two thirds of its Medium while the menu's Small is 0.87 of Medium. Small is now 1.3 (fps-counter
    counter.ts), the Menu size's step; Medium and Large are unchanged (Large already was the menu's step).
  • The focused row's highlight left a gap after its control. A labelled row (Field in the kit, modapi/ui/kit.tsx)
    had the same padding on both sides; a dropdown or slider is as tall as the row, so the focus highlight met it at the
    top and bottom but stood one padding off on the right. The row has no right padding now: the control ends at the
    highlight's edge. A checkbox or small button, smaller than the row, keeps that room after it (fieldCompact).

To see it on main: Insert > Gameplay, switch Menu size between Small and Medium (the rows stay the same size); focus
any dropdown row with the keys (the strip between the dropdown and the highlight's right edge); Debug > FPS counter size
Small against Medium.

Written with AI assistance (Claude).

Testing

Tested: Windows 11, RTX 4070 SUPER, main 2ca7d4f7 with this change, 2560x1440 fullscreen, in the game and against main
on the same profile: Menu size Small, Medium and Large draw the page's rows smaller and larger with the frame; the FPS
counter's Small sits with the menu's Small; a focused dropdown row's highlight meets its control on the right; a focused
checkbox row keeps the room after the checkbox.

  • cargo test -p game-ui: 159 passed, 0 failed (its layout checks of MkwUiInput: 168 bytes, menu_share at 160);
    cargo check -p longshot-game -p modtool --all-targets: clean; tests/test_ui_renderer.py (ui_draw.h against
    the Rust twins, version 11): passed.
  • longshot-builder mod test for each system mod with tests (they use the kit): all 21, 221 passed, 0 failed (grass: its one test skips itself).

Still to test:

  • Steam Deck (1280x800, handheld): Menu size Small, Medium, Large, the page fits its card at each and the rows stay
    legible at Small (by hand)

Measurements

Nothing to measure: the menu's and the FPS counter's sizes and a row's padding.

Risks

What players see changes: at Small and Large the menu's rows are smaller and larger than before (Medium is as it was),
the FPS counter's Small is larger (1.3 for 1.0), and every mod's labelled rows end their control at the row's edge. No
setting or saved value 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).
  • 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

  • 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 **Fix menu and FPS counter scaling, and align row highlights with proper padding.** Three things in the Insert menu and the FPS counter since the mod API: - **Menu size changed almost nothing.** It reached only the frame around the page (the banner, its texts, the margins, the controller bar). The page's rows, texts and dropdowns are drawn at the UI's scale, which follows the window alone (`game_ui::core::screen_for`), and the page's density was 1 at every Menu size (`longshot-game/src/ui.rs`). Small and Medium looked the same, and Small was far too big. Now the page is drawn at the Menu size's share of Medium: 0.87x at Small, 1x at Medium, 1.33x at Large, the steps the frame around it already takes. The renderer gives the share with the unit (`menu_unit_now` in `vk_menu.cpp`, from `ui::unit` itself), so the factors stay in vk_ui_theme.h alone: `MkwUiInput.menu_share`, `MKW_UI_VERSION` 11 (`ui_draw.h`, `game/crates/ui/src/input.rs`). - **The FPS counter's Small did not match the menu's.** Its sizes were 1.0, 1.5 and 2.0 (Small, Medium, Large), so its Small was two thirds of its Medium while the menu's Small is 0.87 of Medium. Small is now 1.3 (`fps-counter` `counter.ts`), the Menu size's step; Medium and Large are unchanged (Large already was the menu's step). - **The focused row's highlight left a gap after its control.** A labelled row (`Field` in the kit, `modapi/ui/kit.tsx`) had the same padding on both sides; a dropdown or slider is as tall as the row, so the focus highlight met it at the top and bottom but stood one padding off on the right. The row has no right padding now: the control ends at the highlight's edge. A checkbox or small button, smaller than the row, keeps that room after it (`fieldCompact`). To see it on main: Insert > Gameplay, switch Menu size between Small and Medium (the rows stay the same size); focus any dropdown row with the keys (the strip between the dropdown and the highlight's right edge); Debug > FPS counter size Small against Medium. Written with AI assistance (Claude). ## Testing **Tested:** Windows 11, RTX 4070 SUPER, main 2ca7d4f7 with this change, 2560x1440 fullscreen, in the game and against main on the same profile: Menu size Small, Medium and Large draw the page's rows smaller and larger with the frame; the FPS counter's Small sits with the menu's Small; a focused dropdown row's highlight meets its control on the right; a focused checkbox row keeps the room after the checkbox. - `cargo test -p game-ui`: 159 passed, 0 failed (its layout checks of `MkwUiInput`: 168 bytes, `menu_share` at 160); `cargo check -p longshot-game -p modtool --all-targets`: clean; `tests/test_ui_renderer.py` (ui_draw.h against the Rust twins, version 11): passed. - `longshot-builder mod test` for each system mod with tests (they use the kit): all 21, 221 passed, 0 failed (grass: its one test skips itself). **Still to test:** - Steam Deck (1280x800, handheld): Menu size Small, Medium, Large, the page fits its card at each and the rows stay legible at Small (by hand) ## Measurements Nothing to measure: the menu's and the FPS counter's sizes and a row's padding. ## Risks What players see changes: at Small and Large the menu's rows are smaller and larger than before (Medium is as it was), the FPS counter's Small is larger (1.3 for 1.0), and every mod's labelled rows end their control at the row's edge. No setting or saved value 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). - [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] 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)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
test(ui): the Menu size's share of Medium on every screen
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
e4e7b944f4
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Tested in game: Windows 11, RTX 4070 SUPER, 2560x1440, against main: Menu size Small/Medium/Large scale the rows; FPS counter Small matches the menu's; a focused dropdown row's highlight meets its control, a checkbox keeps its room

Tested in game: Windows 11, RTX 4070 SUPER, 2560x1440, against main: Menu size Small/Medium/Large scale the rows; FPS counter Small matches the menu's; a focused dropdown row's highlight meets its control, a checkbox keeps its room
Member

Possibly related, for context:

  • PR #2767 fix(ui): menus and the item quick select follow a live switch of Ultrawide menus — Open UI/menu layout work; no clear overlap with this menu sizing fix
Possibly related, for context: - PR #2767 fix(ui): menus and the item quick select follow a live switch of Ultrawide menus — Open UI/menu layout work; no clear overlap with this menu sizing fix
Member
@review
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left (a run of the change itself). The reported Windows run shows the visual fixes working. Recommend approval; not approved on the forge.

The change scales hosted menu rows with Menu size, enlarges the FPS counter’s Small setting, and adjusts the right edge of labelled controls. It makes the menu more consistent, at the cost of changing visible sizes and spacing for existing users and mods.

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)

  • L1: The visual changes have a written in-game result but no before-and-after screenshots for review. When: The changed row and counter sizes and the focused control edges cannot be visually compared from the reported results alone. Do: Provide screenshots of the same menu and counter on main and this head, including the focused dropdown and checkbox.

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

  • game/crates/longshot-game/src/ui.rs:201: What case fails at HEAD because the hosted-page integration is not covered by a game-free test?
  • game/modapi/ui/kit.tsx:152: What case fails at HEAD because the row edges are not covered by a layout test?
  • game/mods/fps-counter/src/counter.ts:57: What case fails at HEAD because the displayed scale is not covered by a regression test?

Checks: Still running: 11 checks.

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

Does it help: Yes, as reported in the author’s Windows 11, RTX 4070 SUPER in-game comparison against main: the rows scale, the counter matches, and the tested highlights align. This is not a performance change.

Other systems: The density change applies to Insert-menu hosted pages, including mod pages and compact mode; other hosted surfaces retain their previous density. The shared kit spacing affects labelled rows in system and third-party mods. The reported run covers Windows at 2560×1440; Steam Deck remains listed for testing.

Switches: None.

Reviewed: e4e7b944f4 against 2ca7d4f741: Read AGENTS.md, CONTRIBUTING.md, the PR template, applicable standards and screenshot guidance, the diff and commit messages, and the four changed files. Examined the menu unit producer, hosted density handling, kit callers and FPS counter tests. The full UI engine, system mods, translations and recorded guide assets were not read in full; the screenshot guidance and relevant references were skimmed.; nothing run (a code review).

Checked and fine:

  • All four commits record AI assistance with Co-Authored-By trailers.
  • The menu-size ratios match the renderer’s Small, Medium and Large unit constants.
  • No game-derived files, generated outputs, API version changes or new switches appear in the diff.

Testing: No commands from the project were run during review. The author reports game-free tests and an in-game Windows comparison; CI was still running.

Overlaps and merge order: Not checked; network access is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The code is ready: only testing is left (a run of the change itself). The reported Windows run shows the visual fixes working. Recommend approval; not approved on the forge. The change scales hosted menu rows with Menu size, enlarges the FPS counter’s Small setting, and adjusts the right edge of labelled controls. It makes the menu more consistent, at the cost of changing visible sizes and spacing for existing users and mods. **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) - **L1**: The visual changes have a written in-game result but no before-and-after screenshots for review. *When:* The changed row and counter sizes and the focused control edges cannot be visually compared from the reported results alone. **Do:** Provide screenshots of the same menu and counter on main and this head, including the focused dropdown and checkbox. **Questions (3)** (not confirmed from the code; they don't hold the recommendation) - `game/crates/longshot-game/src/ui.rs:201`: What case fails at HEAD because the hosted-page integration is not covered by a game-free test? - `game/modapi/ui/kit.tsx:152`: What case fails at HEAD because the row edges are not covered by a layout test? - `game/mods/fps-counter/src/counter.ts:57`: What case fails at HEAD because the displayed scale is not covered by a regression test? **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes, as reported in the author’s Windows 11, RTX 4070 SUPER in-game comparison against main: the rows scale, the counter matches, and the tested highlights align. This is not a performance change. **Other systems:** The density change applies to Insert-menu hosted pages, including mod pages and compact mode; other hosted surfaces retain their previous density. The shared kit spacing affects labelled rows in system and third-party mods. The reported run covers Windows at 2560×1440; Steam Deck remains listed for testing. **Switches:** None. **Reviewed:** e4e7b944f44a against 2ca7d4f74182: Read AGENTS.md, CONTRIBUTING.md, the PR template, applicable standards and screenshot guidance, the diff and commit messages, and the four changed files. Examined the menu unit producer, hosted density handling, kit callers and FPS counter tests. The full UI engine, system mods, translations and recorded guide assets were not read in full; the screenshot guidance and relevant references were skimmed.; nothing run (a code review). **Checked and fine:** - All four commits record AI assistance with Co-Authored-By trailers. - The menu-size ratios match the renderer’s Small, Medium and Large unit constants. - No game-derived files, generated outputs, API version changes or new switches appear in the diff. **Testing:** No commands from the project were run during review. The author reports game-free tests and an in-game Windows comparison; CI was still running. **Overlaps and merge order:** Not checked; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
fix(menu): the renderer gives the Menu size's share of Medium
Some checks failed
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Failing after 8s
8b9b0e25ae
The game side computed the share from a copy of Medium's factor (0.9 in vk_ui_theme.h). The renderer now sends it
with the unit (MkwUiInput.menu_share, MKW_UI_VERSION 11), from ui::unit itself, so the factors live in one place.
menu_layout::size_share and its test are gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member
@review
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left (a run of the change itself). The reported in-game results support the visual fixes, but before-and-after screenshots are still needed to review them. Recommend approval; not approved on the forge.

The menu page follows the selected menu size, the FPS counter’s Small size is larger, and focused row highlights meet full-height controls. The renderer now supplies the menu-size ratio directly, avoiding a duplicate calculation.

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)

  • L1: The visual changes have a written in-game result but no before-and-after screenshots for review. When: The changed row and counter sizes and the focused control edges cannot be visually compared from the reported results alone. Do: Provide screenshots of the same menu and counter on main and this head, including the focused dropdown and checkbox.

Since the last review (on e4e7b944f4)
Still open: L1 (The visual changes have a written in-game result but no before-and-after screenshots for r…)

Checks: Still running: 11 checks.

Also noticed (2; not asked for, not blocking)
  • The previous game-free test of the menu-size shares was removed when the renderer became the source of the ratio.
  • The pull request lists a Steam Deck visual check as still to test.
More: does it help, other systems, switches, what was read

Does it help: Unproven for visual review: the author reports the expected results on Windows 11 with an RTX 4070 SUPER at 2560×1440, but supplied no before-and-after screenshots.

Other systems: The menu layout applies across platforms and display sizes. The author reports Windows results; Steam Deck at 1280×800 remains untested.

Switches: No switches added, changed or removed.

Reviewed: 8b9b0e25ae against 2ca7d4f741: Read the repository rules and pull request template, both diffs, commit list, and relevant menu-share references. The changed code files were not all read in full; the unavailable Tooling rules and absent review checklist were not read.; nothing run (a code review).

Checked and fine:

  • The C and Rust input layouts both add menu_share at offset 160 and advance the UI version to 11.
  • The renderer supplies the ratio from the same unit function used for the menu frame.

Testing: No commands that build or run project code were executed. The author reports game-ui tests, cargo checks, renderer checks and system-mod tests passing; CI is still running.

Overlaps and merge order: Not checked; network access is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by Veix. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The code is ready: only testing is left (a run of the change itself). The reported in-game results support the visual fixes, but before-and-after screenshots are still needed to review them. Recommend approval; not approved on the forge. The menu page follows the selected menu size, the FPS counter’s Small size is larger, and focused row highlights meet full-height controls. The renderer now supplies the menu-size ratio directly, avoiding a duplicate calculation. **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) - **L1**: The visual changes have a written in-game result but no before-and-after screenshots for review. *When:* The changed row and counter sizes and the focused control edges cannot be visually compared from the reported results alone. **Do:** Provide screenshots of the same menu and counter on main and this head, including the focused dropdown and checkbox. **Since the last review** (on e4e7b944f44a) Still open: L1 (The visual changes have a written in-game result but no before-and-after screenshots for r…) **Checks:** Still running: 11 checks. <details> <summary>Also noticed (2; not asked for, not blocking)</summary> - The previous game-free test of the menu-size shares was removed when the renderer became the source of the ratio. - The pull request lists a Steam Deck visual check as still to test. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven for visual review: the author reports the expected results on Windows 11 with an RTX 4070 SUPER at 2560×1440, but supplied no before-and-after screenshots. **Other systems:** The menu layout applies across platforms and display sizes. The author reports Windows results; Steam Deck at 1280×800 remains untested. **Switches:** No switches added, changed or removed. **Reviewed:** 8b9b0e25ae07 against 2ca7d4f74182: Read the repository rules and pull request template, both diffs, commit list, and relevant menu-share references. The changed code files were not all read in full; the unavailable Tooling rules and absent review checklist were not read.; nothing run (a code review). **Checked and fine:** - The C and Rust input layouts both add menu_share at offset 160 and advance the UI version to 11. - The renderer supplies the ratio from the same unit function used for the menu frame. **Testing:** No commands that build or run project code were executed. The author reports game-ui tests, cargo checks, renderer checks and system-mod tests passing; CI is still running. **Overlaps and merge order:** Not checked; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by Veix. Nothing was run; a maintainer decides.</sub>
HumanBean deleted branch fix/menu-size-rows 2026-12-03 15:03:50 +00:00
Some checks failed
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Failing after 8s
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 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!3071
No description provided.