codeant-ai-for-open-source[bot] commented on code in PR #36780:
URL: https://github.com/apache/superset/pull/36780#discussion_r2637862191
##########
superset-frontend/packages/superset-ui-core/src/components/Table/index.tsx:
##########
@@ -283,8 +283,8 @@ export function Table<RecordType extends object>(
resizable = false,
reorderable = false,
usePagination = true,
- defaultPageSize = 15,
- pageSizeOptions = ['5', '15', '25', '50', '100'],
+ defaultPageSize = 50,
+ pageSizeOptions = ['50'],
Review Comment:
**Suggestion:** If a parent component overrides `defaultPageSize` but does
not also update `pageSizeOptions`, the current default `pageSizeOptions =
['50']` can omit the active page size causing the UI to show a page size that
is not selectable in the dropdown; derive the default options from
`defaultPageSize` so the default options always include the chosen default.
[logic error]
**Severity Level:** Minor ⚠️
```suggestion
pageSizeOptions = [String(defaultPageSize)],
```
<details>
<summary><b>Why it matters? ⭐ </b></summary>
This is a valid, targeted fix: if a parent overrides defaultPageSize but
doesn't pass pageSizeOptions, the dropdown could omit the active page size.
Changing to pageSizeOptions = [String(defaultPageSize)] makes the defaults
consistent and prevents a confusing UX/state mismatch. The destructuring order
in the current code already places defaultPageSize before pageSizeOptions, so
the initializer will work.
</details>
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:**
superset-frontend/packages/superset-ui-core/src/components/Table/index.tsx
**Line:** 287:287
**Comment:**
*Logic Error: If a parent component overrides `defaultPageSize` but
does not also update `pageSizeOptions`, the current default `pageSizeOptions =
['50']` can omit the active page size causing the UI to show a page size that
is not selectable in the dropdown; derive the default options from
`defaultPageSize` so the default options always include the chosen default.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]