Skip to content

Conversation

@tomerqodo
Copy link

Benchmark PR from agentic-review-benchmarks#9

@qodo-code-review
Copy link

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (1) 📎 Requirement gaps (0)

Grey Divider


Action required

1. usePluginPageContext uses any 📘 Rule violation ✓ Correctness
Description
• The selector parameter was changed to an explicit any, which disables TypeScript’s type
  checking for this API surface and can hide real type errors.
• This violates the requirement to avoid explicit any types and can lead to unsafe usage across
  all call sites of usePluginPageContext.
Code

web/app/components/plugins/plugin-page/context.tsx[51]

+export function usePluginPageContext(selector: any) {
Evidence
PR Compliance ID 14 forbids explicit any types in TypeScript. The updated function signature
explicitly types selector as any, directly violating that rule.

AGENTS.md
web/app/components/plugins/plugin-page/context.tsx[51-52]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`usePluginPageContext` currently accepts `selector: any`, which disables type safety and violates the no-explicit-any requirement.

## Issue Context
This hook is part of a shared context API; leaving `any` here propagates unsafe typing to all consumers.

## Fix Focus Areas
- web/app/components/plugins/plugin-page/context.tsx[51-52]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Collections view never shows 🐞 Bug ✓ Correctness
Description
useMarketplaceSearchMode now defaults to search mode when the active category is in
  PLUGIN_CATEGORY_WITH_COLLECTIONS (including the default all).
• This makes useMarketplaceData always build queryParams and run the plugins search query on
  initial load, so the collections UI path is skipped.
• Users can see an empty state or unintended search results instead of curated collections, and the
  page does extra network work.
Code

web/app/components/plugins/marketplace/atoms.ts[43]

+    || (searchMode ?? (PLUGIN_CATEGORY_WITH_COLLECTIONS.has(activePluginType)))
Evidence
The code now treats “has collections” as a reason to enter search mode. Since
PLUGIN_CATEGORY_WITH_COLLECTIONS includes all, the initial marketplace state becomes search
mode. Downstream, useMarketplaceData only omits plugin searching when isSearchMode is false, and
the List component renders collections only when plugins is undefined—so the collections view is
effectively bypassed.

web/app/components/plugins/marketplace/atoms.ts[29-45]
web/app/components/plugins/marketplace/constants.ts[10-30]
web/app/components/plugins/marketplace/state.ts[20-36]
web/app/components/plugins/marketplace/list/index.tsx[29-38]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Marketplace defaults into search mode for categories that have collections (including `all`), preventing the collections view from rendering and triggering search queries with empty criteria.

## Issue Context
`PLUGIN_CATEGORY_WITH_COLLECTIONS` includes `all` and `tool`. The List UI renders collections only when `plugins` is `undefined`, but `useMarketplaceData` will always produce `queryParams` (and thus `plugins`) when search mode is true.

## Fix Focus Areas
- web/app/components/plugins/marketplace/atoms.ts[35-45]
- web/app/components/plugins/marketplace/constants.ts[25-30]
- web/app/components/plugins/marketplace/state.ts[20-36]
- web/app/components/plugins/marketplace/list/index.tsx[29-38]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. SSR/tab param mismatch 🐞 Bug ⛯ Reliability
Description
useActivePluginType now reads/writes query param tab, but the shared parsers and server
  hydration still parse category.
• SSR prefetch (HydrateQueryClient) will ignore tab and default to category=all, causing wrong
  prefetched data and client/server mismatch (layout shift + wasted requests) on direct links like
  ?tab=tool.
• Existing deep links or surrounding code that sets category (e.g., PluginPageContext) no longer
  drive the marketplace category selection.
Code

web/app/components/plugins/marketplace/atoms.ts[R22-24]

export function useActivePluginType() {
-  const preserveSearchStateInQuery = useAtomValue(preserveSearchStateInQueryAtom)
-  const queryState = useQueryState('category', marketplaceSearchParamsParsers.category)
-  const atomState = useAtom(activePluginTypeAtom)
-  return preserveSearchStateInQuery ? queryState : atomState
+  return useQueryState('tab', marketplaceSearchParamsParsers.category)
}
Evidence
Client marketplace state uses tab, but server-side createLoader(marketplaceSearchParamsParsers)
only reads keys defined on the parser object—currently category, q, tags. Therefore, SSR
hydration cannot see tab and will always treat category as default, diverging from the client
state.

web/app/components/plugins/marketplace/atoms.ts[19-27]
web/app/components/plugins/marketplace/search-params.ts[5-9]
web/app/components/plugins/marketplace/hydration-server.tsx[16-21]
web/app/components/plugins/plugin-page/context.tsx[66-73]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Marketplace category is stored in URL param `tab` on the client, but server-side parsing/hydration still reads `category`. This breaks SSR prefetch and any deep links using the old param.

## Issue Context
`createLoader(marketplaceSearchParamsParsers)` only loads keys present on the parser object (`category`, `q`, `tags`). `useActivePluginType` now writes `tab`, so SSR cannot see it.

## Fix Focus Areas
- web/app/components/plugins/marketplace/atoms.ts[19-27]
- web/app/components/plugins/marketplace/search-params.ts[5-9]
- web/app/components/plugins/marketplace/hydration-server.tsx[16-28]
- web/app/components/plugins/plugin-page/context.tsx[66-73]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



ⓘ The new review experience is currently in Beta. Learn more

Qodo Logo

}

export function usePluginPageContext(selector: (value: PluginPageContextValue) => any) {
export function usePluginPageContext(selector: any) {

Choose a reason for hiding this comment

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

Action required

1. usepluginpagecontext uses any 📘 Rule violation ✓ Correctness

• The selector parameter was changed to an explicit any, which disables TypeScript’s type
  checking for this API surface and can hide real type errors.
• This violates the requirement to avoid explicit any types and can lead to unsafe usage across
  all call sites of usePluginPageContext.
Agent prompt
## Issue description
`usePluginPageContext` currently accepts `selector: any`, which disables type safety and violates the no-explicit-any requirement.

## Issue Context
This hook is part of a shared context API; leaving `any` here propagates unsafe typing to all consumers.

## Fix Focus Areas
- web/app/components/plugins/plugin-page/context.tsx[51-52]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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

Choose a reason for hiding this comment

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

Action required

2. Collections view never shows 🐞 Bug ✓ Correctness

useMarketplaceSearchMode now defaults to search mode when the active category is in
  PLUGIN_CATEGORY_WITH_COLLECTIONS (including the default all).
• This makes useMarketplaceData always build queryParams and run the plugins search query on
  initial load, so the collections UI path is skipped.
• Users can see an empty state or unintended search results instead of curated collections, and the
  page does extra network work.
Agent prompt
## Issue description
Marketplace defaults into search mode for categories that have collections (including `all`), preventing the collections view from rendering and triggering search queries with empty criteria.

## Issue Context
`PLUGIN_CATEGORY_WITH_COLLECTIONS` includes `all` and `tool`. The List UI renders collections only when `plugins` is `undefined`, but `useMarketplaceData` will always produce `queryParams` (and thus `plugins`) when search mode is true.

## Fix Focus Areas
- web/app/components/plugins/marketplace/atoms.ts[35-45]
- web/app/components/plugins/marketplace/constants.ts[25-30]
- web/app/components/plugins/marketplace/state.ts[20-36]
- web/app/components/plugins/marketplace/list/index.tsx[29-38]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines 22 to 24
export function useActivePluginType() {
const preserveSearchStateInQuery = useAtomValue(preserveSearchStateInQueryAtom)
const queryState = useQueryState('category', marketplaceSearchParamsParsers.category)
const atomState = useAtom(activePluginTypeAtom)
return preserveSearchStateInQuery ? queryState : atomState
return useQueryState('tab', marketplaceSearchParamsParsers.category)
}

Choose a reason for hiding this comment

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

Action required

3. Ssr/tab param mismatch 🐞 Bug ⛯ Reliability

useActivePluginType now reads/writes query param tab, but the shared parsers and server
  hydration still parse category.
• SSR prefetch (HydrateQueryClient) will ignore tab and default to category=all, causing wrong
  prefetched data and client/server mismatch (layout shift + wasted requests) on direct links like
  ?tab=tool.
• Existing deep links or surrounding code that sets category (e.g., PluginPageContext) no longer
  drive the marketplace category selection.
Agent prompt
## Issue description
Marketplace category is stored in URL param `tab` on the client, but server-side parsing/hydration still reads `category`. This breaks SSR prefetch and any deep links using the old param.

## Issue Context
`createLoader(marketplaceSearchParamsParsers)` only loads keys present on the parser object (`category`, `q`, `tags`). `useActivePluginType` now writes `tab`, so SSR cannot see it.

## Fix Focus Areas
- web/app/components/plugins/marketplace/atoms.ts[19-27]
- web/app/components/plugins/marketplace/search-params.ts[5-9]
- web/app/components/plugins/marketplace/hydration-server.tsx[16-28]
- web/app/components/plugins/plugin-page/context.tsx[66-73]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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.

3 participants