Skip to content

Add clear button to the paper search field - #40

Merged
Gram21 merged 1 commit into
Gram21:mainfrom
koppor:search-clear-button
Sep 21, 2026
Merged

Gram21 merged 1 commit into
Gram21:mainfrom
koppor:search-clear-button

Conversation

@koppor

@koppor koppor commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

🤖 The paper list search had no quick way to empty it. A × button now appears inside the box while a query is entered; clicking it clears the search and leaves focus in the field.

Test:

  • Type into the paper search, click ×, confirm the full list returns and the cursor stays in the box.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AWQS82YpFEMT2mdiyoA4od

A × inside the search box empties the query and keeps focus in the field.
@koppor
koppor force-pushed the search-clear-button branch from 9e09def to d578175 Compare September 14, 2026 11:33
@Gram21 Gram21 self-assigned this Sep 21, 2026
@Gram21
Gram21 marked this pull request as ready for review September 21, 2026 18:46
@Gram21
Gram21 self-requested a review as a code owner September 21, 2026 18:46
Copilot AI lite review requested due to automatic review settings September 21, 2026 18:46
@Gram21

Gram21 commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Thanks for the PR! It looks good to me and I will merge it. As it was only a draft, if you want to add something, feel free to do so in another PR

@Gram21
Gram21 merged commit da9e892 into Gram21:main Sep 21, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

Small, low-risk UI change with matching styling updates and explicit test covering the new behavior.

Review effort: Lite
Findings: None

What changed in this PR

Adds inline clear (×) control to paper list search input so users can reset query quickly without losing typing focus, improving sidebar search UX.

Changes:

  • Add conditional “Clear search” button inside search field; click clears query and re-focuses input.
  • Update search input right-padding and introduce new .paper-search-clear styling to avoid text overlap with new control.
  • Add regression test verifying clear behavior restores full list and preserves focus.
File Description
src/​styles/​index.css Reserve space for new clear button; add styling/positioning for .paper-search-clear.
src/​components/​PaperList.tsx Render clear button when query non-empty; clear query and focus input on click.
src/​components/​PaperList.test.tsx Test clear button visibility, clearing behavior, focus retention, and list reset.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

3 participants