fix(menu): menu and FPS counter scaling, row highlights aligned with proper padding #3071
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3071
Loading…
Reference in a new issue
No description provided.
Delete branch "Veix/Longshot:fix/menu-size-rows"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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:
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 andMedium 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_nowinvk_menu.cpp, fromui::unititself), so the factors stay in vk_ui_theme.halone:
MkwUiInput.menu_share,MKW_UI_VERSION11 (ui_draw.h,game/crates/ui/src/input.rs).Small was two thirds of its Medium while the menu's Small is 0.87 of Medium. Small is now 1.3 (
fps-countercounter.ts), the Menu size's step; Medium and Large are unchanged (Large already was the menu's step).Fieldin 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
2ca7d4f7with this change, 2560x1440 fullscreen, in the game and against mainon 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 ofMkwUiInput: 168 bytes,menu_shareat 160);cargo check -p longshot-game -p modtool --all-targets: clean;tests/test_ui_renderer.py(ui_draw.h againstthe Rust twins, version 11): passed.
longshot-builder mod testfor each system mod with tests (they use the kit): all 21, 221 passed, 0 failed (grass: its one test skips itself).Still to test:
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
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
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
Possibly related, for context:
@review
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)
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:
e4e7b944f4against2ca7d4f741: 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:
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.
@review
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)
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)
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:
8b9b0e25aeagainst2ca7d4f741: 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:
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.