Skip to content

Screen::to_svg emits no <title>, so a rendered screen is unlabelled to a screen reader #316

Description

@vyncint

TodayScreen::to_svg produces a standalone <svg> with a viewBox, a font stack and one <text> per row. Measured on 0.10.1: grep -c '<title>' crates/termlens/src/screen/render.rs0. The element has no <title>, no role and no aria-label.

Why it is worth fixing — these SVGs are made to be attached to a pull request or a bug report (that is what #248 added them for, and what .github/actions/report uploads). An image in a PR with no accessible name is announced as nothing at all, and the fix is one element that SVG has for exactly this purpose.

Fix — in crates/termlens/src/screen/render.rs, emit <title> as the first child of <svg> with a short description of what the picture is (its size, at minimum — e.g. termlens screen, 80x24), and add role="img". Escape it with the same escape_xml helper the text rows use. Consider whether the title should be able to carry the terminal's own Screen::title when the application set one.

Done when

  • The SVG's first child is an escaped <title> and the root carries role="img".
  • A case in crates/termlens/tests/export.rs (or the existing SVG snapshot) covers it, including a screen whose title contains < or &.

A good first contribution: one file, no architecture decisions. Start with
CONTRIBUTING.md
— §1 lists every gate you can run locally, and §3 asks that a change land
with a test. Commits are Conventional Commits and need git commit -s
(DCO). Happy to review a draft PR early.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions