Skip to content

Hide collapsed settings dialog and results panel from assistive tech and tab order - #122

Open
usehoplite[bot] wants to merge 1 commit into
mainfrom
hoplite/pellene-87e445d8
Open

Hide collapsed settings dialog and results panel from assistive tech and tab order#122
usehoplite[bot] wants to merge 1 commit into
mainfrom
hoplite/pellene-87e445d8

Conversation

@usehoplite

@usehoplite usehoplite Bot commented Sep 2, 2026

Copy link
Copy Markdown

What changed

docs/mark.html (and its packaged copy fuckmark/webui/mark.html) hid the Settings dialog and the Success/History panel with opacity/transform only. Both stayed in the accessibility tree while visually closed, so on page load screen readers announced an invisible dialog "Settings" and a "Success" heading, and keyboard users could Tab into invisible controls: the sheet's Clear history button and each history item's Copy button.

The fix adds visibility: hidden to the closed state of .sheet and .after and visibility: visible on their .open/.on states, with the visibility flip delayed to the end of the close transition so the animations still play. visibility: hidden removes the subtrees from both the accessibility tree and sequential focus navigation; both properties flip back immediately on open.

Verified

  • Accessibility tree at load, before: dialog "Settings" + paragraph + button "Clear history", heading "Success" + success message, full History section including "No history yet".
  • After: load tree is only Settings button, FuckMark heading, textarea, Remove marks button. Opening the gear re-exposes the dialog and Clear history; closing removes them again.
  • Success demo (?demo=1) still detects the watermarked sample (170 chars → 135 insertions stripped), reveals Success/History with working Copy button; fail demo (?demo=fail) still shows the closed-set miss copy, Contact us → two-step form, and Try again → restore, with focus moves intact.
  • Layout and animations unchanged — the fix only affects the closed state's AT/focus exposure, never the visible rendering:

mark.html clean load after fix

Settings dialog still renders and animates identically when opened:

settings dialog open after fix

Tests

tests/test_web.py, tests/test_mark_page.py, tests/test_hidden_scan_spec.py, tests/test_scan_wasm.py, tests/test_install_release_hardening.py, tests/test_demo_page.py, tests/test_browser_extension.py, tests/test_vscode_scanner_parity.py — all pass (46 passed, 1 skipped). Byte parity between docs/mark.html and fuckmark/webui/mark.html re-verified with cmp; both files re-scanned with the project's own scan_hidden_characters(..., language="html") — zero hidden characters introduced.

Open in Hoplite

The Settings dialog and the Success/History panel are hidden with opacity
and transform only, so on load their contents stay in the accessibility
tree: screen readers announce an invisible dialog and Success heading,
and the 'Clear history' and history 'Copy' buttons remain Tab-focusable
while off-screen. visibility:hidden (flipped after the close transition,
immediately on open) removes them from both the AT tree and the tab
order until actually shown.

Co-authored-by: Yinhao Chen <pxxyhc@gmail.com>
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.

0 participants