Skip to content

fix: search restore#1450

Merged
danielroe merged 1 commit intonpmx-dev:mainfrom
alexdln:fix/search-restore
Feb 12, 2026
Merged

fix: search restore#1450
danielroe merged 1 commit intonpmx-dev:mainfrom
alexdln:fix/search-restore

Conversation

@alexdln
Copy link
Member

@alexdln alexdln commented Feb 12, 2026

When navigating through elements other than our own, there's a chance that the search won't be restored. Since we always use replace within the search function, the only chance for this to happen is before switching from non-search to search (for example, via browser navigation buttons).

I most likely lost this during the initial improvements. Restoring it with a micro-fix

This does not affect all improvements, since the field will always be filled in during internal navigation (filling first, then navigation)

@vercel
Copy link

vercel bot commented Feb 12, 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 12, 2026 9:28pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 12, 2026 9:28pm
npmx-lunaria Ignored Ignored Feb 12, 2026 9:28pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 12, 2026

📝 Walkthrough

Walkthrough

The change modifies the watch callback for route.query.q in the useGlobalSearch composable. It adds a conditional guard that assigns the URL-derived value to the local searchQuery variable when searchQuery.value is initially empty or falsy. The existing logic that clears searchQuery when the URL value is absent remains unchanged. This represents a single-line addition with no modifications to error handling or control flow.

Possibly related PRs

  • fix: missed input parts on quick search #1394: Modifies the same URL-to-searchQuery synchronisation logic in the global search composable, specifically handling watchers that initialise or clear searchQuery based on route.query.q.

Suggested reviewers

  • danielroe
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description is directly related to the changeset, explaining the bug being fixed, its cause, and the solution approach.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

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

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

No actionable comments were generated in the recent review. 🎉


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

@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/composables/useGlobalSearch.ts 0.00% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@danielroe danielroe added this pull request to the merge queue Feb 12, 2026
Merged via the queue into npmx-dev:main with commit d083e21 Feb 12, 2026
17 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