#1348 Preferences search: words in any order, lists and setting names, and it shows what it finds #1351

Manually merged
sky_line merged 0 commits from TheSlowly/Slipstream:prefs-search-1348 into main 2026-11-02 23:48:19 +00:00
Collaborator

Fixes #1348.

  • Matching: every word must appear, in any order. Words of three letters or fewer must start a word, so "sit" finds Sit/Stand but not "position".
  • Finds more:
    • the tooltips of spinners, text fields, colour swatches, radio groups and the texture picker;
    • rows in lists (key bindings, notifications);
    • a setting by its whole name (RenderFarClip);
    • a page by its name.
  • Shows what it finds:
    • opens the collapsed sections that hold a match and marks their headings (the UI Sounds sections of #1342);
    • scrolls the first match into view, and each list to its first matching row;
    • doesn't count matches in hidden parts of a page.
  • Clearing keeps you on your page. When nothing matches, it says "No settings match".
  • LLTabContainer::setTabsVisibility chooses the shown tab once. This also stops the region's terrain tabs jumping back to the first tab.

Tested in-world before the last commit. The last commit (lists row by row, the short-word rule, whole setting names) isn't tested yet. Unit test slprefsearch: 12/12.

Fixes #1348. - **Matching:** every word must appear, in any order. Words of three letters or fewer must start a word, so "sit" finds Sit/Stand but not "position". - **Finds more:** - the tooltips of spinners, text fields, colour swatches, radio groups and the texture picker; - rows in lists (key bindings, notifications); - a setting by its whole name (`RenderFarClip`); - a page by its name. - **Shows what it finds:** - opens the collapsed sections that hold a match and marks their headings (the UI Sounds sections of #1342); - scrolls the first match into view, and each list to its first matching row; - doesn't count matches in hidden parts of a page. - **Clearing** keeps you on your page. When nothing matches, it says "No settings match". - `LLTabContainer::setTabsVisibility` chooses the shown tab once. This also stops the region's terrain tabs jumping back to the first tab. Tested in-world before the last commit. The last commit (lists row by row, the short-word rule, whole setting names) isn't tested yet. Unit test `slprefsearch`: 12/12.
setTabVisibility selected the first visible tab on every call. Preferences search calls it for
every page on each keystroke, so the window jumped back to the first page with a match while
you typed, and to General when you cleared the search. The region's terrain tabs, which show and
hide the PBR repeats tab, had the same jump. Now the shown tab stays while it is visible, and
only when it gets hidden does the first visible tab take over.

Test-Plan: Preferences > Graphics: search for "shadow", then clear the search: still on Graphics.
  On General, search for "shadow": Graphics (the first page with a match) is shown.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Preferences search needs to open the accordion sections that hold a match (UI Sounds, #1342)
and mark their headings. LLAccordionCtrl now exposes its sections (getTabs, top to bottom) and
whether only one opens at a time (getSingleExpansion). LLAccordionCtrlTab::setTitleHighlighted
gives the heading the search-match highlight.

Test-Plan: Nothing changes on its own; used by #1348's search commit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
These controls weren't searchable. Their tool tips couldn't be found, and a search by setting
name (the next commit) would have had nothing to light up. Their labels are still found as
before, through their own text boxes. A match now:
- lights a spinner's label and number;
- lights every button of a radio group;
- fills a text field's background;
- outlines a colour swatch or texture picker and lights its caption.

Search texts now put the label, the tool tip and a dropdown's entries on separate lines, so a
search word can't run from one into the next.

Test-Plan: With the search commit: in Preferences, search for a setting a spinner, colour swatch
  or radio group changes (see the search commit), and check that it lights up as described.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The search box missed things, or found them where you couldn't see them:
- The words had to appear together and in order.
- Setting names weren't searched, though the box's tool tip said they were.
- A match in a collapsed section (UI Sounds) or below the fold stayed out of sight.
- A control in a hidden part of a page counted as a match, so the page showed with nothing lit.
- Typing a page's name lit its tab but could hide the page.
- When nothing matched, every page vanished without a word.

Now:
- Every word must appear, in any order, in a control's label, tool tip or setting name. The
  matching is in slprefsearch, unit-tested.
- Only controls the search can show count: a hidden part of a page is skipped.
- The accordion sections holding a match open (one-at-a-time accordions keep the open one if it
  has a match) and their headings are marked. The first match on the page scrolls into view.
- A page whose name matches is shown whole.
- When nothing matches, the window says "No settings match". The search box's tool tip says
  what is searched.

The search collects from the page tabs only, so the search box and OK / Cancel no longer light
up. The collection moved from llfloaterpreference.cpp to llsearchableui.cpp.

Test-Plan: Preferences:
  - "sound typing" finds Sound & Media > Play typing sound.
  - "RenderFarClip" (a setting name) finds the draw distance slider on Graphics.
  - With #1342: "paid" opens UI Sounds > L$ and marks its heading; "radar" opens Radar.
  - A match far down a scrolling page (Advanced, Move & View) is scrolled into view.
  - "graphics" shows the whole Graphics page.
  - "zzzz" says No settings match; clearing it brings the pages back on the same page.
  - Only spaces does nothing.
  Unit test slprefsearch: 8/8.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A review of the search found two real bugs and some smaller gaps:

- After a search that matched nothing, clearing it (or backspacing to a term that matches)
  showed the last page instead of the one you were on. The pages are walked in reverse tab order
  and each setTabVisibility call chose a tab on its own, so the first page shown again won.
  LLTabContainer::setTabsVisibility now sets every page first and chooses the shown tab once.
- The scroll went to the last match in the item list. That list is in reverse layout order, and
  a marked heading of a closed section could win over the real match. The target is now the
  topmost match on screen, chosen before the headings are marked.
- The Notifications lists matched the raw text as one phrase. They now follow the same rule as
  the rest of the search (every word, any order), and are matched first, so a match there keeps
  you on Notifications.
- Smaller fixes:
  - A closed section is only skipped by the visibility check when it belongs to an accordion
    (the only kind the search opens).
  - fit_parent accordions aren't scrolled, matching LLAccordionCtrlTab (EXT-8285).
  - Sections that can't be opened or closed stay as they are.
  - The headings a search marked are cleared by the next one.

Sections a search opened stay open after it is cleared, on purpose: clearing leaves you looking
at what you found.

Test-Plan: Preferences, on Graphics: type "zzzz" (No settings match), then clear: back on
  Graphics. Type "z", "zzzz", then backspace to "z": still on Graphics. A word found twice on a
  page scrolls to the upper match. Notifications: "group notice" and "notice group" both light
  the same entries, and on that page a match only there keeps you on it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Testing in-world showed three things:
- Lists weren't searched. "sit" showed the Controls page because of the mode dropdown, but the
  key bindings table, where Sit/Stand is, lit nothing.
- Short words matched inside other words, so "sit" also found every "position" and "visit".
- Setting names made ordinary words light up far more. "chat" went from 75 to 118 controls
  across the pages, 40 of them only through names like EnableVoiceChat.

Now:
- **Lists:** every list on the pages (the key bindings, the notification lists, and so on) has
  its rows matched by their text, and the matching rows are lit. Each list scrolls to its first
  match. The special case for the notification lists goes, since they're ordinary lists now.
  LLScrollListCtrl::scrollToShowItem scrolls to a row.
- **Short words:** a word of three characters or fewer must start a word of the text, after a
  space or punctuation. "sit" finds Sit/Stand and sitting, but not position. Longer words still
  match anywhere, so a part of a compound word ("größe" in "Schriftgröße") is still found.
  Scripts written without spaces (CJK, Thai) match anywhere.
- **Setting names:** a setting name counts only when the search is that whole name
  (RenderFarClip), so ordinary words behave as they did.

Measured over the controls on the Preferences pages: "sit" drops from 22 controls on 8 pages to
9 on 5, "max" from 11 to 6, "on" from 301 to 120. Longer words are unchanged.

Test-Plan: Preferences:
  - "sit" lights the Sit/Stand row in Controls and scrolls the table to it, and no longer shows
    pages only for "position".
  - "chat" no longer lights the controls that match only through their setting name.
  - "RenderFarClip" still finds the draw distance slider.
  - Notifications: "group notice" lights the matching entries.
  Unit test slprefsearch: 12/12.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sky_line manually merged commit 5cab7db91f into main 2026-11-02 23:48:19 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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
sky_line/Slipstream!1351
No description provided.