Skip to content

Fix light theme composers - #343

Merged
robzolkos merged 2 commits into
mainfrom
fix-light-mode-composers
Aug 27, 2026
Merged

Fix light theme composers#343
robzolkos merged 2 commits into
mainfrom
fix-light-mode-composers

Conversation

@jzimdars

Copy link
Copy Markdown
Member

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.

…(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.
Copilot AI balanced review requested due to automatic review settings August 26, 2026 20:50
@jzimdars
jzimdars requested a review from a team as a code owner August 26, 2026 20:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@robzolkos
robzolkos merged commit d669764 into main Aug 27, 2026
24 checks passed
@robzolkos
robzolkos deleted the fix-light-mode-composers branch August 27, 2026 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TUI text area unreadable with light terminal theme

3 participants