fix(report): make filter buttons legible and open advisories in a new tab (2.3.1) - #10
Merged
Merged
Conversation
… tab
Two defects found during live testing of the 2.3.0 HTML report.
1. Filter button labels were invisible until clicked.
Root cause was a mistake in the stylesheet, not the browser: the
report declared `:root { color-scheme: light dark; }` while the page
hardcodes light body colours and implements no dark theme. That
declaration tells the browser the page supports dark mode, so it
styled form controls for dark mode — white text — against the `#fff`
background set here. `.controls button` set a background but no
`color`, and `font: inherit` does not carry colour, so nothing
overrode the user agent. Only the pressed button was visible, because
it explicitly sets `color: #fff` on a dark background.
Reproduced with prefers-color-scheme: dark, where the unpressed
buttons computed to rgb(255,255,255) on rgb(255,255,255).
Fixed at both levels: `color-scheme: light` so the report stops
advertising support it does not have, and an explicit `color` on the
buttons so they are correct regardless of user agent or scheme. The
explicit colour is the real fix; it does not depend on colour-scheme
behaviour. Verified under dark mode: unpressed buttons now compute to
17.2:1 contrast and the pressed button to 8.7:1, both above WCAG AAA.
Also adds hover and focus-visible states — a button with no hover
feedback reads as broken, and the focus ring restores keyboard
affordance that came from the user-agent style being overridden.
2. Advisory links replaced the report in the same tab.
`target="_blank"` was missing. A reader working through a filtered
list lost their filter and scroll position on every advisory they
opened. `rel="noreferrer noopener"` was already present and is the
required companion, so it now denies the opened page a handle back to
the report.
Both are covered by regression tests that were confirmed to fail against
the pre-fix code (5 of 8 fail when the defects are reintroduced), rather
than only passing after the fix: the CSS tests parse the `.controls
button` declaration block and assert an explicit colour distinct from
its background, and the link tests assert every anchor carries both
target and rel.
Tests: 236 -> 244.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Patch bump for the HTML report fixes in f119ff6 (invisible filter button labels; advisory links opening in the same tab). Behaviour-only fixes to generated output, no API or interface change, so PATCH per semver. Per the release runbook the bump lands in this PR so `main` always reflects the latest released version; the tag is pushed after merge. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Two defects found while live-testing the 2.3.0 HTML report. Both are in generated output only — no interface change — so this also bumps
VERSIONto 2.3.1 per the release runbook.1. Filter button labels were invisible until clicked
Reported symptom: the
Impacted/Needs review/Not impactedbuttons appeared as blank white rectangles, only becoming readable once pressed.Root cause was a mistake in our stylesheet, not a browser quirk. The report declared:
…while the page hardcodes light body colours (
color: #1b1b1b; background: #f7f7f8) and implements no dark theme at all. That declaration tells the browser the page supports dark mode, so it styled form controls for dark mode — white text — against the#fffbackground set on.controls button. That rule set a background but never acolor, andfont: inheritdoes not carry colour, so nothing overrode the user agent. Only the pressed button escaped, because it explicitly setscolor: #fffon a dark background.Reproduced before changing anything, under
prefers-color-scheme: dark:colorbackgroundAll (3)(pressed)rgb(255,255,255)rgb(31,78,120)Impacted (1)rgb(255,255,255)rgb(255,255,255)←Needs review (1)rgb(255,255,255)rgb(255,255,255)←Not impacted (1)rgb(255,255,255)rgb(255,255,255)←Fixed at both levels:
color-scheme: light, so the report stops advertising support it does not have; and an explicitcoloron the buttons, so they are correct regardless of user agent or scheme. The explicit colour is the real fix — it does not depend on colour-scheme behaviour.Verified under dark mode after the fix: unpressed buttons compute to 17.2:1 contrast, the pressed button to 8.7:1. Both above WCAG AAA (7:1).
Also adds
:hoverand:focus-visiblestates. Overriding the user-agent button style had removed both the hover feedback (a button with none reads as broken) and the focus ring, leaving keyboard users with no visible focus indicator.2. Advisory links replaced the report in the same tab
target="_blank"was missing. A reader working through a filtered list lost their filter and scroll position on every advisory they opened — which is most of the point of the report.rel="noreferrer noopener"was already present and is the required companion, so the opened page gets no handle back to the report.Regression tests are confirmed non-vacuous
Rather than only checking they pass after the fix, I reintroduced both defects in memory and confirmed 5 of 8 new tests fail:
.controls buttondeclaration block and assert an explicitcolordistinct from itsbackground, so a future edit that drops it fails instead of shipping invisible text again;targetandrel, and that an advisory with no URL renders no anchor at all.Tests: 236 → 244, green under CI's
unittest discover -s tests.Constitution compliance (v2.2.0)
matching.pyandpsirt.pyare untouched.docs/index.htmlchange needed — neither documents report styling.Note for after merge
Merging makes
main2.3.1. Users only receive it once the tag is pushed and the Release workflow publishes it, sincecaia --updatediscovers releases via/releases/latest.🤖 Generated with Claude Code