Skip to content

Add Scoped Search Inside Search Results - #2620

Merged
AmmarAbouZor merged 16 commits into
esrlabs:masterfrom
AmmarAbouZor:nested-search
Aug 5, 2026
Merged

AmmarAbouZor merged 16 commits into
esrlabs:masterfrom
AmmarAbouZor:nested-search

Conversation

@AmmarAbouZor

@AmmarAbouZor AmmarAbouZor commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

This PR closes #2604

It adds nested scoped search for finding matches within filtered logs. It also includes several fixes and improvements to the core implementation.

It includes:

  • Search within filtered logs with regex, case, and whole-word options.
  • Navigate between matches while synchronizing both log tables.
  • Highlight nested matches in search results and main logs.
  • Match visible text in ANSI-formatted logs.
  • Add menu and keyboard access to nested search. Search will be activated with Ctrl+Shift+f.
  • Improve focus, progress, empty-query, and no-match behavior.
  • Fix indexed-row synchronization across search results and bookmarks.
  • Extend test coverage and for search in core.
  • Remove Breadcrumb code as this feature won't be implemented in Chipmunk 4 anymore.
  • Add documentation with a demo video.

* This feature isn't planned to be provided for users since they can
  jump to the log in main table via clicking on the log entry.
* Remove breadcrumb implementation, public APIs and all tests.
* Bookmark API simplified as it can't fail anymore.
* Improve the code to nested search avoiding linear searches and
  defining names structs for the API
* Extend unit and integration tests for nested search
* Add menu entry for showing the nested search shell
* Shell is triggered via ctrl+shift+f
* Render shell controls and handle closing with `escape` key.
* Refactor: Move handling session shortcuts to their own sub-module
* Move filters shortcut to ctrl+shift+s
Replace the primary-search-only nearest lookup with a binary lookup over
the complete search and bookmark union.

Use explicit indexed-row coordinates across core, service, and UI APIs,
preserve delayed table scrolling, and remove obsolete nearest-position
types and operation dispatch.

Cover ties, boundaries, interleaving, overlap, bookmark-only maps,
unsorted insertion, and u64 extremes.

Add unit tests to cover all edge-cases
* Nested search shell sends commands to service which will direct the
  request to core and send the results back.
* UI handles the results and updating its state and scrolling to logs
* Adjust '[' and ']' keybindings to consider active nested search
Attachment struct is fairly large making all message reserved too much
space than needed for most of them.
* Extend highlighting for logs in both logs and search table with nested
  search highlighting
* Nested search will override the existing highlighting in overlap cases
Using brackets shortcuts caused the shell to flicker as shortcut changed
pending state before rendering the frame.

To solve this we introduced pending commands for the shortcuts so it's
possible for shortcuts to defer their command to after rendering the
current UI frame
- Layer Quick Open and Command Palette above the nested-search shell.
- Delay nested-search progress indication until a request remains pending
  for 250 ms.
- Tie progress timing to correlated requests and preserve it across
  stale responses.
- Emit an info notification for every valid nested search with no
  matches.
- Refocus a visible, unfocused nested-search input instead of closing and
  resetting it.
- Preserve deferred focus while a pending request keeps the editor
  disabled.
- Handle Escape locally and close only when the nested-search input owns
  focus.
- Keep Escape available to other focused text inputs and host overlays.
- Compute nested-search visibility only when the toggle shortcut is
  consumed.
- Remove unused nested-search status state and status-only tests.
- Add regressions for delayed progress, no-match notification, focus,
  pending focus, and Escape ownership.
Check if nested search is active when switching tabs and focus its input
text instead of the main search input if opened
* Add animated bottom border for the pending state
* Improve the size and the look and feel for UI elements
* Ensure the current filter is picker for next/previous navigation.
* Disable next/prev on empty queries
* Disable nested search for bookmarks only
* Add notes in code to document accepting blocking state main task for
  nested searches until we see that this is making issues for users
* Retry nested matching with ANSI codes stripped when raw matching fails.
* Use memchr to keep escape detection fast and avoid parsing normal lines.
Extend search documentation with section for nested search including a
video
@AmmarAbouZor AmmarAbouZor changed the title Add Nested Search Functionality to Search within Filtered Results Add Scoped Search Inside Search Results Jul 31, 2026
Comment thread crates/core/processor/src/search/searchers/linear.rs Outdated
* Match ANSI-containing lines against visible text only.
* Add regression coverage.
@AmmarAbouZor
AmmarAbouZor merged commit 7a9558e into esrlabs:master Aug 5, 2026
1 check passed
@AmmarAbouZor
AmmarAbouZor deleted the nested-search branch August 5, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scoped Search for log results view

2 participants