Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions web/package/agama-web-ui.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Mar 2 23:06:08 UTC 2026 - David Diaz <dgonzalez@suse.com>

- Add visual feedback on table row hover and focus
(gh#agama-project/agama#3233).

-------------------------------------------------------------------
Mon Mar 2 18:01:05 UTC 2026 - David Diaz <dgonzalez@suse.com>

Expand Down
21 changes: 21 additions & 0 deletions web/src/assets/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,27 @@ label.pf-m-disabled + .pf-v6-c-check__description {
--pf-v6-c-table__sort-indicator--MarginInlineStart: var(--pf-t--global--spacer--xs);
}

// Highlight table rows on interaction, covering three cases:
// 1. Mouse hover.
// 2. Keyboard navigation via :focus-within, which is intentionally broad and
// covers all focusable elements including checkboxes. This way, keyboard
// users always know which row they are on. The downside: if a mouse user
// clicks a checkbox and moves away, the row stays highlighted until focus
// moves elsewhere. This is an acceptable edge case since most users will
// naturally move on after checking a box and in any case the benefit for
// keyboard users outweighs the minor annoyance for mouse users.
// 3. Action menu open via aria-expanded attribute.
//
// Note: PF's isClickable prop on Tr would provide the hover highlight out of
// the box, but it also adds a pointer cursor and implies the row is clickable,
// which is not the case for Agama tables. Hence this custom CSS to get the
// visual feedback without the misleading affordance.
.pf-v6-c-table tbody tr:hover,
.pf-v6-c-table tbody tr:focus-within,
.pf-v6-c-table tbody tr:has(.pf-v6-c-menu-toggle[aria-expanded="true"]) {
background-color: var(--agm-t--action--background--color--hover);
}

// Some utilities not found at PF
.w-14ch {
inline-size: 14ch;
Expand Down
5 changes: 4 additions & 1 deletion web/src/components/core/SimpleDropdown.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ describe("SimpleDropdown", () => {
const { user } = installerRender(
<SimpleDropdown items={mockItems} label="Actions for 0.0.0160" />,
);
await user.click(screen.getByRole("button", { name: "Actions for 0.0.0160" }));

const toggle = screen.getByRole("button", { name: "Actions for 0.0.0160" });
await user.click(toggle);
expect(toggle).toHaveAttribute("aria-expanded", "true");
screen.getByRole("menuitem", { name: "Activate" });
screen.getByRole("menuitem", { name: "Deactivate" });
screen.getByRole("menuitem", { name: "Format" });
Expand Down
1 change: 1 addition & 0 deletions web/src/components/core/SimpleDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export default function SimpleDropdown({
onClick={() => setIsOpen(!isOpen)}
variant="plain"
aria-label={label}
isExpanded={isOpen}
>
<Icon name="more_horiz" />
</MenuToggle>
Expand Down