Skip to content

Add a search over the log view - #203

Merged
wallstop merged 3 commits into
masterfrom
find-log-search
Sep 29, 2026
Merged

wallstop merged 3 commits into
masterfrom
find-log-search

Conversation

@wallstop

@wallstop wallstop commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

DISCLOSURE: LLM-GENERATED TEXT

Why:

A log buffer is the newest 256 lines and nothing else, so finding one error
meant reading past the other 255. Nothing narrowed the view (#195).

What:

  • find <text> keeps only the matching lines, jumps to the first, and reports the count; find and F3/Shift+F3 step through the matches, clear-filter restores.
  • A search never matches a command echo: both surfaces echo the typed line before the handler runs, so the search's own echo held the query and every search found itself.
  • Echoes are excluded by type, not by the trailing-echo walk copy-log uses, which made the count depend on whether anything had been logged since.
  • The search narrows the window RefreshLogs already read: one pass, no second read of the buffer.

How we know:

EditMode 669/669. PlayMode 654 with the same 5 failures unmodified master produces here, measured by stashing.
Red-green by mutation, twice; the F3 and scroll-jump tests skip on this host with the reason.


Note

Medium Risk
Touches terminal UI refresh, scroll/tail behavior, and log-counting contracts where subtle echo/reply exclusions can skew results; scope is localized and heavily tested but affects a primary developer workflow surface.

Overview
Adds log view search to DxCommandTerminal: find <text> filters visible lines (case-insensitive substring on displayed text), jumps to the first match, and reports match/total counts; bare find and F3 / Shift+F3 step matches with wrap; clear-filter restores the full log.

Implementation centers on a new LogFilter applied during RefreshLogs (one buffer read, filtered render array) plus TerminalUI scroll queuing so matches scroll into view without fighting tail-follow. Built-in find / clear-filter commands delegate to the active TerminalUI.

The change extends the log-echo contract: command Input echoes never match (by type, not position—unlike copy-log); the console’s status replies are excluded from both match and denominator via IgnoreOwnReply on exact logged text. EnterCommand skips re-attaching the log tail when a find scroll is pending so search navigation isn’t overwritten by scroll-to-end.

Docs (README, CHANGELOG, log-echo-contract skill) and EditMode / PlayMode tests cover filter rules, keyboard routing, stable counts, and EnterCommand ordering.

Reviewed by Cursor Bugbot for commit 86da0b1. Bugbot is set up for automated code reviews on this repo. Configure here.

find <text> keeps only the log lines holding the text and reports how
many matched; find on its own and F3/Shift+F3 step through the matches,
and clear-filter shows every line again.

A log buffer is the newest 256 lines and nothing else, so finding one
error meant reading past the other 255.

A search never matches a command echo. Both surfaces echo the typed line
into the log as Input before the handler runs, so the search's own echo
held the query and every search found itself - a query appearing nowhere
reported a match. Excluded by type, not by the trailing-echo walk the
copy commands use: that would make the count depend on whether anything
had been logged since.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread Runtime/CommandTerminal/UI/TerminalUI.cs
Comment thread Runtime/CommandTerminal/UI/TerminalUI.cs Outdated
Comment thread Runtime/CommandTerminal/UI/LogFilter.cs
Two review findings, both in the product.

EnterCommand re-attaches the tail and asks for a scroll to the end
after the handler returns, overwriting the jump a search queued, so the
view went to the end and the jump lost the race.

A search also matched the line it wrote to say what it found, so a query
that was a word in that line reported a hit for a string appearing
nowhere, and every repeat added another.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit aac68fd. Configure here.

Comment thread Runtime/CommandTerminal/UI/LogFilter.cs Outdated
They were already out of the matches, so the numerator held
while the denominator grew by one per run: 20 of 240, then 20 of 241.
The exclusion now runs before both counters.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@wallstop
wallstop merged commit ab41ad3 into master Sep 29, 2026
12 checks passed
@wallstop
wallstop deleted the find-log-search branch September 29, 2026 22:09
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.

1 participant