refactor: always preserve marketplace search state in URL - #44
Conversation
🤖 Augment PR SummarySummary: Refactors the plugins marketplace to always reflect search state in the URL. Changes:
Technical Notes: Marketplace still uses server-side prefetch/hydration via TanStack Query based on request 🤖 Was this summary useful? React with 👍 or 👎 |
| const queryState = useQueryState('category', marketplaceSearchParamsParsers.category) | ||
| const atomState = useAtom(activePluginTypeAtom) | ||
| return preserveSearchStateInQuery ? queryState : atomState | ||
| return useQueryState('tab', marketplaceSearchParamsParsers.category) |
There was a problem hiding this comment.
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:6web/app/components/plugins/marketplace/hydration-server.tsx:16
🤖 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))) |
There was a problem hiding this comment.
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.
🤖 Was this useful? React with 👍 or 👎
Benchmark PR from qodo-benchmark#415