Skip to content

feat: add vesper theme#220

Open
nexxeln wants to merge 3 commits intomodem-dev:mainfrom
nexxeln:nxl/add-vesper-theme
Open

feat: add vesper theme#220
nexxeln wants to merge 3 commits intomodem-dev:mainfrom
nexxeln:nxl/add-vesper-theme

Conversation

@nexxeln
Copy link
Copy Markdown

@nexxeln nexxeln commented May 7, 2026

summary

  • add Vesper as a built-in theme
  • document the new theme option

testing

  • bun run typecheck
  • bun run format:check
  • bun test src/opentui/HunkDiffView.test.tsx src/ui/lib/ui-lib.test.ts src/ui/diff/pierre.test.ts

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 7, 2026

Greptile Summary

This PR adds Vesper as a fifth built-in diff theme, including its own custom Pierre syntax-highlighting definition and a refactor that threads the full AppTheme object through the highlighting pipeline instead of just the appearance string.

  • New Vesper theme (src/ui/themes.ts, src/ui/diff/pierre.ts): defines color tokens, distinct added/removed background pairs, and registers a custom TextMate-scoped syntax theme (hunk-vesper) at module load time via registerCustomTheme.
  • API refactor (useHighlightedDiff.ts, DiffPane.tsx, PierreDiffView.tsx, HunkDiffView.tsx): the highlight cache key, prefetch function, and React hook all now accept AppTheme instead of \"light\" | \"dark\", allowing per-theme syntax palettes without changing the call sites' external contracts.
  • Documentation and tests updated across README.md, docs/opentui-component.md, CHANGELOG.md, and the relevant test files to reflect the new theme name and ordering.

Confidence Score: 5/5

Safe to merge — the change is additive, limited to theme data and the highlighting pipeline, and the refactored API passes stable object references throughout.

The Vesper theme is additive and isolated. The AppTheme-propagation refactor is mechanical and the stable-reference guarantee from the THEMES array ensures no spurious effect re-runs. Tests cover token colors, background distinction, and reserved-color remap isolation for the new theme.

No files require special attention.

Important Files Changed

Filename Overview
src/ui/themes.ts Adds Vesper theme with distinct added/removed background colors; addresses previously flagged identical-background issue.
src/ui/diff/pierre.ts Registers a custom Pierre syntax theme for Vesper at module load time; adds pierreSyntaxThemeName dispatch and refactors loadHighlightedDiff/pierreRenderOptions to accept full AppTheme instead of appearance string.
src/ui/diff/useHighlightedDiff.ts Refactors cache key and all public APIs to accept AppTheme instead of appearance string; cache key now incorporates theme.id for per-theme correctness.
src/ui/components/panes/DiffPane.tsx Updates prefetchHighlightedDiff call and its effect dependency from theme.appearance to theme; no logic changes beyond the API signature update.
src/opentui/HunkDiffView.tsx Propagates the full resolvedTheme object to useHighlightedDiff instead of just appearance; no other changes.
src/opentui/themes.ts Adds vesper to HUNK_DIFF_THEME_NAMES constant and the derived HunkDiffThemeName union type.
src/ui/diff/pierre.test.ts Adds a Vesper-specific syntax token assertion and extends the reserved-color remap test to include vesper.
src/ui/lib/ui-lib.test.ts Updates theme menu order assertion; adds addedBg/removedBg distinction assertions for the Vesper theme.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["Theme prop (string)"] --> B["resolveTheme()"]
    B --> C{id in THEMES?}
    C -- Yes --> D["AppTheme (stable ref from THEMES)"]
    C -- No --> E["graphite fallback"]
    D --> F["pierreSyntaxThemeName(theme)"]
    E --> F
    F --> G{theme.id === 'vesper'?}
    G -- Yes --> H["hunk-vesper (custom Pierre theme)"]
    G -- No --> I["pierre-dark / pierre-light (built-in Pierre theme)"]
    H --> J["renderDiffWithHighlighter()"]
    I --> J
    J --> K["HighlightedDiffCode (cached by theme.id + file fingerprint)"]
Loading

Reviews (2): Last reviewed commit: "fix: use vesper syntax highlighting" | Re-trigger Greptile

Comment thread src/ui/themes.ts Outdated
@nexxeln nexxeln marked this pull request as draft May 7, 2026 08:51
@nexxeln nexxeln marked this pull request as ready for review May 7, 2026 09:20
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.

2 participants