Repository navigation
Conversation
…g no longer stops a start A saved ui.theme of ansi-dark stopped the phone app at every launch: Qt offered ui_theme's whole catalog, including the schemes drawn in the terminal's own colours (ColourScheme.from_terminal), and resolving one asks a terminal for its palette, which a Qt app does not have (TerminalPaletteRequired). Settings persist across installs, so every start died. - toad.qt.theme.offered_schemes leaves out from_terminal schemes. A saved one takes follow_theme's not-offered path: a warning, and the current scheme kept. - Qt's theme picker lists that same offer: SchemeChoosing.scheme_names is now each frontend's, abstract on the shared parent (the TUI's is its colours' schemes). - apply_setting_effect reports one setting's failing effect through show_error (shown, and saved to logs/errors, titled by the setting) and the other settings still apply, at start (SavedSettings.apply_all) and on a live change. - shipped_run starts the shipped app with ansi-dark saved, and its scenario applies every scheme Qt offers in turn. Tests: Qt's offer excludes the terminal schemes and every scheme it offers resolves; Textual's offer includes them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
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.
The phone app stopped at every launch with
ui_theme.colour.TerminalPaletteRequired: Query the terminal palette before resolving its colours(the phone'slogs/errors/android_startup_2026-11-18T03_32_47*.txt).Cause. The saved setting was
"theme": "ansi-dark". Startup runs every setting's effect (QtToadApp.__init__→SavedSettings.apply_all), and the theme effect callsfollow_theme→restyle→ColorScheme.from_theme. That resolves the scheme's colours, and ansi-dark and ansi-light are drawn in the terminal's own colours (ColourScheme.from_terminal), which need a palette from a terminal. A Qt app has no terminal to ask. Qt offered ui_theme's whole catalog, so it let the theme be chosen, and since settings persist across installs every start died.Changes
toad.qt.theme.offered_schemes) leaves out thefrom_terminalschemes, using the fact ui_theme already declares. Across the 21-scheme catalog,from_terminalmarks exactly the two that fail to resolve without a terminal. A saved one, such as the TUI's choice in the shared toad.json, takesfollow_theme's existing not-offered path: a warning, and the current scheme kept.SchemeChoosing.scheme_namesis abstract on the shared parent and each frontend answers its own. Qt answersoffered_schemes; the TUI answers its colours' schemes. Before this, Qt's picker listed the bare catalog: every terminal scheme, and not pywal's.apply_setting_effectshows and saves a failing effect through the app's error owner (show_error, which writeslogs/errors, titledSetting <path>) and the other settings still apply. This covers startup and live changes.tools/android/shipped_run.pystarts the shipped app with ansi-dark saved, as the phone had it. Theshippedscenario then applies every scheme Qt offers in turn through the sameui.themeeffect. A scheme that fails to draw leaves an error file, which fails the run.tests/model/test_theme_offer.py: Qt's offer excludes the terminal schemes, and every scheme it offers resolves.tests/textual/test_textual_theme_offer.py: the TUI's offer includes them.Evidence (desktop, offscreen, the phone's settings: a scratch
XDG_CONFIG_HOMEwith{"ui": {"theme": "ansi-dark"}})TerminalPaletteRequired, the phone's traceTheme 'ansi-dark' is not available; no error fileapply_setting_effectchangeSetting ui.theme: Query the terminal palette…and its error file, so the other settings still applieddraculasavedGates, run once on 1a13e18
tools/android/check.shwithPYTHONFAULTHANDLER=1: exit 0. The shipped app started with ansi-dark saved and applied all 20 schemes Qt offers (textual-dark…atom-one-light,wal) with no error file. It then ran every view kind and bound key on a scratch bus.tests/guards/test_test_layers.pyfails only ontest_worker_failed_toasts.pyimportingtoad.widgets.comms_chat, which fails the same way on main.For the phone. The next APK opens with ansi-dark saved and keeps the default scheme, with the warning. No settings need editing on the device.
🤖 Generated with Claude Code
https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3