Skip to content

fix: missed input parts on quick search#1394

Merged
danielroe merged 1 commit intonpmx-dev:mainfrom
alexdln:fix/search-key-miss
Feb 11, 2026
Merged

fix: missed input parts on quick search#1394
danielroe merged 1 commit intonpmx-dev:mainfrom
alexdln:fix/search-key-miss

Conversation

@alexdln
Copy link
Member

@alexdln alexdln commented Feb 11, 2026

What

The user would type in one place, and several navigations would launch for each input. Then the route from the first navigation would change, and the user would continue typing—but navigation from the first page would still continue. They rewrote the route and the query listener updated the field value

How

I created a global storage for search fields, and both fields write to it. The field doesn't actually listen to query now, but only uses it for default value and as the factor that q has been cleared (when exiting the search)

So now there's a single source of truth - the search store. And query parameter is simply synchronized with it for page reloads and for the server

resolves #1211 resolves #764

@vercel
Copy link

vercel bot commented Feb 11, 2026

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 11, 2026 7:34pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 11, 2026 7:34pm
npmx-lunaria Ignored Ignored Feb 11, 2026 7:34pm

Request Review

@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

❌ Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/composables/useGlobalSearchQuery.ts 66.66% 2 Missing and 1 partial ⚠️
app/pages/index.vue 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@danielroe
Copy link
Member

yes, this looks very promising as the source of the bug 👀

@alexdln alexdln marked this pull request as ready for review February 11, 2026 19:54
@alexdln
Copy link
Member Author

alexdln commented Feb 11, 2026

🤞🤞🤞

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

📝 Walkthrough

Walkthrough

This change introduces a centralised global search query state through a new composable function and refactors multiple components to use it. The SearchBox component replaces its local input state with the global search query and removes the watcher that synchronised local input with URL parameters during navigation. The pages index and search components similarly migrate from local state to the global composable. This architectural shift eliminates automatic page synchronisation triggered by URL navigation whilst preserving the existing search submission functionality.

Suggested reviewers

  • danielroe
  • whitep4nth3r
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes address the core requirement from issue #1211 by implementing a global search store that prevents route-driven updates from interrupting user input.
Out of Scope Changes check ✅ Passed All changes are directly related to centralizing search state and preventing route-driven input interruptions. No out-of-scope modifications were introduced.
Description check ✅ Passed The PR description clearly relates to the changeset, explaining the problem of missed keystrokes during search and the solution of creating a global search store.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@danielroe danielroe added this pull request to the merge queue Feb 11, 2026
Merged via the queue into npmx-dev:main with commit e43b8cc Feb 11, 2026
19 checks passed
This was referenced Feb 12, 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.

Page auto-reload when typing in search bar causes keystroke miss Initial seach improvements

2 participants