Skip to content

Pass Lighthouse's table-header and target-size audits - #302

Merged
danielplohmann merged 1 commit into
masterfrom
fix/lighthouse-accessibility-audits
Oct 29, 2026
Merged

danielplohmann merged 1 commit into
masterfrom
fix/lighthouse-accessibility-audits

Conversation

@r0ny123

@r0ny123 r0ny123 commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Lighthouse's accessibility category still fails two audits on master (6564602). On a phone, target-size takes the 1vN result pages to 96: a result row's id and family cells hold a link and, next to it, the icon that filters by that value, and a narrow column wraps the two onto 21.6px lines, closer together than the 24px targets WCAG 2.5.8 asks for. td-has-header fails on the index, the 1vN results and the cross-compare result, because some tables have header cells without text (an empty <th> over a buttons column, or only an icon whose title is a tooltip rather than header text) or, in the cross-compare matrix, no header cells at all. This gives every such header text for assistive technology and keeps a value next to its filter icon, without changing how a page looks at desktop width.

Change.

  • Header cells without text get a visually-hidden label, and their icon gets aria-hidden="true"; the icon's title stays as the hover tooltip.
    • Empty headers over action columns say "Actions" (mcritweb/templates/table/job_row.html:213, :259, table/family_row.html:85, table/function_row.html:61, table/sample_row.html:110, cross_compare.html:134, unique_blocks.html:106, five in users.html); the info column says "Details" (table/sample_row.html:107) and the badge column "Match" (table/row_decoration.html:44).
    • Icon-only headers say "Sample ID", "Family ID" or "Function ID", including the icon-only sortable headers (table/sample_row.html:76, table/function_row.html:29-37, table/family_row.html:65). The family column of the result tables (result_compare_all.html:82, :164, result_compare_family.html:55, result_compare_sample.html:40, result_compare_vs.html:33) says "Family", because its cells show names, and its tooltip now says the same.
  • Icons left open inside a header are closed, since aria-hidden on an open <i> would hide the label after it too (cross_compare.html:127, unique_blocks.html:99; and the four headers at result_compare_function.html:55-65, which have text and only needed the markup fixed).
  • The cross-compare matrix's header row was <td>. It is <th scope="col"> at normal weight now, so it looks as before (result_cross.html:7-14).
  • table.table td.id, table.table td.family keep their content on one line (mcritweb/static/style.css:328), and the five family cells that carry a filter icon get class="family" (result_compare_all.html:116, :198, result_compare_family.html:89, result_compare_sample.html:74, result_compare_vs.html:67). The rule reaches every td.id in an application table, including link hunt and unique blocks, whose id cells hold one short token and did not change. A family name with spaces no longer wraps in those cells; the column takes its width instead.

Verification. On the testbed, master (6564602) and this branch as side instances against the live backend, logged in, otherwise GET only.

Lighthouse 12.8.2, accessibility, with its default mobile emulation, one run per page on each side:

page master this branch
index 100, td-has-header fails 100
samples 100 100
1vN result, sample 8 (job 6ab3b4455ccfc2538ffea9b6) 96: target-size (11 links), td-has-header 100
the same with ?famid=3, ?samid=10, ?funid=357 100 100
a second 1vN result, sample 8 (job 6ab3e95a3b24190e88fedbb4) 96: target-size (15 links), td-has-header 100
1v1 result (6ab3b44578ce0e8f2efea9c7) 100 100
cross compare (6ab3bc93e867efea4ffec3c5) 100, td-has-header fails 100
unique blocks (6ab3b4465ccfc2538ffea9c4), link hunt, function vs function, function page 100 100

On the branch no audit fails on any of these pages.

Screenshots at 1440, 1024, 768 and 390px of both cross-compare results, the 1vN result with ?famid=, ?samid= and ?funid=, the 1v1 result, unique blocks, and the samples, families and functions tables are pixel-identical to master at 1440px. At 768 and 390px the cells that wrapped the filter icon onto a second line no longer do (5 to 0 id cells on the 1vN page); the family column widens from 138 to 174px and the sample id column from 58 to 68px, so filename and version wrap more instead. scrollWidth is master's on every page and width checked. The index, jobs list and users page were checked at 1440px only.

No script reads header text: every cellIndex, textContent and th.id lookup in static/ and the templates targets body cells, and the cross-compare lazy panes treat <th> and <td> alike.

Tests.

  • tests/testAccessibility.py's page check now reports a <th> without text (a hidden span counts; an icon's title and text inside aria-hidden do not), a table of three rows and columns without any header cell, and a cell holding a link and its filter link that is not one of the cells kept on one line. Its self-test shows each is caught. Four pages join the list so every edited template is rendered: /explore/search?query=1 (which adds the "Match" column, now asserted), and one family's, one sample's and one function's matches.
  • tests/testTableLayout.py pins the nowrap rule.
  • Run against master's code, 23 of the 50 new or changed tests fail; the function-matches page test passes there too and stays as a guard. Restoring master's cross-compare header row fails the cross-compare page, removing one class="family" fails the 1vN pages, and dropping the nowrap rule fails testTableLayout. The header changes in result_compare_function.html only close tags, and no page test depends on them.
  • Full suite with Chromium on f6f15b4: 2096 passed, 0 skipped; ruff check . clean.

Relation to open PRs. A trial merge (git merge-tree) with each open PR head:

Lighthouse's accessibility category still failed two audits on master.
On a phone, target-size cost the 1vN and compare-sample result pages 4
points: an id or family cell holds the value and the icon that filters
by it, and a narrow column wrapped them onto two 21.6px lines, closer
than the 24px targets WCAG 2.5.8 asks for. td-has-header failed on the
index and the compare-all and compare-family results, where a header
cell had no text: an empty <th> over a buttons column, or an icon whose
title is a tooltip rather than header text.

Every such header gets a visually-hidden label and its icon
aria-hidden; icons left open inside a header are closed, since an open
aria-hidden <i> would hide the label too. The cross-compare matrix had
a header row of <td>; it is <th> at normal weight and looks the same.
Id and family cells keep their content on one line, so a family name
with spaces takes the column's width instead of wrapping.

testAccessibility's page check now reports a header without text, a
table without a header cell, and a value and its filter link that may
wrap; testTableLayout pins the nowrap rule.
@danielplohmann
danielplohmann merged commit a39f213 into master Oct 29, 2026
8 checks passed
danielplohmann added a commit that referenced this pull request Oct 29, 2026
@r0ny123
r0ny123 deleted the fix/lighthouse-accessibility-audits branch October 30, 2026 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants