Skip to content

fix(tui): follow the terminal background - #98

Merged
NovusEdge merged 1 commit into
mainfrom
fix/tui-adaptive-palette
Sep 6, 2026
Merged

fix(tui): follow the terminal background#98
NovusEdge merged 1 commit into
mainfrom
fix/tui-adaptive-palette

Conversation

@NovusEdge

Copy link
Copy Markdown
Owner

The main TUI drew the dark palette on every terminal. Against #F7F7F7 the six colours measured between 2.04:1 and 4.01:1, all below WCAG AA. #95 added theme.For and switched the installer; this switches the other consumer.

Init now batches tea.RequestBackgroundColor alongside loadVMs, and Update calls applyPalette(msg.IsDark()) when the answer arrives. A terminal that never answers keeps the dark set, which is what the unsuffixed constants in internal/theme are.

The styles stay package-level values. About 150 call sites read them by name, one program draws with them at a time, and the package has no parallel tests. applyPalette rebuilds all of them, including the pane border.

Tests

TestApplyPaletteFollowsTheBackground checks the colours, the derived styles and the pane border in both directions. TestBackgroundColorMsgSwitchesThePalette drives the real Update path; removing the applyPalette call makes it fail with accent at {201 138 91 255}, want {122 62 18 255}.

go build, go vet, go test ./... and gofmt -l . are clean.

The main TUI drew the dark palette on every terminal. Against #F7F7F7 the
six colours measured between 2.04:1 and 4.01:1, all below WCAG AA. #95 added
theme.For for the installer and left this UI on the fixed set.

Init now requests the background colour and Update applies the matching
palette. A terminal that never answers keeps the dark set.

The styles stay package-level values: about 150 call sites read them by name,
and one program draws with them at a time.

Signed-off-by: NovusEdge <novusedge0@gmail.com>
@NovusEdge NovusEdge added the bug Something isn't working label Sep 6, 2026
@NovusEdge NovusEdge self-assigned this Sep 6, 2026
@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 47 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 13236c5a-7b9a-48a7-8d72-637bb80529c4

📥 Commits

Reviewing files that changed from the base of the PR and between 40d9b2d and a1ead23.

📒 Files selected for processing (3)
  • internal/tui/app.go
  • internal/tui/theme.go
  • internal/tui/theme_test.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@NovusEdge
NovusEdge merged commit 60460a8 into main Sep 6, 2026
6 checks passed
@NovusEdge
NovusEdge deleted the fix/tui-adaptive-palette branch September 6, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant