Skip to content

refactor: always preserve marketplace search state in URL - #44

Open
tomerqodo wants to merge 2 commits into
augment_combined_20260121_augment_sentry_coderabbit_1_base_refactor_always_preserve_marketplace_search_state_in_url_pr415from
augment_combined_20260121_augment_sentry_coderabbit_1_head_refactor_always_preserve_marketplace_search_state_in_url_pr415
Open

refactor: always preserve marketplace search state in URL#44
tomerqodo wants to merge 2 commits into
augment_combined_20260121_augment_sentry_coderabbit_1_base_refactor_always_preserve_marketplace_search_state_in_url_pr415from
augment_combined_20260121_augment_sentry_coderabbit_1_head_refactor_always_preserve_marketplace_search_state_in_url_pr415

Conversation

@tomerqodo

Copy link
Copy Markdown

Benchmark PR from qodo-benchmark#415

@augmentcode

augmentcode Bot commented Jan 22, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Refactors the plugins marketplace to always reflect search state in the URL.

Changes:

  • Removes the Jotai-based “preserve search state” toggle and related hydration wrapper
  • Switches marketplace search inputs (query/category/tags) to use nuqs useQueryState consistently
  • Simplifies the Marketplace component tree by dropping client-side atom hydration
  • Adjusts marketplace search-mode determination logic tied to category/collections
  • Loosens the typing of usePluginPageContext’s selector argument

Technical Notes: Marketplace still uses server-side prefetch/hydration via TanStack Query based on request searchParams.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

useActivePluginType() now binds the plugin type to the tab query param, but server-side parsing/prefetch (via createLoader(marketplaceSearchParamsParsers)) still expects category, which can cause SSR prefetch/state to default to all and diverge from the client URL. Consider aligning on a single query key (or supporting both for backward compatibility).

Other Locations
  • web/app/components/plugins/marketplace/search-params.ts:6
  • web/app/components/plugins/marketplace/hydration-server.tsx:16

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In useMarketplaceSearchMode(), the fallback uses PLUGIN_CATEGORY_WITH_COLLECTIONS.has(activePluginType), which seems inverted relative to the comment (and would force search mode for categories with collections). If this is unintended, it will prevent showing the collections view for all/tool by default.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

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