Give every list row a real link in its first cell - #6
Merged
Conversation
Completes the row work. Removing `role="link"` restored the table semantics and made the cells readable, but left the rows as focusable <tr>s with no interactive role — readable, operable, yet with their PURPOSE unannounced. Each row's first cell now wraps its content in a genuine <a> pointing at the row's own destination. That anchor carries the accessible name and the keyboard focus, so the rows drop `tabindex` and `aria-label` entirely: a screen reader announces "…, link", the remaining cells stay individually readable, and Tab reaches one focusable element per row instead of a role-less one. Mouse behaviour is untouched — `data-href` and the single delegated listener stay, and that listener already ignores clicks originating inside an anchor, so a click on the first cell simply follows the link to the same place. 29 of 30 rows transformed mechanically with a quote-aware tag scanner rather than a regex: Blade expressions contain `->`, and a naive `[^>]*` truncates the tag at the first `>` — which is exactly why the earlier pass silently missed 7 rows. The 30th already had a proper anchor in its first cell and only needed its now-redundant row-level tabindex/aria-label removed. Verified beyond the suite: no nested anchors anywhere (invalid, and it would break both click and AT behaviour), and every anchor's href matches its own row's data-href — checked by pairing them in the source, not by assuming the transform. Also updates the row contract test AGAIN, and the comment says so plainly: it has now required `role="link"`, then `tabindex="0"`, and each requirement outlived its correctness. It now asserts the mechanism that is actually right — data-href for mouse, a real anchor for everything else.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes the row work started in #5.
Removing
role="link"restored table semantics and made the cells readable, but left rows as focusable<tr>s with no interactive role — readable and operable, yet with their purpose unannounced.Each row's first cell now wraps its content in a genuine
<a>pointing at the row's own destination. The anchor carries the accessible name and the keyboard focus, so rows droptabindexandaria-labelentirely.Mouse behaviour is untouched:
data-hrefand the single delegated listener stay, and that listener already ignores clicks originating inside an anchor.How it was done
29 of 30 rows transformed with a quote-aware tag scanner, not a regex. Blade expressions contain
->, and a naive[^>]*truncates the tag at the first>— which is exactly why the earlier pass silently missed 7 rows. The 30th already had a proper anchor and only needed its redundant row-level attributes removed.Verified beyond the suite
hrefmatches its own row'sdata-href— checked by pairing them in the source rather than trusting the transform.The row contract test, third revision
It has now required
role="link", thentabindex="0", and each requirement outlived its correctness. The comment says so. It now asserts the mechanism that is actually right.Gate
pint · PHPStan level max (0 errors) · 1032 tests — green.