fix: prevent trailing interactive controls being swallowed by EntityR…#819
fix: prevent trailing interactive controls being swallowed by EntityR…#819mikefreno wants to merge 1 commit intopaperclipai:masterfrom
Conversation
…ow link When a row has both a navigation target (to=) and trailing content (buttons, menus), the Link element previously covered the entire row, making trailing controls unclickable. Split the layout so a decorative full-bleed Link sits behind the content (z-index / aria-hidden) while trailing children render at a higher z-index in normal document flow.
Greptile SummaryThis PR fixes a real UX bug where an all-encompassing Key observations:
Confidence Score: 3/5
Important Files Changed
Prompt To Fix All With AIThis is a comment left during a code review.
Path: ui/src/components/EntityRow.tsx
Line: 67-72
Comment:
**Keyboard & screen-reader navigation is broken for the `to + trailing` case**
`aria-hidden="true"` combined with `tabIndex={-1}` completely removes the Link from both the tab order *and* from the accessibility tree. This means:
- Keyboard-only users who navigate with Tab can never reach the row's navigation target — neither the outer `<div>` nor the `<Link>` are focusable.
- Screen-reader users who rely on the accessibility tree can't discover or activate the link at all.
Removing `aria-hidden` (while keeping `tabIndex={-1}`) is the minimal fix: the link stays out of the Tab sequence (so focus jumps to trailing controls naturally) but remains discoverable via arrow-key navigation in screen readers. Adding an `aria-label` that mirrors the row title would further improve the experience:
```suggestion
<Link
to={to}
className="absolute inset-0 no-underline"
onClick={onClick}
tabIndex={-1}
aria-label={title}
/>
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: ui/src/components/EntityRow.tsx
Line: 60-62
Comment:
**Comment describes layout inaccurately**
The comment says "a Link covers the leading + body (left side)" but the Link actually uses `absolute inset-0`, which means it covers the *entire* row (including the trailing area). The trailing wrapper renders above it via `z-10`. Consider updating the comment to avoid future confusion:
```suggestion
// When there is both a nav target and trailing interactive content, split the
// row: a full-bleed absolute Link sits behind all content (z-index: auto),
// while trailing children render at z-10 so their buttons/menus are never
// swallowed by the link's click area.
```
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: fcc0977 |
| <Link | ||
| to={to} | ||
| className="absolute inset-0 no-underline" | ||
| onClick={onClick} | ||
| tabIndex={-1} | ||
| aria-hidden="true" |
There was a problem hiding this comment.
Keyboard & screen-reader navigation is broken for the to + trailing case
aria-hidden="true" combined with tabIndex={-1} completely removes the Link from both the tab order and from the accessibility tree. This means:
- Keyboard-only users who navigate with Tab can never reach the row's navigation target — neither the outer
<div>nor the<Link>are focusable. - Screen-reader users who rely on the accessibility tree can't discover or activate the link at all.
Removing aria-hidden (while keeping tabIndex={-1}) is the minimal fix: the link stays out of the Tab sequence (so focus jumps to trailing controls naturally) but remains discoverable via arrow-key navigation in screen readers. Adding an aria-label that mirrors the row title would further improve the experience:
| <Link | |
| to={to} | |
| className="absolute inset-0 no-underline" | |
| onClick={onClick} | |
| tabIndex={-1} | |
| aria-hidden="true" | |
| <Link | |
| to={to} | |
| className="absolute inset-0 no-underline" | |
| onClick={onClick} | |
| tabIndex={-1} | |
| aria-label={title} | |
| /> |
Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/src/components/EntityRow.tsx
Line: 67-72
Comment:
**Keyboard & screen-reader navigation is broken for the `to + trailing` case**
`aria-hidden="true"` combined with `tabIndex={-1}` completely removes the Link from both the tab order *and* from the accessibility tree. This means:
- Keyboard-only users who navigate with Tab can never reach the row's navigation target — neither the outer `<div>` nor the `<Link>` are focusable.
- Screen-reader users who rely on the accessibility tree can't discover or activate the link at all.
Removing `aria-hidden` (while keeping `tabIndex={-1}`) is the minimal fix: the link stays out of the Tab sequence (so focus jumps to trailing controls naturally) but remains discoverable via arrow-key navigation in screen readers. Adding an `aria-label` that mirrors the row title would further improve the experience:
```suggestion
<Link
to={to}
className="absolute inset-0 no-underline"
onClick={onClick}
tabIndex={-1}
aria-label={title}
/>
```
How can I resolve this? If you propose a fix, please make it concise.| // When there is both a nav target and trailing interactive content, split the | ||
| // row: a Link covers the leading + body (left side), while trailing sits in | ||
| // normal flow at a higher z-index so its buttons/menus are never swallowed |
There was a problem hiding this comment.
Comment describes layout inaccurately
The comment says "a Link covers the leading + body (left side)" but the Link actually uses absolute inset-0, which means it covers the entire row (including the trailing area). The trailing wrapper renders above it via z-10. Consider updating the comment to avoid future confusion:
| // When there is both a nav target and trailing interactive content, split the | |
| // row: a Link covers the leading + body (left side), while trailing sits in | |
| // normal flow at a higher z-index so its buttons/menus are never swallowed | |
| // When there is both a nav target and trailing interactive content, split the | |
| // row: a full-bleed absolute Link sits behind all content (z-index: auto), | |
| // while trailing children render at z-10 so their buttons/menus are never | |
| // swallowed by the link's click area. |
Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/src/components/EntityRow.tsx
Line: 60-62
Comment:
**Comment describes layout inaccurately**
The comment says "a Link covers the leading + body (left side)" but the Link actually uses `absolute inset-0`, which means it covers the *entire* row (including the trailing area). The trailing wrapper renders above it via `z-10`. Consider updating the comment to avoid future confusion:
```suggestion
// When there is both a nav target and trailing interactive content, split the
// row: a full-bleed absolute Link sits behind all content (z-index: auto),
// while trailing children render at z-10 so their buttons/menus are never
// swallowed by the link's click area.
```
How can I resolve this? If you propose a fix, please make it concise.
When a row has both a navigation target (to=) and trailing content (buttons, menus), the Link element previously covered the entire row, making trailing controls unclickable. Split the layout so a decorative full-bleed Link sits behind the content (z-index / aria-hidden) while trailing children render at a higher z-index in normal document flow.