Skip to content

fix(kitchen-sink): show "No results" only after search is submitted#8

Merged
sathergate merged 1 commit into
mainfrom
claude/fix-kitchen-sink-search-RvriK
Mar 30, 2026
Merged

fix(kitchen-sink): show "No results" only after search is submitted#8
sathergate merged 1 commit into
mainfrom
claude/fix-kitchen-sink-search-RvriK

Conversation

@sathergate
Copy link
Copy Markdown
Owner

Summary

  • The kitchen-sink search demo showed "No results found" immediately as the user typed, before any search was submitted — making the feature appear broken
  • Added a hasSearched state flag so the empty-results message only appears after the form is actually submitted

Test plan

  • Run npm run dev in examples/kitchen-sink
  • Type "cron" in the search box — confirm no "No results" message appears while typing
  • Click Search — confirm results for "cron" appear
  • Search for "search" and "rate limiting" — confirm results appear
  • Search for a nonsense string — confirm "No results found" message appears

https://claude.ai/code/session_01Uk5GnRn3EsB5cjHoXW4m5U

The "No results found" message was displayed immediately as the user
typed in the search box, before any search was performed. This made
the search appear broken. Gate the message on a hasSearched flag that
is only set when the form is actually submitted.

https://claude.ai/code/session_01Uk5GnRn3EsB5cjHoXW4m5U
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 35e05c3676

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

)}

{results.length === 0 && query.trim() && !loading && !error && (
{results.length === 0 && hasSearched && !loading && !error && (
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Guard empty-state message when query is blank

Removing the query.trim() check makes the empty-state render for an empty input after any prior no-result search, because hasSearched stays true and results stays empty. In that flow, clearing the field shows No results found for '', which is misleading and regresses prior behavior where blank queries suppressed the message.

Useful? React with 👍 / 👎.

@sathergate sathergate merged commit 0b64aff into main Mar 30, 2026
8 of 9 checks passed
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