fix(config): allow Catppuccin custom theme bases#365
Conversation
102d060 to
2a98e47
Compare
Greptile SummaryThis PR extends
Confidence Score: 4/5The change is minimal and surgical — a two-element addition to a constant array — with the Catppuccin themes already fully implemented in the rendering layer, so there is no risk of a broken lookup at runtime. The config fix correctly connects the validation layer to themes that already exist in the UI. The only gap is that the new test only exercises src/core/config.test.ts — missing a Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["config.toml\n[custom_theme]\nbase = 'catppuccin-mocha'"] --> B["normalizeCustomThemeBase(value)"]
B --> C{value in\nBUILT_IN_THEME_IDS?}
C -- "yes (now includes catppuccin-latte / catppuccin-mocha)" --> D["return value"]
C -- no --> E["throw Error(…)"]
D --> F["CustomThemeConfig\n{ base: 'catppuccin-mocha' }"]
F --> G["buildCustomTheme()"]
G --> H["builtInThemeById('catppuccin-mocha')\n→ CATPPUCCIN_MOCHA_THEME"]
H --> I["Merged AppTheme\n(id: 'custom')"]
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
src/core/config.test.ts:147-161
The new acceptance test only exercises `catppuccin-mocha`. Since both `catppuccin-latte` and `catppuccin-mocha` were blocked by the same validation and are now allowed, covering `catppuccin-latte` as well would ensure both IDs were wired up correctly end-to-end.
```suggestion
test.each(["catppuccin-mocha", "catppuccin-latte"])(
"accepts %s as a custom theme base",
(themeBase) => {
const home = createTempDir("hunk-config-home-");
mkdirSync(join(home, ".config", "hunk"), { recursive: true });
writeFileSync(
join(home, ".config", "hunk", "config.toml"),
["[custom_theme]", `base = "${themeBase}"`].join("\n"),
);
const resolved = resolveConfiguredCliInput(createPatchPagerInput(), {
cwd: createTempDir("hunk-config-cwd-"),
env: { HOME: home },
});
expect(resolved.customTheme).toEqual({ base: themeBase });
},
);
```
Reviews (1): Last reviewed commit: "fix(config): allow Catppuccin custom the..." | Re-trigger Greptile |
Summary
custom_theme.baseto usecatppuccin-latteandcatppuccin-mochaCloses #364.
Test plan
bun test src/core/config.test.tsbun run typecheckbun run format:checkbun run lint