Skip to content

fix(dashboard): make logs search bars clearable via Escape / empty box#3096

Merged
simplesagar merged 5 commits into
mainfrom
sagar/searchbar-escape-to-clear
May 29, 2026
Merged

fix(dashboard): make logs search bars clearable via Escape / empty box#3096
simplesagar merged 5 commits into
mainfrom
sagar/searchbar-escape-to-clear

Conversation

@simplesagar
Copy link
Copy Markdown
Member

@simplesagar simplesagar commented May 29, 2026

What

Follow-up to #3093 (AGE-2594). Makes the free-text search bars on the logs pages clearable consistently — via Escape and by emptying the box, not only the × button.

Why

Two search bars were involved, both with the same "only the × clears it" friction:

1. LogFilterBar (MCP Server Logs). It tracks the live searchInput separately from the parent's applied searchQuery (which drives the data fetch); they only sync on submit. The × called onSearchSubmit(""), but Escape only cleared the local input (and was gated on the popover being open), and emptying the box never re-submitted — so the applied query lingered.

2. The shared SearchBar (components/ui/search-bar.tsx, used by Agent Sessions' ChatLogsFilters and elsewhere). It had an × button but no Escape handling. Emptying the box already clears for its consumers since their onChange fires live.

How

LogFilterBar:

  • Escape in the key step now mirrors the ×: clears the input, resets the flow, and calls onSearchSubmit(""). In the operator step it still just cancels the in-progress filter build.
  • Emptying the box in the key step now calls onSearchSubmit("").

SearchBar:

  • Escape clears the search (only when there's something to clear, so an empty box lets Escape bubble to e.g. close a surrounding popover).

This brings Agent Sessions and every other SearchBar consumer in line with the logs filter bar. The dropdown-only bars (Tool Logs ObserveFilterBar, MCPServerFilter, Insights filter bars) have no free-text box, so they're unaffected — they clear by deselection.

Scope

Frontend-only, 2 files. No backend, migration, or SDK changes.

Testing

  • tsc -p tsconfig.app.json --noEmit — clean.
  • eslint — clean.
  • Not yet click-tested against a live dashboard.

Brings Agent Sessions and other SearchBar consumers in line with the
logs filter bar — pressing Escape clears the search like the × button.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@simplesagar simplesagar requested a review from a team as a code owner May 29, 2026 00:14
@simplesagar simplesagar added the bug Something isn't working label May 29, 2026
@simplesagar simplesagar requested a review from a team as a code owner May 29, 2026 00:14
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gram-docs-redirect Ready Ready Preview, Comment May 29, 2026 12:31am

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 29, 2026

🦋 Changeset detected

Latest commit: 95aab67

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
dashboard Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread client/dashboard/src/components/ui/search-bar.tsx
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@simplesagar simplesagar changed the title fix(dashboard): add Escape-to-clear to shared SearchBar fix(dashboard): make logs search bars clearable via Escape / empty box May 29, 2026
So a single Escape only clears the search instead of also bubbling to
close a surrounding popover/dialog; the next (empty-box) Escape bubbles.

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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 2 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread client/dashboard/src/pages/logs/LogFilterBar.tsx Outdated
…lear

Guard the key-step Escape on searchInput so an empty box lets Escape
bubble (e.g. to close a surrounding popover) and avoids a redundant
onSearchSubmit(""). Add changeset.

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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 2 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.
Tip: cubic used a learning from your PR history. Let your coding agent read cubic learnings directly with the cubic MCP.

Fix all with cubic | Re-trigger cubic

Comment thread client/dashboard/src/pages/logs/LogFilterBar.tsx
Match the SearchBar two-step behavior: Escape that cancels a build or
clears the search consumes the event; an empty box lets it bubble.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@simplesagar simplesagar enabled auto-merge May 29, 2026 00:31
@simplesagar simplesagar added this pull request to the merge queue May 29, 2026
Merged via the queue into main with commit e4c2bfb May 29, 2026
34 checks passed
@simplesagar simplesagar deleted the sagar/searchbar-escape-to-clear branch May 29, 2026 00:40
@github-actions github-actions Bot locked and limited conversation to collaborators May 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants