Skip to content

Add omnibar breadcrumb and search bar above the decompiled code#3786

Open
christophwille wants to merge 2 commits into
masterfrom
omnibar
Open

Add omnibar breadcrumb and search bar above the decompiled code#3786
christophwille wants to merge 2 commits into
masterfrom
omnibar

Conversation

@christophwille

@christophwille christophwille commented Jun 15, 2026

Copy link
Copy Markdown
Member

Want to test? Grab CI bits from https://github.com/icsharpcode/ILSpy/actions/workflows/build-ilspy.yml?query=branch%3Aomnibar

Omnibar

Adds an omnibar at the top of each decompiler document view: a breadcrumb of the current node that turns into a search box when you type. Modelled on the Files community app's omnibar and jiripolasek's EditorBar, but shaped for a decompiler rather than a generic file manager.

Behaviour

  • Breadcrumb mode (default): shows the node's path Assembly > Namespace > Type > Member with each node's real icon. Clicking a crumb selects that node in the tree. Each crumb that has children carries a chevron that opens a filterable dropdown of its child nodes for fast lateral navigation; leaf crumbs (methods, fields, ...) omit the chevron.
  • Search mode: typing (or Ctrl+L) switches to a query box with an inline suggestions dropdown. It reuses the existing search engine (RunningSearch, the ICSharpCode.ILSpyX.Search strategies, AvaloniaSearchResultFactory), capped to the best matches. Down/Enter/Esc keyboard flow; Ctrl+Enter/middle-click open in a new tab. Activating a result navigates and returns to the breadcrumb.

It coexists with the docked Search pane (which remains the place for the full, sortable result list).

Off by default

Ships behind a new Options / Display -> "Tab options" -> "Show omnibar (breadcrumb / search bar) above the decompiled code" toggle (DisplaySettings.EnableOmnibar, default off). The toggle applies live (no re-decompile) and is classified in DisplaySettingReactions so the coverage test stays green.

Implementation

  • New ILSpy/Controls/Omnibar/Omnibar UserControl + OmnibarViewModel (per document tab, not MEF-shared) + small BreadcrumbSegment / OmnibarMode types. Services are resolved lazily from the composition host, mirroring SearchPaneModel.
  • Hosted in DecompilerTextView (docked above the editor); the view pushes its current node into the bar and gates Ctrl+L / visibility on the setting.
  • Theme brushes added to App.axaml for light and dark.
  • No new packages.

Tests

Headless ILSpy.Tests/Controls/ tests cover breadcrumb building (Assembly > Namespace > Type > Member, root excluded), leaf-vs-container chevron, segment navigation, search/breadcrumb mode toggling, and the default-off / live-reveal setting. Full ILSpy.Tests suite is green.

Screenshots

Breadcrumb and search faces (light theme):

Breadcrumb: System.Linq > {} System.Linq > Enumerable > Empty<TResult>() with per-segment chevrons and a trailing search affordance; the trailing method crumb correctly has no chevron.

Search: magnifier + query + clear button, with an inline suggestions list (icon, name, right-aligned location).

Note: it is off by default:

image image

🤖 Generated with Claude Code

ILSpy showed the current location only implicitly in the tree selection and kept search in a separate docked pane. The omnibar, modelled on the Files community app and jiripolasek's EditorBar, puts an address-bar atop each decompiler document: a breadcrumb of the node (Assembly > Namespace > Type > Member) whose segments navigate and whose chevrons list child nodes, turning into a search box on typing that reuses the existing search engine. It coexists with the docked search pane and ships off by default behind the Options / Display 'Tab options' EnableOmnibar toggle, which applies live.

Assisted-by: Claude:claude-opus-4-8:Claude Code
When a breadcrumb path was longer than the bar, the Simple theme's horizontal
scrollbar appeared in a reserved layout row inside the 28px bar: it shifted the
crumbs up when it showed and covered more than half the bar's height.

Three ways to handle the overflow were considered:

  1. Collapse the head into an "..." overflow dropdown (leading crumbs fold into
     a left button; the deepest crumbs stay visible) - the Windows Explorer / VS
     nav-bar / Files behaviour.
  2. Hide the scrollbar entirely and scroll the trail with the mouse wheel,
     keeping the current-node end visible.
  3. [CHOSEN] A thin, auto-hiding overlay scrollbar that draws over the content
     (reserves no height, so nothing shifts) and fades in only when the path
     overflows and the pointer is over the bar.

Avalonia's Simple ScrollViewer reserves an Auto grid row for the horizontal
scrollbar and its ScrollBar has no auto-hide, so the overlay is built here: the
breadcrumb's built-in bar is hidden (no reserved row, no shift) and a thin,
button-less ScrollBar is layered at the bottom, bound to the viewer's Offset,
ScrollBarMaximum, and Viewport via small Vector/Size converters. It fades in on
pointer-over and the mouse wheel scrolls the trail horizontally.

Assisted-by: Claude:claude-opus-4-8:Claude Code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant