Repository navigation
Align theme with primer colors - #589
Merged
Merged
Conversation
Name the role rather than the hue, ahead of the accent moving to GitHub blue: Config.ColorCyan becomes ColorAccent and theme.Cyan becomes theme.Accent. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Switch the teal accent to Primer Brand blue and move the PR-state colors to Brand steps that keep AA contrast on GitHub's canvases. Primary actions use the Brand green button fill, and every color now lives in internal/theme, guarded by a contrast test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
view, modify, and submit set the terminal background and text to GitHub's canvas while on the alternate screen, like the Copilot CLI. Colors are reset on every exit path and around $EDITOR, then checked and restored after the program. GH_STACK_BACKGROUND=terminal opts out. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Recolor the submit preview's markdown to the palette (ink headings, accent links, neutral code chips) and highlight code blocks with GitHub's own light and dark syntax themes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The header logo was white-only and disappeared on the light canvas. Embed the dark GitHub mark and pick the variant from the background. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Describe the GitHub palette and canvas, the new GH_STACK_BACKGROUND option, and how terminal colors are restored. Add contributor notes on keeping colors in internal/theme and running TUIs through runFullScreenTUI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Terminal-wide color restoration is emulator-dependent, and unresolved restoration and contrast issues require fixes and human validation.
4 open issues
What changed in this PR
Aligns gh-stack’s command output and terminal interfaces with GitHub’s Primer Brand palette, adding GitHub backgrounds to full-screen screens.
Changes:
- Centralize palette roles, status badges, and primary-action colors.
- Add full-screen canvas painting, color restoration, and a background opt-out.
- Refresh Markdown previews and logos, with supporting tests and documentation.
| File | Description |
|---|---|
README.md |
Document canvas behavior, theme controls, and recovery. |
internal/tui/submitview/styles.go |
Apply shared badges and primary-action colors. |
internal/tui/submitview/styles_test.go |
Check badge and primary-action rendering. |
internal/tui/submitview/screen.go |
Update accent-color terminology in comments. |
internal/tui/submitview/preview.go |
Theme Markdown previews and preserve editor terminal output. |
internal/tui/submitview/preview_test.go |
Cover preview colors, highlighting, and editor setup. |
internal/tui/submitview/editor.go |
Update toggle and focus-style comments. |
internal/tui/shared/theme.go |
Expose shared palette and badge aliases. |
internal/tui/shared/render.go |
Update current-branch styling terminology in comments. |
internal/tui/shared/logo.go |
Choose the logo variant for the detected background. |
internal/tui/shared/header.go |
Update the default icon-color comment. |
internal/tui/shared/header_test.go |
Verify background-aware logo selection. |
internal/tui/mergeview/view.go |
Apply primary and inverse stepper colors. |
internal/tui/mergeview/model_test.go |
Check stepper color roles. |
internal/tui/checkoutview/styles.go |
Use centralized dim status colors. |
internal/theme/theme.go |
Define Primer Brand colors, fills, and badges. |
internal/theme/theme_test.go |
Add palette contrast checks. |
internal/theme/canvas.go |
Implement canvas painting and terminal-color restoration. |
internal/theme/canvas_test.go |
Cover canvas transitions and restoration behavior. |
internal/modify/preconditions.go |
Use accent highlighting in guidance. |
internal/modify/apply.go |
Use accent highlighting in recovery instructions. |
internal/config/testing.go |
Rename the test color hook to accent. |
internal/config/config.go |
Wire accent coloring into configuration and messages. |
internal/config/color_test.go |
Update accent-color coverage. |
docs/src/content/docs/reference/cli.md |
Document canvas and palette environment variables. |
cmd/worktree_utils.go |
Use accent highlighting for navigation guidance. |
cmd/view.go |
Route full-screen viewing through the canvas wrapper. |
cmd/utils.go |
Add shared full-screen canvas integration. |
cmd/utils_test.go |
Cover canvas eligibility and opt-out behavior. |
cmd/unstack.go |
Use accent highlighting for flag guidance. |
cmd/sync.go |
Use accent highlighting for follow-up commands. |
cmd/submit.go |
Use the canvas wrapper and accent highlighting. |
cmd/rebase.go |
Use accent highlighting in conflict instructions. |
cmd/rebase_worktree.go |
Use accent highlighting for push guidance. |
cmd/push.go |
Use accent highlighting for follow-up commands. |
cmd/modify.go |
Use the canvas wrapper and accent highlighting. |
cmd/merge.go |
Use accent highlighting in merge guidance. |
cmd/init.go |
Use accent highlighting in setup guidance. |
cmd/checkout.go |
Use accent highlighting in checkout guidance. |
cmd/alias.go |
Use accent highlighting in alias messages. |
cmd/add.go |
Use accent highlighting in branch guidance. |
AGENTS.md |
Document palette ownership and canvas lifecycle conventions. |
.github/copilot-instructions.md |
Add theme and full-screen integration guidance. |
Review effort: Max
Probe each terminal color before Bubble Tea owns input and apply the resulting plan at every alternate-screen exit: a reset when it brings the color back, so theme changes made while a screen is open still apply, or an explicit set for runtime-set colors and terminals that ignore resets, which now also covers $EDITOR. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ktravers
approved these changes
Oct 26, 2026
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.

Aligns gh-stack's look with GitHub's brand and the GitHub Copilot CLI: colors now come from Primer Brand, and the full-screen
view,modify, andsubmitscreens paint GitHub's dark or light canvas behind themselves.Functionality and user impact
view,modify, andsubmitset the terminal to GitHub's canvas while they're open, like the Copilot CLI:#0d1117with#f0f6fctext on dark terminals,#ffffffwith#1f2328on light ones. Painting needs a truecolor terminal.NO_COLOR, non-terminal output, and the newGH_STACK_BACKGROUND=terminalkeep the terminal's own colors, and intmuxonly the current pane is painted.GH_STACK_THEMEalso picks the canvas.$EDITORis open fromsubmit. gh-stack also records the terminal's colors before painting and restores any the reset misses, such as colors set at runtime by pywal or base16-shell, or terminals that ignore the reset. Terminals that follow automatic light/dark switching keep following it.checkoutandmergescreens use the new colors but never paint the background.submitdescription preview uses the palette and GitHub's syntax highlighting, and the header logo switches to the dark Invertocat on light backgrounds.Before images use a typical terminal theme. After images of the full-screen screens show the GitHub canvas.
gh stack view, dark terminalgh stack view, light terminalgh stack submit, dark terminalgh stack submit, light terminalgh stack modify, dark terminalgh stack merge, dark terminalgh stack checkout, dark terminalKey areas to review
CanvasOutputpaints right after the alternate screen is entered and restores colors right before it's left, which covers exits, signals, panics, andtea.ExecProcess(including$EDITOR) without hooks in the models.planRestoreprobes the terminal before painting and plans each color's restore: a reset when that brings the color back, so theme changes made while a screen is open still apply, and otherwise an explicit set.canvasSupporteddecides when to paint.runFullScreenTUIandfullScreenCanvas, now used byview,modify, andsubmit.editorCommandpins$EDITOR's stdout to the terminal, becausetea.ExecProcesswould otherwise hand it the canvas wrapper.markdownStylerecolors the preview.Testing
Build,
go vet ./...(also withGOOS=windows), and the full race-enabled suite (go run ./scripts/test -workers 4) pass. The built binary was also run in a PTY against a terminal emulator that tracks color state: colors came back afterq, Ctrl+C, Esc, and SIGTERM on dark, light, pywal-style,tmux, and reset-ignoring terminals, and the opt-out and plain output never painted. Manually tested in real terminals, and design review is complete.