feat(menu): the search finds a row by its options' names and hints #3272
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3272
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:feat/menu-search-options"
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 menu's search read a row's label, key and help. A player who types what an option is called or what its hint says finds nothing, or only part: on
main, "aa" finds Upscaler through its help alone.Now a choice row's option names (those this PC offers, and the one chosen) rank beside its key's words, and its options' hints and its current hint beside its help. A result still shows the row's own help. To carry the hints, a settings declaration gains
choiceHints(longshot/settings-host, system mods only; additive).searchItems(longshot/ui/kit, any mod) now ignores hyphens as it does case and accents, so "antialiasing" finds "Anti-aliasing".Testing
Tested: Linux (CachyOS), RTX 3090: "aa" typed on the on-screen keyboard (screenshots). The new menu test ("finds a choice by its options' names and hints...") fails on the test commit and passes on the head. The existing test "finds a setting on any page" now waits until every page is indexed: earlier pages match through hints, so it no longer shows "Searching…" until the last page.
mise run teston a tree of this PR, its two sibling PRs andmain@4e16bf06(before the review's text corrections; the text and row tests re-run on the heads): 923 passed, 11 failed, 13 skipped; the same 11 fail onmainthere:test_dlssg,test_input_background,test_lifter,test_present_acquire_ahead,test_present_held_image,test_present_image_free,test_present_semaphores,test_sandbox_windows,test_settings_area_keys,test_vk_draw_overhead_lean,test_walk_key.The menu's own tests do not compile on
main(4e16bf06tobb5a5682:game/crates/modtool/src/import.rs:396, a test from #3169 callspatches::collectwithout the argument #3165 added). With that call patched for the run only, both search tests pass;layout: ... (PLACED) the graphics tab, the settings page's table order andCustom fog slidersfail onmainand here alike, and at times the 2.00 ms per-frame budget does.cargo test -p api: 648 passed, 1 failed (a_rows_dependencies_come_from_its_data), as onmain.Still to test:
Measurements
Verdict: finds more; no frame cost that I can tell from the noise.
The menu's frame-cost test alone, debug build, a shared PC, 4 runs each side alternating: the worst search frame divided by the run's CPU scale.
Measured before the last rebase;
mainsince moved tobb5a5682without a change to the menu's search, so the comparison holds.6dbebabeRisks
More rows match a short word, ranked after those whose name matches. Reverting 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
tests/that reads changed source is updated, not weakened.mainand here, for a change that shows on screen.schema-gen), not edited by hand.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_017vw8e16e9JsGLrugow9vJQ
Tested in game: Linux (CachyOS), RTX 3090: "aa" typed on the on-screen keyboard in game lists Upscaler, Anti-aliasing (from the sibling PR), ReShade preset and DLSS model; on main it lists Upscaler alone.
Searching "aa", Linux, RTX 3090. The second picture is a tree with this PR and its two siblings, so the Anti-aliasing row (#3273) is listed too.

WIP: feat(menu): the search finds a row by its options' names and hintsto feat(menu): the search finds a row by its options' names and hints@review
Recommendation: Approve. The search index can retain an outdated current hint while the menu is open. The new search behavior otherwise has an in-game demonstration, with Steam Deck responsiveness still to be checked. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
The menu searches option names and hints as well as row text, and shared UI search ignores hyphens. This makes more settings discoverable at the cost of indexing longer text.
Should fix (1): not blocking, but worth doing before merging.
game/mods/menu/src/view.ts:423: The current hint is copied into the index once, but row changes do not invalidate that indexed page. (more on the line) Do: Invalidate or update the affected search part when an indexed row's value or hint changes, and test a hint change without a declaration generation change.Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
game/mods/menu/src/view.ts:449: The longer indexed texts have not been checked for typing responsiveness on the Steam Deck. (more on the line) Do: Run the stated Steam Deck search test by hand and record whether typing and result updates remain smooth.@fixcan do L1.Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes for the demonstrated case: the author reports that searching “aa” on Linux with an RTX 3090 found Upscaler on main and four rows on the combined PR tree. The timing runs overlap substantially: worst search frames were 1.46–2.87 ms before and 1.32–2.41 ms after, so they do not establish a performance change.
Other systems: The shared search function also affects mods using longshot/ui/kit. Choice declarations and their translations affect system mods on Windows and Linux; no platform-specific behavior is apparent in the diff. Steam Deck typing responsiveness remains untested.
Switches: None.
Reviewed:
d983f363f3againstbb5a5682ce: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, the diff and commit messages; traced the changed search, declaration, store and test paths. Skimmed generated documentation and the larger changed Rust and test files; they were not read in full. docs/review-checklist.md and ../Tooling/AGENTS.md were absent.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run project code were executed. The author reports an in-game Linux run and game-free test results; CI was still running.
Overlaps and merge order: The description names sibling PR #3273 as supplying the Anti-aliasing row; this change does not require that row for its demonstrated Upscaler search. Other overlaps were not available in the offline checkout.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -427,8 +447,10 @@ export function searchPart(source: string, decls: readonly SettingsHostDecl[],continue;// (a binding is on the Keyboard page, listed from the Controls page's)const binds = row.kind === "binding" || row.key === "bindings_reset";L2 (should fix): The longer indexed texts have not been checked for typing responsiveness on the Steam Deck.
When: A player typing a short query on a Steam Deck causes the menu to fold and search the expanded option and hint text across its pages; the reported desktop debug runs do not show whether that remains smooth there.
Do: Run the stated Steam Deck search test by hand and record whether typing and result updates remain smooth.
@ -407,0 +420,4 @@names.push(name);hints.push(d.choiceHints[i] ?? "");});hints.push(now?.hint ?? "");L1 (should fix): The current hint is copied into the index once, but row changes do not invalidate that indexed page.
When: A Frame generation hint can change with renderer status while search remains open. The store receives the updated row, but Finder rebuilds a part only when its declarations change, so searches continue to use the old hint and cannot find the new one.
Do: Invalidate or update the affected search part when an indexed row's value or hint changes, and test a hint change without a declaration generation change.
On L1: I checked and I'm leaving it. The index is built by
Finder, which is mounted only while results show (TabSearchOf: only with a query) and the menu's closing clears the query, so each search builds it anew. Rows cannot be changed from the results. What could still move mid-search is a hint the renderer changes by itself, for the length of one search; which rows are listed (pageLineswith their state at indexing) already holds that way onmain. Invalidating parts for it would add per-frame work to a path with a frame budget.