refactor: always preserve marketplace search state in URL#9
Conversation
🤖 Augment PR SummarySummary: Refactors the plugins marketplace UI so search/filter state is always preserved in the URL query string. Changes:
Technical Notes: SSR prefetch still parses marketplace search params via 🤖 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 reads/writes tab, but server parsing/prefetch (createLoader(marketplaceSearchParamsParsers) and params.category) still depends on the category param; this can make the selected category default to all and skip intended SSR prefetching.
Other Locations
web/app/components/plugins/marketplace/hydration-server.tsx:16web/app/components/plugins/marketplace/hydration-server.tsx:19web/app/components/plugins/marketplace/search-params.ts:6
🤖 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.
| } | ||
|
|
||
| export function usePluginPageContext(selector: (value: PluginPageContextValue) => any) { | ||
| export function usePluginPageContext(selector: any) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Benchmark PR from agentic-review-benchmarks#9