Skip to content

feat(ui): show selected theme in footer#396

Merged
benvinegar merged 1 commit into
mainfrom
feat/theme-footer-notice
Jun 5, 2026
Merged

feat(ui): show selected theme in footer#396
benvinegar merged 1 commit into
mainfrom
feat/theme-footer-notice

Conversation

@benvinegar

Copy link
Copy Markdown
Member

Summary

  • Show the selected theme label in the footer status bar when themes change
  • Route keyboard cycling and Theme menu selection through the same status-notice path
  • Add interaction coverage for cycling themes with t

Tests

  • bun test src/ui/AppHost.interactions.test.tsx --timeout 20000
  • bun run typecheck

This PR description was generated by Pi using OpenAI GPT-5

@greptile-apps

greptile-apps Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR routes all theme-switching (both keyboard cycling with t and Theme menu selection) through a new selectTheme callback that calls setThemeId and showTransientNotice together, surfacing the chosen theme label in the footer status bar.

  • selectTheme is a useCallback with correct dependencies (showTransientNotice, themeOptions); cycleTheme and buildAppMenus are updated to use it instead of calling setThemeId directly, with the menus useMemo dependency array updated accordingly.
  • A new interaction test verifies the footer shows "Theme: Paper" and "Theme: Ember" after successive t keypresses; the expected names are implicitly tied to the THEMES array order and createTestVcsAppBootstrap's initialTheme: \"midnight\" default.

Confidence Score: 4/5

Safe to merge; the logic change is small and correctly unified through a single callback.

The implementation is clean and the dependency arrays are correctly updated. The only rough edge is the new test hardcoding "Paper" and "Ember" against an implicit dependency on THEMES ordering and the test-helper default theme, which could cause silent failures if either changes.

src/ui/AppHost.interactions.test.tsx — the hardcoded theme name expectations are fragile.

Important Files Changed

Filename Overview
src/ui/App.tsx Introduces selectTheme useCallback that calls setThemeId and showTransientNotice; correctly wires cycleTheme and buildAppMenus through it; dependency arrays updated appropriately.
src/ui/AppHost.interactions.test.tsx Adds theme-cycling interaction test; correct flow but expected theme names ("Paper", "Ember") are implicitly coupled to THEMES ordering and the default initial theme in createTestVcsAppBootstrap.
CHANGELOG.md One-line addition documenting the new footer theme notice under the Unreleased "Added" section.

Sequence Diagram

sequenceDiagram
    participant User
    participant cycleTheme
    participant ThemeMenu
    participant selectTheme
    participant setThemeId
    participant showTransientNotice

    User->>cycleTheme: press "t"
    cycleTheme->>selectTheme: selectTheme(nextThemeId)
    selectTheme->>setThemeId: setThemeId(nextThemeId)
    selectTheme->>showTransientNotice: showTransientNotice("Theme: Paper")

    User->>ThemeMenu: select theme
    ThemeMenu->>selectTheme: selectTheme(theme.id)
    selectTheme->>setThemeId: setThemeId(theme.id)
    selectTheme->>showTransientNotice: showTransientNotice("Theme: Ember")
Loading
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
src/ui/AppHost.interactions.test.tsx:700-707
**Hardcoded theme names couple test to THEMES ordering**

`"Paper"` and `"Ember"` are correct today because `createTestVcsAppBootstrap` defaults to `initialTheme: "midnight"` (index 1 in `THEMES`), so one `t` press lands on index 2 ("Paper") and a second on index 3 ("Ember"). If the default initial theme or the order of entries in `THEMES` ever changes, these expectations will silently fail or erroneously pass. Consider deriving the expected labels from `themeOptions` at test-setup time rather than embedding literal strings.

Reviews (1): Last reviewed commit: "feat(ui): show selected theme in footer" | Re-trigger Greptile

Comment on lines +700 to +707
let frame = await waitForFrame(setup, (nextFrame) => nextFrame.includes("Theme: Paper"));
expect(frame).toContain("Theme: Paper");

await act(async () => {
await setup.mockInput.typeText("t");
});
frame = await waitForFrame(setup, (nextFrame) => nextFrame.includes("Theme: Ember"));
expect(frame).toContain("Theme: Ember");

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.

P2 Hardcoded theme names couple test to THEMES ordering

"Paper" and "Ember" are correct today because createTestVcsAppBootstrap defaults to initialTheme: "midnight" (index 1 in THEMES), so one t press lands on index 2 ("Paper") and a second on index 3 ("Ember"). If the default initial theme or the order of entries in THEMES ever changes, these expectations will silently fail or erroneously pass. Consider deriving the expected labels from themeOptions at test-setup time rather than embedding literal strings.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/ui/AppHost.interactions.test.tsx
Line: 700-707

Comment:
**Hardcoded theme names couple test to THEMES ordering**

`"Paper"` and `"Ember"` are correct today because `createTestVcsAppBootstrap` defaults to `initialTheme: "midnight"` (index 1 in `THEMES`), so one `t` press lands on index 2 ("Paper") and a second on index 3 ("Ember"). If the default initial theme or the order of entries in `THEMES` ever changes, these expectations will silently fail or erroneously pass. Consider deriving the expected labels from `themeOptions` at test-setup time rather than embedding literal strings.

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@benvinegar benvinegar merged commit 34cfc48 into main Jun 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant