Registry Mirror
Skip to content

Conversation

@christophwille

@christophwille christophwille commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Before a search, the Options tab looks as it did, plus the search box above the page strip:

options-before-search

Searching tab strip: the strip narrows to the Display page, the hits are highlighted and the first one is scrolled into view.

options-search-tab-strip

Searching using on the Decompiler page: non-matching items are hidden, matching ones highlighted.

options-search-using

Summary

View > Options gets a Visual Studio style search box. Typing narrows the page strip to pages with a hit, highlights the hits on the shown page and scrolls the first one into view. The Decompiler page, the only one long enough to need it, additionally hides its non-matching items. Escape and an inline clear button reset the search; a search with no hits shows a "No settings match" message instead of an empty strip.

Pages publish their labels through two new default-implemented IOptionPage members, SearchableText and ApplySearch. The Decompiler page derives its labels from the viewmodel it already binds to; Display, Misc and ReadyToRun list theirs by hand, and a test fails if a label is added to their XAML without an index entry. A page that publishes nothing stays listed, so a plugin page that predates the search box never becomes unreachable. TestPlugin is left on the defaults to exercise that path.

Options considered

The reference is VS's options search (search box top left, tree narrows to pages with hits, right side shows the matching settings with breadcrumbs). The question was how much of that to build without turning the Options tab into a results aggregator.

Option Size Implications
VS aggregated results page large A synthetic page that re-hosts matching controls from every page, with breadcrumbs. Controls would have to live in two visual trees or be rebuilt, every page type needs rules for what a "setting" is, and live two-way bindings get duplicated. This is the thousands-of-lines option and the one explicitly not wanted.
Highlight only, everywhere ~30 lines One mechanism: walk the shown page's visual tree, bold the hits, scroll to the first. No layout assumptions, nothing can break. But the Decompiler page has ~110 checkboxes, so a search leaves the user scrolling a long page looking for bold labels.
Hybrid: narrow the Decompiler page, highlight the rest (chosen) ~45 lines The Decompiler page already owns its settings as structured viewmodel data, so filtering groups and items there is ~15 lines of LINQ with no view code. The XAML pages (Display, Misc, plugin pages) are one screen each and get highlight plus scroll-into-view. No per-control rules, so a plugin panel with any layout gets correct behaviour for free.
Hide non-matches everywhere, like VS ~100-120 lines A generic walker that hides non-matching rows on every page. "A setting" is not one control in XAML, so it needs rules: Grid children grouped by row so a label and its ComboBox stay together, a horizontal StackPanel as one row, header containers that show all children when the header matches, ItemsControl containers treated as rows, and a reset pass. Each rule is an assumption about panels this repo does not own; a plugin page that puts a label and its input in separate panels ends up with a visible label and a hidden input, or the reverse.

Hybrid was recommended because it gets the VS feel where it matters (the long, data-driven page narrows; the strip narrows; hits are visible immediately) at a fraction of the code, and because it is the only option besides highlight-only that cannot break a plugin's layout. Hide-everywhere remains a possible follow-up if a real page shows highlighting is not enough.

A second design point was where the search index comes from. Walking the views was ruled out: a TabControl materialises only the selected page, and an unattached panel never applies its templates, so an ItemsControl-driven page has no containers to walk. Hence the viewmodel-level SearchableText, with the label-coverage test keeping the hand-written lists honest.

Implementation notes

  • CheckBox labels are AccessText, a TextBlock subclass with its own style key, so the highlight style uses :is(TextBlock).search-hit; a plain TextBlock selector silently misses every checkbox.
  • A page the search just selected (and the Decompiler page's rebuilt item list) only gets its labels in a later layout pass. The highlight pass therefore re-runs after each layout pass while a search is active, coalesced into one dispatcher job, and scrolls only once per change so it never fights the user's scrolling.
  • VisiblePages is edited in place rather than replaced, so the TabControl keeps the shown panel and its scroll position while the user types.
  • Narrowed Decompiler groups are throwaway wrappers around the same item viewmodels and detach their PropertyChanged handlers when replaced.

Deliberately not built

The aggregated results page and breadcrumbs, hiding non-matches on the XAML pages, searching picker entries or setting values, and a keyboard shortcut to focus the box.

Testing

Six new headless tests in OptionsTabTests: strip narrowing and restore order, selection fallback when the selected page drops out, Decompiler narrowing (including Reset while narrowed), label coverage for every in-repo page, the highlight class and rendered FontWeight on a hit versus a non-hit plus scroll-into-view, and the no-match state. OptionsPageScrollReachTests now scopes to the Display panel's own ScrollViewer, since the search TextBox carries one in its template.

Full ILSpy.Tests run: 1343 pass, 4 skipped, 5 fail. The 5 are pre-existing and environmental: the TestPlugin lookup and one process-explorer test hardcode the platform-less bin/Debug path, so they fail for any build made with -p:Platform=Any CPU (as build.ps1 does). Against a platform-less build they pass, including the plugin composition tests that exercise the changed IOptionPage.

Assisted-by: Claude:claude-fable-5-1:Claude Code

🤖 Generated with Claude Code

Modelled on Visual Studio's options search, scoped to what fits the current
page layout: the box narrows the page strip to pages with a hit, highlights
the hits on the shown page and scrolls the first one into view, and the
Decompiler page hides its non-matching items. VS's aggregated results page
with breadcrumbs is deliberately not built; it would mean re-hosting controls
from every page.

Pages publish their labels through IOptionPage.SearchableText instead of the
view indexing them, because a TabControl only materialises the selected
page and an unattached panel never applies its templates, so an
ItemsControl-driven page has nothing to walk. Both new interface members
have defaults so plugin pages keep compiling; a page without labels stays
listed rather than becoming unreachable.

Assisted-by: Claude:claude-fable-5-1:Claude Code
The box started 4px left of the page titles and sat directly on the tab
strip with no gap below it. Its left margin now equals the TabControl plus
TabItem padding, and the top and bottom margins match.

Assisted-by: Claude:claude-fable-5-1:Claude Code
The Tab options group and the Misc startup checkbox were the only Options
labels still written inline in XAML, which also meant the search index and
the tab-options test each carried their own copy of the same text.

Assisted-by: Claude:claude-fable-5-1:Claude Code
@siegfriedpammer
siegfriedpammer merged commit 0abb04d into master Oct 18, 2026
15 checks passed
@siegfriedpammer
siegfriedpammer deleted the options-search branch October 18, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants