fix(theme): make graphite the explicit default across startup modes#200
Merged
benvinegar merged 1 commit intoelucid/tty-mouse-pager-fixesfrom Apr 13, 2026
Merged
Conversation
Contributor
Greptile SummaryMakes Confidence Score: 5/5Safe to merge; all remaining findings are non-blocking style suggestions. The logic change is correct and well-scoped. Override precedence is preserved by the No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[resolveConfiguredCliInput] --> B[base: theme = graphite]
B --> C{user config file\nspecifies theme?}
C -- yes --> D[mergeOptions: use config theme]
C -- no --> E[keep graphite]
D --> F{CLI --theme flag?}
E --> F
F -- yes --> G[mergeOptions: use CLI theme]
F -- no --> H[keep resolved theme]
G --> I[bootstrap.initialTheme]
H --> I
I --> J[resolveTheme called in App.tsx]
J --> K{exact match\nin THEMES list?}
K -- yes --> L[return matched theme]
K -- no --> M[return graphite fallback\n_themeMode ignored]
Reviews (2): Last reviewed commit: "fix(theme): make graphite the explicit d..." | Re-trigger Greptile |
The tty/mouse pager work depends on split stdio wiring for stdin-backed patch and pager sessions. In that path, implicit renderer theme autodetect no longer produces stable default-theme behavior. Make graphite the built-in default so startup mode no longer changes the palette while still allowing explicit user and config overrides.
5c36949 to
2134eca
Compare
Member
Author
|
@greptileai review |
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.
Summary
Make
graphitethe single built-in fallback theme across startup modes, removing implicit renderer-mode-based fallback selection for unspecified themes.This is intentionally scoped on top of
elucid/tty-mouse-pager-fixes, where stdin-backedpatch -/pagersessions need split terminal plumbing to preserve mouse scrolling.Why this change
On
main, piped patch/pager sessions happened to come up dark under the old all-/dev/ttyrenderer wiring.On
elucid/tty-mouse-pager-fixes, fixing mouse scrolling required keeping interactive input on/dev/ttywhile rendering throughprocess.stdout. That change is necessary for the branch goal, but it also changes the effective renderer theme-mode signal in stdin-backed startup paths. As a result, an unspecified theme can resolve to light there even though other startup modes still resolve to graphite.We tested the obvious alternative: reverting the stdout-side plumbing change. That does make the piped patch/pager theme dark again, but it also regresses the mouse-scroll fix that motivated the branch. So reverting the transport change is not a viable fix.
Given that constraint, the pragmatic choice is to stop treating an unspecified theme as an implicit auto-detect mode and instead make the built-in fallback explicit:
graphite.What this changes
graphite.graphiteregardless of renderer-reported light/dark mode.--theme,theme = "paper", etc.).In other words, Hunk no longer treats an omitted theme as an implicit terminal-following mode.
Why this is pragmatic
diff, file-backedpatch, stdin-backedpatch -, andpager.This chooses a stable product fallback over transport-sensitive autodetect behavior.
Tradeoff
This intentionally changes the old behavior where an unspecified or unrecognized theme could fall back through renderer light/dark detection (
paperon light terminals,graphiteon dark terminals). After this change, Hunk always falls back tographiteunless a specific theme is requested via config or CLI.That tradeoff is intentional. If terminal-following theme selection is something we want to preserve as a product feature, the cleaner long-term design is to make that explicit (for example with a future
theme = auto/--theme auto) rather than relying on renderer startup details.Tests
bun test src/core/config.test.ts src/ui/lib/ui-lib.test.tsbun test test/pty/ui-integration.test.ts -t "(stdin patch mode enables mouse wheel scrolling in pager UI|general pager mode enables mouse wheel scrolling for diff-like stdin)"bun run typecheck