Skip to content

feat(logs): search in script output#29

Merged
knep merged 1 commit into
masterfrom
feat/log-search
Jun 25, 2026
Merged

feat(logs): search in script output#29
knep merged 1 commit into
masterfrom
feat/log-search

Conversation

@knep

@knep knep commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a find bar to the script output panel so long logs are searchable.

  • A search icon in the "Output" header opens an input.
  • Typing highlights all matches in the rendered output, with a match counter (cur/total) and previous/next navigation.
  • Keyboard: Enter = next, Shift+Enter = previous, Esc = close.
  • The search refreshes as new output streams in while the bar is open.

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-ci1038 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/total label, next/prev with wrap, no-match 0/0.
  • Build verified: the global ::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

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-commenter

codecov-commenter commented Jun 25, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 69.69697% with 30 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
web-src/src/common/components/log_panel.vue 68.11% 15 Missing and 7 partials ⚠️
...eb-src/src/common/components/terminal/logSearch.js 73.33% 8 Missing ⚠️

📢 Thoughts on this report? Let us know!

@knep knep merged commit c99a33f into master Jun 25, 2026
15 of 16 checks passed
@knep knep deleted the feat/log-search branch June 25, 2026 11:19
@knep knep mentioned this pull request Jun 25, 2026
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.

2 participants