feat: limit badges to 2 with hover/click popover in UserListTable#103
Conversation
Code Review by Qodo
1. Long onCheckedChange line
|
| <Checkbox | ||
| checked={table.getIsAllPageRowsSelected()} | ||
| onCheckedChange={(value) => table.toggleAllPageRowsSelected(!!value)} | ||
| onCheckedChange={(value: boolean | "indeterminate") => table.toggleAllPageRowsSelected(!!value)} |
There was a problem hiding this comment.
1. Long oncheckedchange line 📘 Rule violation ⛯ Reliability
• onCheckedChange is written as a single very long line, exceeding the 110 character line-width standard required by the repository’s Biome formatting rules. • This breaks the standardized style constraints (line width/formatting consistency) and will likely cause formatter/linter churn or CI failures when Biome is enforced.
Agent prompt
## Issue description
Some newly added/edited lines exceed the Biome-enforced 110 character line width (notably `onCheckedChange` and `getFacetedUniqueValues`), violating the repo’s standardized formatting rules.
## Issue Context
The compliance checklist requires Biome formatting with a 110 character line width for TS/JS. These long lines should be wrapped to avoid CI/lint failures and reduce formatting churn.
## Fix Focus Areas
- apps/web/modules/users/components/UserTable/UserListTable.tsx[282-287]
- apps/web/modules/users/components/UserTable/UserListTable.tsx[541-543]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| <div className="flex flex-col gap-1"> | ||
| {hiddenItems.map((item, index) => ( | ||
| <span | ||
| key={item.label} | ||
| className="text-default cursor-pointer text-sm hover:text-emphasis"> | ||
| {item.label} | ||
| </span> | ||
| ))} |
There was a problem hiding this comment.
2. Hidden items not clickable 🐞 Bug ✓ Correctness
• LimitedBadges only applies item.onClick to the visible badges; overflow (hidden) items are rendered as plain <span> elements without any click handler. • Callers (notably the Users table Teams column) pass onClick handlers to filter the table; these will silently stop working whenever an item is pushed into the overflow popover. • Because the hidden items are <span> elements, they are also not keyboard-accessible like the clickable Badge buttons are.
Agent prompt
### Issue description
Hidden/overflow items in `LimitedBadges` are currently rendered as plain `<span>` elements and do **not** invoke `BadgeItem.onClick`. This breaks consumer functionality (e.g., click-to-filter in the Users table) whenever an item appears in the overflow popover.
### Issue Context
`Badge` renders as a `<button>` when `onClick` is provided, so using spans for interactive overflow items also reduces accessibility (keyboard interaction).
### Fix Focus Areas
- apps/web/components/ui/LimitedBadges.tsx[66-101]
- apps/web/modules/users/components/UserTable/UserListTable.tsx[385-393]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Benchmark PR from agentic-review-benchmarks#8