fix(menu): a row's help, its hint and why it is locked fit the help box in any language, the help cut, not the menu stopped #3149
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!3149
Loading…
Reference in a new issue
No description provided.
Delete branch "cuecuemoar/Longshot:fix/menu-help-1024"
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
With the game in Russian, the Insert menu doesn't open: it faults three times as it makes its rows and is stopped for the session ("Меню Longshot остановлено"). On
main: set Game language to Russian, Frame generation to Auto, start, press Insert. The log saysfault in longshot/ui commit: op N (create): help is at most 1024 bytes.The help box under a row shows the row's help, then the line about its value (its hint), then why it is locked, joined by
helpOf. The UI takes ahelpof 1024 bytes of UTF-8 at most, and a mod's declared help is held to that alone, but not the three together, nor a translation. Game frame rate cap's help is 918 bytes in Russian (2 bytes a letter), and its frame generation hint (framegen.capHint, ~150 bytes in Russian) took it past 1024. In English the same box is about 520 bytes.This keeps the hint and the locked reason whole and cuts the help to the room they leave, on a character (on a space when there is one in its second half), ended with "…". Text that fits is returned as it is: one length check (a UTF-16 unit is 3 bytes at most), else one count. The menu's search results and the empty Play recording page's line go through the same fit. The Mods tab had the same unbounded join: a mod's description (up to 1024 bytes) and the lines after it. Its description is now cut the same way, its author and the lines after it kept, and a mod setting's help, a cheat's note, a code warning and a command's help go through it too.
Read first:
game/mods/menu/src/view.tsfitHelp/cutTo/utf8Bytes, thengame/mods/mods-tab/src/view.tsfitHelpandmodHelp.The reporter suggested dropping the hint instead. I kept it: it says what the current value does ("60 -> 144 FPS: uneven pacing, try 36, 48, 72"), which is what the player looks at the box for, while the help's tail is static text. Not done here: a cap in the UI kit for every mod's
help(each mod is its own bundle; the menu and the Mods tab are the ones that join texts), and splitting the room between a hint and a locked reason that are both near 1024 bytes on their own (a mod's own row only; the end of the joined text is cut then).Fixes #3101
Testing
Tested: Windows 10, RTX 4090, driver 617.42, 2560x1440 at 144 Hz, keyboard and mouse. Game language Russian, Menu language Auto, Frame generation Auto (the log:
frame interpolation ready: Auto ... (144 Hz; up to 4 a game frame)), Game frame rate cap 60.v3.2.0-286-g1ee507cd3, the same two patches as this head, see below): Insert opens the menu in Russian; Graphics → Лимит кадров игры: the help cut at "…При ограничениях ниже 60…", then the hint "60 -> 144 FPS: неровный ритм…" whole. The Mods tab and the search opened. No fault in the run's log (0help is at most, 0faulted/stopped/did not startfor system/menu or system/mods-tab).main's menu (4d2e9e307's runtime, its own menu sources throughHOS_SYSTEM_MODS_DIR, the same settings): Insert →system/menu faulted ... op 4 (create): help is at most 1024 bytes, twice more at op 148, thenstopped after 3 faults in a minute, as the report says. The same runtime with this change'shelpOfin those sources: the menu opened, the same help box as above, no fault.Checks (Linux, WSL Ubuntu 22.04; the mod tests run on the fake game over the real
game_uicore, so they hit the same 1024 refusal):cargo test -p modtool --lib the_menu_passes_its_tests the_mods_tab_passes_its_tests: the two new cases fail on the test commit7068c73fb(menu: ... (#3101): Error: ... op 49 (create): help is at most 1024 bytes,mods-tab: ... (#3101): Error: ... op 56 (create): help is at most 1024 bytes) and pass on7ae23b1b8. On7ae23b1b8both pass whole (the menu'slayout: ... PLACEDcase, which failed onmain299ed5b70too, was fixed there by #3147).fitHelpcase checks the cut to the byte (3-byte characters with no space, 4-byte emoji, a hint too long alone): with the "…"'s 3 bytes or the blank line's 2 not counted, or the fast path's* 3as* 2, it fails.cargo test -p modtool --lib every_built_in_mod_passesok;tests/test_gfx_effects.py(readsview.ts) passes on both sides.--stricton 1ee507cd3 againstmain299ed5b70: 834 passed, 47 failed, 13 skipped on both, the same 47 files (they fail onmainin this WSL); the rebase ontof577a1aeachanged neither patch (git range-diff:=for both).Still to test:
fitHelptest.Measurements
Nothing on the frame path:
fitHelpruns when a row's help is made (rows are memoized, not each frame), and returns text that fits after one length check or one count. In the Russian run, opening the menu loggedsystem/menu: its script ran 2.4 ms of CPU in one frameonce (the warning is at 2 ms; 1.3 ms of itsettingsHost.decls);maincan't open the menu in Russian to compare, and the Mods tab logs its 2.2-2.5 ms once on both.Screenshot
In game, Russian, Graphics → Game frame rate cap, this PR at 1ee507cd3: the help cut with "…", the frame generation hint whole. On main the menu never opens (it faults 3 times and stops: "Меню Longshot остановлено"), so there is no box to show there.
Risks
A long help is shown shorter in a language where help, hint and locked reason pass 1024 bytes (today: Game frame rate cap with a frame generation hint, in Russian), ending in "…"; nothing else changes for text that fits. A revert is enough. Nothing changes in saves or settings.
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
mainand passes here.tests/that reads changed source is updated, not weakened.mainand here, for a change that shows on screen (Screenshot:mainhas no menu to show; the log lines in Testing).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
https://claude.ai/code/session_01VxeaZksJ2byiSpsd2k2YbY
Tested in game: Windows 10, RTX 4090, driver 617.42, 2560x1440 at 144 Hz, keyboard and mouse; Game language Russian, Frame generation Auto, cap 60. A runtime of 1ee507cd3 (same patches as this head): Insert opens the menu in Russian, Graphics > Game frame rate cap shows the help cut with an ellipsis and the frame generation hint whole; Mods tab and search opened; no fault in the log. main's menu on the same settings: 3 faults 'help is at most 1024 bytes', then system/menu stopped.
WIP: fix(menu): a row's help, its hint and why it is locked fit the help box in any language, the help cut, not the menu stoppedto fix(menu): a row's help, its hint and why it is locked fit the help box in any language, the help cut, not the menu stopped@review
Recommendation: Approve. The reported Russian menu failure is reproduced on main and absent in the reported run with this change. The head’s CI checks are still running. Nothing blocking is left. Recommend approval; not approved on the forge.
Fits joined menu and Mods tab help into the UI’s 1024-byte limit, preserving the hint where possible and shortening long descriptions. The cost is that some help text is no longer shown in full.
Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes. The author reports three menu faults and a stopped menu on main, versus an open menu with the Russian frame-rate hint intact on the changed runtime. The game-free regression cases reportedly fail before the fix and pass at head.
Other systems: The fitting code also affects search results, the empty recordings page and several Mods tab help fields. It runs in menu script rather than GPU-specific code; the reported in-game run covers Windows and the game-free checks cover Linux.
Switches: None.
Reviewed:
7ae23b1b8fagainstf577a1aeab: Read the repository rules, standards, PR template, diff, commit messages, changed fitting code and its callers. Skimmed the unchanged portions of the large menu and Mods tab test files and the surrounding menu view code; no generated files or translations changed. docs/review-checklist.md is absent.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no code or tests were run. The author reports an in-game Windows run and game-free tests on Linux; 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 HumanBean. Nothing was run; a maintainer decides.
@rebase
I rebased this pull request onto
main(2b3c2f07b6): the new head isc857527581.Conflicts resolved
Nothing was built or run: read the resolution before merging.
Automated rebase by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
7ae23b1b8fc857527581Recommendation: Approve. The reported Russian menu fault is fixed in the recorded game run, and the rebased search import retains both the help fitting and Mods search. CI is still running and the pull request is currently not mergeable. Nothing blocking is left. Recommend approval; not approved on the forge.
Long help text is shortened to fit the UI’s byte limit while preserving the hint and lock reason where possible, preventing the menu from stopping. The change adds byte-counting and truncation code to the menu and Mods tab.
Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes. The author reports that main faulted three times and stopped with Russian and frame generation Auto, while a runtime with the same patches opened the menu and showed the hint intact. The reported game-free cases failed before the fix and passed afterward.
Other systems: The fitting logic also applies to search results and Mods tab help; the reported Windows run opened both. It is menu logic rather than GPU-specific code.
Switches: None.
Reviewed:
c857527581against2b3c2f07b6: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the diff, commit list, search.tsx, and the relevant fitting code and tests. The larger changed source and test files and standards were skimmed; tool output was truncated.; nothing run (a code review).Checked and fine:
Testing: No commands from the project or tests were run. The author reports a successful Windows game run and game-free tests; CI is still running.
Overlaps and merge order: None found in the supplied information.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its rebase. Nothing was run; a maintainer decides.