Fix light theme composers - #343
Merged
Merged
Conversation
…(macOS) - New internal/tui/inputs.go with two helpers, newTextArea() and newTextInput(). Each builds the bubbles widget and then calls SetStyles(DefaultStyles(themeDark)), so the field takes the light or the dark palette from the theme instead of bubbles' hardcoded dark one. The comment explains the slot-0 / slot-7 cause and why Omarchy hides it. - applyTheme in styles.go now records themeDark = theme.Dark, so the helpers follow the same theme every other color follows. - All 17 construction sites in 14 files now call the helpers. No direct textarea.New() or textinput.New() remains in the package. - New inputs_test.go: TestTextFieldsFollowTheThemeMode flips theme.Dark and asserts the textarea's cursor line and the textinput's blurred text take bubbles' light default on a light theme, the dark default on a dark theme, and differ between the two. It is the counterpart of TestCoversDoNotDependOnTheThemeMode.
- inputs.go now builds textarea.Styles and textinput.Styles that name no color. Text uses the terminal's default foreground. Placeholders, line numbers, end-of-buffer marks, and blurred text use styleMuted (the SGR faint attribute, the same as every other secondary text in the TUI). A selection uses reverse video. The focused cursor line has no background at all — the cursor marks the line, and the band was the defect. The cursor keeps bubbles' block shape and blink, with no color, so the terminal's own cursor color applies. - The themeDark variable is gone, and applyTheme no longer records the mode. Nothing here depends on Theme.Dark anymore. - The theme flip needs no re-apply: a switch retints the sixteen slots over OSC 4, and these styles use only default foreground and attributes, so open fields follow along like the rest of the screen. - The test is inverted to match: TestTextFieldsDoNotDependOnTheThemeMode renders a focused textarea and textinput under a dark theme and a light theme and requires byte-identical output. It also asserts the cursor line carries no background and no \x1b[40m band. This is the same guard the covers have.
Contributor
There was a problem hiding this comment.
Pull request overview
Centralizes TUI text-field construction with terminal-theme-neutral styles, fixing unreadable composers on light themes.
Changes:
- Added colorless textarea/text-input factories.
- Migrated all 17 TUI field constructors.
- Added theme-independence regression coverage.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
internal/tui/inputs.go |
Defines shared colorless field styles and constructors. |
internal/tui/inputs_test.go |
Tests light/dark output consistency. |
internal/tui/compose.go |
Migrates message composer fields. |
internal/tui/bulk_reply.go |
Migrates bulk-reply textarea. |
internal/tui/contact_form.go |
Migrates contact and note fields. |
internal/tui/datetime.go |
Migrates date/time inputs. |
internal/tui/event_form.go |
Migrates event and notes fields. |
internal/tui/folders.go |
Migrates folder filter input. |
internal/tui/habit_form.go |
Migrates habit name input. |
internal/tui/journal.go |
Migrates journal prompt input. |
internal/tui/journal_form.go |
Migrates journal textarea. |
internal/tui/search.go |
Migrates mail search input. |
internal/tui/snippets.go |
Migrates snippet filter input. |
internal/tui/time_track.go |
Migrates category input. |
internal/tui/time_track_form.go |
Migrates time-track fields. |
internal/tui/todos.go |
Migrates todo input. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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 #331.
Text fields in the TUI took bubbles' default styles, which hardcode a dark palette: the focused cursor line on ANSI slot 0 and blurred text on slot 7. On a stock light terminal that is a black band over grey text. Omarchy hides it by remapping those slots to the theme's paper and ink.
All 17 textarea.New()/textinput.New() sites now go through newTextArea()/newTextInput() in internal/tui/inputs.go, which hand the widgets styles that name no color: default foreground for text, the faint attribute for secondary text, reverse video for a selection, no cursor-line background. Like the rest of styles.go, this leaves color to the terminal, so a theme switch retints open fields over OSC 4 with nothing to re-apply. TestTextFieldsDoNotDependOnTheThemeMode renders both fields under a light and a dark theme and requires identical output.