fix(ui): render ANSI pages on a black backdrop (2.0.4) - #6
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the readability bug an F-Droid reviewer found while testing the v2.0.3 reproducible build (fdroiddata!41663):
What changed
TextViewernow gives ANSI content the background its colours were chosen against:AnsiParser.hasAnsi(text);0xFFE5E5E5) instead of MaterialonSurface, 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[40mfills blend instead of showing as boxes.Verification
:app:assembleDebugand:app:testDebugUnitTestpass. Installed on a device forced to the light theme (cmd uimode night no) and openedgopher://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 4with achangelogs/4.txtentry. After merge the F-Droid recipe needsBuilds[].commitpinned to the merged SHA, av2.0.4tag to publish the reference APK, and an update to the fdroiddata MR.🤖 Generated with Claude Code