refactor(menu): each row goes where its place says; layout.ts keeps tabs, pages, headings and links #2861
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2861
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:cleanup/area5-menu-layout"
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
The Insert menu's layout used to be written down twice.
game/mods/menu/src/layout.tslisted every row of every tab in order (200 keys). The system mods'mod.tomlfiles also gave 245 rows aplace, but the menu read aplaceonly for a row the layout did not name. So 184 rows had two places, and the one inmod.tomlwas ignored.Now there is one rule, the same one a player's mod already uses: every row goes where its declaration's
placesays.layout.tskeeps only the tabs, the pages, the headings, and the menu's own links and lines, down from about 300 lines to about 100. Each row is laid out byview.tslaidOut:afterorbefore), the row goes next to it, in that row's section.section, or at the end of the tab's untitled top when it names no section.order, then in the order they were declared.The layout's links and lines are placed by the same rule.
Every row stays where it was. To get there, 14 place lines changed across the graphics, interface, developer, cheats, controls and damage mods. Layout preset and Button prompts are now placed on the Controls page, which is where they were already drawn.
The settings table in
docs/user/graphics-and-controls.mdlisted six rows in a different order from the menu. Those lines now follow the menu's order.Removed:
layout.tsandview.ts'spanelKeysandLAID_OUT;tests/test_system_settings_placed.py, a Python re-implementation oflaidOut;game/crates/longshot-game/tests/menu_places.tsvand the test that read it.Read first:
game/mods/menu/src/view.ts(panelLines),game/mods/menu/src/layout.ts, andgame/mods/menu/test/menu.test.ts(PLACEDand the layout tests).Part of the mod-api cleanup (area 5).
Testing
Tested: On Linux with an RTX 3090:
laidOuton the old manifests (the recordings rows included) and the newlaidOuton the new manifests. Every tab and page matches in order and in each row's section. That snapshot is nowPLACEDinmenu.test.ts, and the menu's layout tests are held to it.cargo test -p modtool the_typescript_system_mods_pass_their_tests, run through the queue. That covers each tab drawn inPLACED's order and every system mod's place naming a tab, heading and anchor the menu has (these checks used to be intest_system_settings_placed.py). It also covers each section keeping a row on every PC,laidOut's rules on rows made up for the test, and the docs table in the menu's order.cargo test -p longshot-game menupasses.cargo clippy -p modtool -p longshot-game --all-targetsis clean.schema-gen --checkpasses.run_all --exactpasses fortest_menu_ini_keys,test_pipeline_share,test_audio_volume,test_pad_speaker,test_upscaler_rowsandtest_menu_i18n.tests/run_all.py: 732 passed and 2 failed, and neither failure is from this change.test_lifter'scargo fmt --checktrips onapi/services/mod.rsandgame-core/src/nav.rsfrom #2745, which is already on mod-api.byte_compile_trackedlooks for the deleted Python test because the jj workspace's git index is stale; it passes on a checkout of the commit.system/menu, and all seven tabs were stepped through with no script error. The bridge's screenshots show the game picture without the menu, so they say nothing about the rows' order.Still to test:
Measurements
Nothing to measure: no game code or rendering changed. The menu's own cost test still passes (see Risks for its tab-switch ceiling). Measured outside the game,
laidOutfor the Graphics tab takes 0.32 ms against 0.50 ms before.Risks
PLACEDfails on any such move with all of Longshot's mods on.order = 120keeps it there.tab, or names an anchor that is missing, now goes to the end of the tab's untitled top, before its first heading. Before, it went to the end of the tab. The docs already said "the tab's top"; the code now matches them. The mod API is not shipped yet.UNTRANSLATED.Checklist
Ready for review
mod-api; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (run_all: 2 failures, both named above as not from this change.)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
tests/that reads changed source is updated, not weakened.mainand here, for a change that shows on screen. (The bridge's screenshots do not include the menu: a by-hand look is in Still to test.)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_016o1k1SQVyAWsujjFVd8Wuc