Skip to content

chore: add searchProviderValue to useSearchProvider - #3134

Merged
gameroman merged 1 commit into
npmx-dev:mainfrom
gameroman:simplify-search-provider
Aug 5, 2026
Merged

chore: add searchProviderValue to useSearchProvider#3134
gameroman merged 1 commit into
npmx-dev:mainfrom
gameroman:simplify-search-provider

Conversation

@gameroman

@gameroman gameroman commented Aug 4, 2026

Copy link
Copy Markdown
Member

🔗 Linked issue

None

🧭 Context

📚 Description

Simplify searchProviderValue handling

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview Aug 4, 2026 2:49pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Aug 4, 2026 2:49pm
npmx-lunaria Ignored Ignored Aug 4, 2026 2:49pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Refactor
    • Centralised search provider selection logic across components and utilities to ensure consistent search provider resolution throughout the application.

Walkthrough

The change centralises search provider resolution in useSearchProvider. Search controls and package search composables now consume its resolved searchProviderValue.

Changes

Search provider resolution

Layer / File(s) Summary
Resolve and expose the search provider
app/composables/useSettings.ts
useSearchProvider reads the p query parameter and saved provider setting. It exposes the resolved searchProviderValue and derives isAlgolia from it.
Adopt the shared provider value
app/components/SearchProviderToggle.client.vue, app/composables/npm/*, app/composables/useGlobalSearch.ts
The search toggle, package composables, and global search composable use searchProviderValue from useSearchProvider instead of local route-based calculations.

Suggested reviewers: alexdln

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarises the main change: adding searchProviderValue to useSearchProvider.
Description check ✅ Passed The description is brief but directly relates to simplifying searchProviderValue handling.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Patch % Lines
app/composables/useSettings.ts 50.00% 2 Missing and 1 partial ⚠️
app/composables/npm/useOrgPackages.ts 0.00% 1 Missing ⚠️
app/composables/npm/useUserPackages.ts 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@gameroman
gameroman marked this pull request as ready for review August 4, 2026 14:51
@gameroman
gameroman requested a review from a team August 4, 2026 14:53

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/composables/useGlobalSearch.ts`:
- Line 11: Update the URL query setter and both flushUpdateUrlQuery calls in
useGlobalSearch to pass the resolved searchProviderValue.value instead of
searchProvider.value, preserving route query overrides such as p='npm'. Add a
regression test covering an npm route override when the saved provider is
algolia.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 00211f7d-3fd0-4ee7-ad22-8d41a94d4806

📥 Commits

Reviewing files that changed from the base of the PR and between 27f7dc2 and 6ea6402.

📒 Files selected for processing (5)
  • app/components/SearchProviderToggle.client.vue
  • app/composables/npm/useOrgPackages.ts
  • app/composables/npm/useUserPackages.ts
  • app/composables/useGlobalSearch.ts
  • app/composables/useSettings.ts

Comment thread app/composables/useGlobalSearch.ts
@gameroman
gameroman enabled auto-merge August 4, 2026 16:15
@gameroman
gameroman added this pull request to the merge queue Aug 5, 2026
Merged via the queue into npmx-dev:main with commit ea245cc Aug 5, 2026
26 checks passed
@gameroman
gameroman deleted the simplify-search-provider branch August 5, 2026 09:22
ayo-run pushed a commit to ayo-run/npmx.dev that referenced this pull request Aug 5, 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.

2 participants