Skip to content

Fix/Validate: a marked caption never refuses to open its card - #169

Open
erklu wants to merge 1 commit into
developfrom
a11y/validate-marked-caption-opens
Open

erklu wants to merge 1 commit into
developfrom
a11y/validate-marked-caption-opens

Conversation

@erklu

@erklu erklu commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Validate: a marked caption always opens its card, whatever the filters say

Found testing Validate in the test environment: hide every kind of issue but one, fix that kind, close the panel. The other captions are still marked in the text, but putting the caret in one of them opens nothing. A mark with no card behind it is a dead end; the only way out was to run Validate again and tick the kinds back on.

Cause

Validate marks every caption that has any issue (is_valid / has_error), whatever the filters in the panel say. When the caret comes to rest in a caption, ValidationPanel.follow_caret() looks for that caption's issue among the kinds being shown. A caption whose issues are all of hidden kinds is marked, but is found nowhere in that list, so nothing happens.

What changes

utils/validation_panel.py: when the caret comes to rest in a caption whose issues are all of hidden kinds, the kind of its first issue is shown again and that issue opens (reveal_hidden()). Its checkbox comes back ticked, the card carries a line, "Showing "Overlaps" again — it was hidden.", and the same sentence is said to a screen reader together with "Issue N of M". A closed panel opens as it already did for a marked caption, and the sentence is spoken a moment later, like the position, because a live region that appears with its text already in it is often not read.

  • A caption with an issue of a kind that is shown opens on that, and its other kinds stay hidden: that is what the reader chose.
  • Only the kind of the caption's first issue comes back, not every hidden kind the caption has.
  • Speech without a caption marks no caption, so it never brings a kind back. A caption with no issue, or one that is no longer in the list, changes nothing.
    The marks in the text are not changed. The other way to remove the dead end would be to take the marks off with the filter, but then a hidden kind could not be seen at all once the panel is closed, which is worse.

Appearance

One visible change: a caret in a marked caption with only hidden kinds now opens the card and ticks that kind's checkbox, where before nothing happened. Everything else in the panel, and the marks, look as before.

How it was checked

tests/test_validation.py: nine new tests (the kind comes back, only the first issue's kind, a shown kind wins and the rest stay hidden, what is said on the card and to a screen reader, a closed panel opens and says it later, a caption without an issue or gone, speech without a caption, and the existing "a hidden kind is not followed" test replaced by this behaviour). AGENTS.md: one addition to the Validate bullet. Full suite: 1014 passed (tests/test_recording.py excluded). The branch is made on main and does not depend on any other open PR.

Not checked

  • Not tried in a browser with a real file, only through the panel's methods in tests.
  • Not tested with a screen reader: the spoken sentence follows the pattern the panel already uses, but only a screen reader can show how it comes across.

Hiding kinds of issue in the panel left captions marked in the text with no
card to open: the caret landed in the block and nothing happened. When the
caret comes to rest in a caption whose issues are all of hidden kinds, the
kind of its first issue is now shown again and that issue opens, with a note
on the card and a spoken message. A caption with an issue of a shown kind
opens on that and keeps its other kinds hidden.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LCjpD3ehigLiUGH1oVQQAW
@erklu
erklu requested a review from krihal October 20, 2026 04:47
@erklu
erklu changed the base branch from main to develop October 21, 2026 08:17
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.

1 participant