Skip to content

Screen reader output: new lines and announce() read aloud, plain-text console lines, screen reader settings - #57

Open
vadi2 wants to merge 9 commits into
mainfrom
ccr-14671218-tf96z6-u6-screen-reader
Open

vadi2 wants to merge 9 commits into
mainfrom
ccr-14671218-tf96z6-u6-screen-reader

Conversation

@vadi2

@vadi2 vadi2 commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Brief overview of PR changes/additions

  • While TalkBack is on and Read new text aloud holds, new game lines are read out through a live region: lines within 300 ms as one announcement, a burst as its count and last three lines. Replayed lines are not read.
  • A script's announce() is read, assertive or polite as the engine says; the same words twice are read twice.
  • Each console line is one TalkBack node whose text is the line without its styles.
  • Settings gains Read new text aloud, Tell games I use a screen reader (offered on the first run with TalkBack on) and Blank lines from the game (show, hide, a space). The app keeps its own copy and gives each profile that loads setConfig("announceIncomingText"|"advertiseScreenReader"|"blankLinesBehaviour", ...), names and values as in upstream's TLuaInterpreter.cpp.
  • Host tests: the profile checks wait for the fake game to count a connection the engine reported (it could lag the engine's "connected", a flake).
  • Links as custom actions wait for U7.

Motivation for adding to Mudlet

Blind players are a large part of Mudlet's community; on Android, Mudlet's own announcing is GUI code, so the app has to do it.

Other info (issues closed, discussion etc)

🤖 Generated with Claude Code

https://claude.ai/code/session_016ujaeFyaqXXDx8xjoThE6J

…sion 4)

setScreenSize (columns, rows) replaces setViewWidthPx and is told to the
game as NAWS by libmudlet and the stand-in; the statuses columns and
viewWidthPx go. libmudlet reports consoleColors at load and on change,
and passes a script's announce() on as an announce message. The
self-test sends its measured console size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ujaeFyaqXXDx8xjoThE6J
A text size setting, on a new settings screen reached from the game
screen's title bar, sizes the console's text in sp, so the system font
scale scales it too; a two-finger pinch on the console changes the same
setting, and a slider with Smaller and Larger buttons is its accessible
equivalent. The console measures its font's cell and sends the columns
and rows that fit with setScreenSize once they have held for 200 ms,
after a layout, rotation, keyboard or size change. Its default colours
come from status consoleColors.

Why the engine could not send something (status sendError, as for a
failed sendHidden) now shows in a snackbar over the console's foot,
which TalkBack reads. The sendError the engine resends after hello is
not shown again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ujaeFyaqXXDx8xjoThE6J
…ck on black was

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ujaeFyaqXXDx8xjoThE6J
atTwiceTheSystemFontSizeNothingIsCutOff failed on API 28 and 36 with
"'Disconnected' overflows its space", though the connection bar's state
fits with room to spare. A String Text answers GetTextLayoutResult from
ParagraphLayoutCache.slowCreateTextLayoutResultOrNull, which lays the
text out again as a MultiParagraph at the last maximum width;
MultiParagraph.width is that maximum while the result's size is the
text's own width, so didOverflowWidth holds for every String Text
narrower than its space.

The check now takes didOverflowHeight, which still sees text squeezed
or cut short, and text too wide for its space (the relayout wraps it
into lines the real layout lacks), plus the widest line against the
text's width. A failure names the size, the widest line and the height.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ujaeFyaqXXDx8xjoThE6J
…ttings

While TalkBack is on and "Read new text aloud" holds, new game lines are
read out through a live region, those within 300 ms as one announcement
and a burst as its count and last lines. A script's announce() is read,
assertive or polite. Each console line is a node whose text is the line
without its styles. Settings gains "Read new text aloud", "Tell games I
use a screen reader" (offered on the first run with TalkBack on) and
"Blank lines from the game", which go to each profile that loads as
setConfig() calls (announceIncomingText, advertiseScreenReader,
blankLinesBehaviour, as upstream's TLuaInterpreter names them).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ujaeFyaqXXDx8xjoThE6J
…r every setting

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ujaeFyaqXXDx8xjoThE6J
…Mudlet

- A group of lines up to the burst size is read as it is, without blank
  lines, and the test now checks it.
- setMudletSetting sends setConfig only for a setting Mudlet keeps; Lua
  values default to toString().
- Announcer's resources are lateinit, so a missing init fails loudly.
- Settings.reset() for the tests; comments say what the code does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ujaeFyaqXXDx8xjoThE6J
@vadi2
vadi2 force-pushed the ccr-14671218-tf96z6-u6-screen-reader branch from 7c8054c to 4549562 Compare November 15, 2026 01:27
…eported

The engine reports "connected" as soon as the kernel has made the connection,
which can be before fake_telnet's accept thread returns from accept() and counts
it. profile_checks read the count straight after the "connected" frame, so
"connects it again, disconnected, without closing it" (and, more rarely, "the
profile switched to is connected to its game") failed now and then. Both wait,
up to the test's timeout, for the count to rise, and print the counts. The
restore test's one positive count, read right after "reconnected", waits too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ujaeFyaqXXDx8xjoThE6J
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