feat(logs): search in script output#29
Merged
Merged
Conversation
Add a find bar to the log panel: a search icon in the "Output" header opens an input that highlights all matches in the rendered output, with a match counter and previous/next navigation (Enter / Shift+Enter, Esc to close). Matching is done over the output element's text nodes and surfaced as DOM Ranges highlighted via the CSS Custom Highlight API (logSearch.js), so the live-appending terminal output and inline images are never mutated. The search refreshes as new output streams in while the bar is open, and highlight calls are guarded so browsers without the API degrade gracefully. Lives in the shared log_panel, so it's available in both the execution view and the history details. Tests: logSearch match-finding (case-insensitive, multi-node, non-overlapping) and LogPanel search wiring (count/label, next/prev wrap, open/close). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a find bar to the script output panel so long logs are searchable.
cur/total) and previous/next navigation.How it works
Matching runs over the output element's text nodes and is surfaced as DOM
Ranges, highlighted via the CSS Custom Highlight API (logSearch.js). This means the output DOM is never mutated, so it stays compatible with the live-appending terminal and inline images. Highlight calls are guarded (highlightsSupported()), so browsers without the API degrade gracefully (search/navigation still work, just without the visual highlight).It lives in the shared
log_panel, so it's available in both the execution view and the history details.Testing
npm run test:unit-ci— 1038 passed, including:logSearch_test.js(9): case-insensitive, multi-text-node (terminal spans), non-overlapping matches, empty/null guards, API-guard no-ops.LogPanel_search_test.js(7): open/close, match count +cur/totallabel, next/prev with wrap, no-match0/0.::highlight()rules are emitted into the bundled CSS.Note for reviewer
The visual highlight rendering was not verified in a live browser this time (the preview tooling was unavailable in the session). The matching logic is unit-tested and the CSS is confirmed emitted; the CSS Custom Highlight API is standard in current Chromium/Safari/Firefox and the e2e job runs on Chromium. Worth a quick manual look when running the app.
🤖 Generated with Claude Code