Skip to content

refactor: always preserve marketplace search state in URL#22

Open
tomerqodo wants to merge 2 commits intocursor_combined_20260121_qodo_grep_cursor_copilot_1_base_refactor_always_preserve_marketplace_search_state_in_url_pr415from
cursor_combined_20260121_qodo_grep_cursor_copilot_1_head_refactor_always_preserve_marketplace_search_state_in_url_pr415
Open

refactor: always preserve marketplace search state in URL#22
tomerqodo wants to merge 2 commits intocursor_combined_20260121_qodo_grep_cursor_copilot_1_base_refactor_always_preserve_marketplace_search_state_in_url_pr415from
cursor_combined_20260121_qodo_grep_cursor_copilot_1_head_refactor_always_preserve_marketplace_search_state_in_url_pr415

Conversation

@tomerqodo
Copy link

@tomerqodo tomerqodo commented Jan 21, 2026

Benchmark PR from qodo-benchmark#415


Note

Streamlines marketplace state to always come from URL query params and removes client atom hydration.

  • Removes preserveSearchStateInQueryAtom, local atoms, and HydrateMarketplaceAtoms; marketplace hooks now directly use nuqs (useQueryState) for q, tags, and active tab
  • Changes active plugin type query key from category to tab in marketplace; plugin page context still uses category
  • Adjusts search-mode condition to rely on PLUGIN_CATEGORY_WITH_COLLECTIONS.has(activePluginType) instead of its negation
  • Deletes hydration-client.tsx and its usage in index.tsx; no functional changes to server hydration
  • Loosens usePluginPageContext selector typing (from function type to any)

Written by Cursor Bugbot for commit 647d6af. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

const isSearchMode = !!searchPluginText
|| filterPluginTags.length > 0
|| (searchMode ?? (!PLUGIN_CATEGORY_WITH_COLLECTIONS.has(activePluginType)))
|| (searchMode ?? (PLUGIN_CATEGORY_WITH_COLLECTIONS.has(activePluginType)))
Copy link

Choose a reason for hiding this comment

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

Search mode logic inverted, breaking collection display

High Severity

The negation operator was accidentally removed from the search mode condition. The comment states that search mode needs to be forced for categories without collections, but the new code PLUGIN_CATEGORY_WITH_COLLECTIONS.has(activePluginType) does the opposite—it forces search mode for categories that have collections ('all' and 'tool'). Categories like 'model', 'agent', 'extension' that lack collections will no longer default to search mode, breaking the marketplace display logic.

Fix in Cursor Fix in Web

const queryState = useQueryState('category', marketplaceSearchParamsParsers.category)
const atomState = useAtom(activePluginTypeAtom)
return preserveSearchStateInQuery ? queryState : atomState
return useQueryState('tab', marketplaceSearchParamsParsers.category)
Copy link

Choose a reason for hiding this comment

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

Client-server URL parameter name mismatch for category

High Severity

useActivePluginType() now uses 'tab' as the URL query parameter, but the server-side hydration in hydration-server.tsx reads from params.category (the key in marketplaceSearchParamsParsers). This mismatch means server-side prefetching won't recognize the tab parameter, causing hydration failures and incorrect data loading when users navigate with category-filtered URLs.

Fix in Cursor Fix in Web

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