Skip to content

fix(ui): render ANSI pages on a black backdrop (2.0.4) - #6

Merged
felipedbene merged 1 commit into
mainfrom
fix/ansi-light-theme-readability
Jul 29, 2026
Merged

fix(ui): render ANSI pages on a black backdrop (2.0.4)#6
felipedbene merged 1 commit into
mainfrom
fix/ansi-light-theme-readability

Conversation

@felipedbene

Copy link
Copy Markdown
Owner

Fixes the readability bug an F-Droid reviewer found while testing the v2.0.3 reproducible build (fdroiddata!41663):

the ANSI viewer paints the fixed xterm palette from AnsiParser.BASIC onto the Material surface, so on the light theme white and bright grey text (argb(229,229,229), argb(255,255,255)) is white on near white. In the colour CTA map the station labels were effectively invisible; the same file is fine in dark mode.

What changed

TextViewer now gives ANSI content the background its colours were chosen against:

  • black backdrop when AnsiParser.hasAnsi(text);
  • uncoloured runs default to xterm colour 7 (0xFFE5E5E5) instead of Material onSurface, which would be dark-on-black.

Plain text pages are untouched and still follow the theme.

Forcing a dark backdrop rather than remapping the light end of the palette: remapping changes the colours the art's author picked, and needs separate handling for the 256-colour and truecolour paths. Pure black rather than a dark grey because it matches the palette's own colour 0, so ESC[40m fills blend instead of showing as boxes.

Verification

:app:assembleDebug and :app:testDebugUnitTest pass. Installed on a device forced to the light theme (cmd uimode night no) and opened gopher://gopher.debene.dev/0/map.ansi — the station labels the reviewer called out (SKO, EVN, WRG, LPZ, OPK, UNC, WIL, SOX, MDW) render legibly, colours preserved.

Release

Bumps to 2.0.4 / versionCode 4 with a changelogs/4.txt entry. After merge the F-Droid recipe needs Builds[].commit pinned to the merged SHA, a v2.0.4 tag to publish the reference APK, and an update to the fdroiddata MR.

🤖 Generated with Claude Code

AnsiParser emits the fixed xterm palette regardless of the app theme, and
TextViewer painted it onto the Material surface. On the light theme the light
end of that palette -- grey argb(229,229,229) and white argb(255,255,255) --
came out white-on-near-white; an F-Droid reviewer found the station labels on
a colour CTA map effectively invisible (fdroiddata!41663). Dark mode was fine.

Give ANSI content the background its colours were chosen against instead of
remapping the palette, which would distort the art and would need separate
handling for the 256-colour and truecolour paths. Pure black rather than a
dark grey because it matches the palette's own colour 0, so ESC[40m fills
blend instead of showing as boxes. Uncoloured runs now default to xterm
colour 7 rather than Material onSurface, which would be dark-on-black.

Plain text pages are untouched and still follow the theme.
@felipedbene
felipedbene merged commit f3e9c90 into main Jul 29, 2026
1 check passed
@felipedbene
felipedbene deleted the fix/ansi-light-theme-readability branch July 29, 2026 19:39
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