Skip to content

fix(tui): restyle history-search input on live theme change - #3786

Merged
dgageot merged 1 commit into
mainfrom
fix/tui-history-search-theme
Jul 22, 2026
Merged

fix(tui): restyle history-search input on live theme change#3786
dgageot merged 1 commit into
mainfrom
fix/tui-history-search-theme

Conversation

@aheritier

Copy link
Copy Markdown
Collaborator

Summary

Fixes #3784.

The TUI editor did not fully apply live theme changes to its
history-search input. On messages.ThemeChangedMsg the editor
reapplied the current theme to its main textarea but left the internal
searchInput styled with the theme that was active when the editor was
constructed, producing visibly stale styling (e.g. dark-theme gray text
after switching to the light catppuccin-latte theme).

Changes

  • Extract a searchInputStyles() helper that builds the customized
    search-input styles (DialogInputStyle + muted text/placeholder),
    shared by New and the ThemeChangedMsg handler so both stay in
    sync with the active theme.
  • The messages.ThemeChangedMsg handler now reapplies styles to
    searchInput in addition to the main textarea.
  • Add a focused regression test asserting that ThemeChangedMsg
    updates the history-search input's colors (focused/blurred text and
    placeholder) as well as the main textarea. Verified to fail against
    the pre-fix handler and pass with the fix.

Validation

  • task build — passes
  • task test — passes
  • task lint — 0 issues

Downstream context

Found while fixing a WCAG contrast issue in Docker Sandboxes' Gordon
assistant (docker/sandboxes#4528).

The ThemeChangedMsg handler only restyled the main textarea, leaving the
history-search input with the styles captured at construction time. It
now reapplies the shared searchInputStyles() to searchInput as well, so
both inputs follow the active theme after a live theme switch.

Fixes #3784
@aheritier
aheritier requested a review from a team as a code owner July 22, 2026 12:07
@aheritier aheritier added area/tui For features/issues/fixes related to the TUI kind/fix PR fixes a bug (maps to fix:). Use on PRs only. labels Jul 22, 2026
@dgageot
dgageot merged commit 63c1981 into main Jul 22, 2026
14 checks passed
@dgageot
dgageot deleted the fix/tui-history-search-theme branch July 22, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tui For features/issues/fixes related to the TUI kind/fix PR fixes a bug (maps to fix:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TUI editor history search retains stale styles after a live theme change

3 participants