feat: Visual Theming Engine + Expanded Preset Library#36
Open
feat: Visual Theming Engine + Expanded Preset Library#36
Conversation
Single command to go from zero to running dashboard. Uses @clack/prompts for a 5-step interactive wizard (name, preset, map, AI, create) and supports --non-interactive --format json for agent use. Closes #28 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…eck, test assertions - Validate config with MonitorForgeConfigSchema.parse() before writing (matches updateConfig pattern) - Skip interactive overwrite prompt during --dry-run - Reject invalid --projection values in non-interactive mode - Assert config content in interactive wizard test - Add test for invalid projection rejection Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…env permissions - Wrap preset JSON.parse() in try-catch at 3 locations (loadPresets, buildAndWrite, interactive wizard) so a single corrupted preset file doesn't crash the entire setup command - Add NaN and coordinate range validation for non-interactive --center (longitude -180..180, latitude -90..90) with clear error messages - Set chmod 0600 on .env.local after writing to protect API keys - Switch vi.clearAllMocks() → vi.resetAllMocks() to prevent mock leakage - Add 6 new tests: invalid center (NaN, out-of-range, single value), dry-run with existing config, malformed preset JSON, chmod verification - Strengthen interactive happy-path assertions (slug, sources, panels, dayNightOverlay) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a complete visual theming system and expand the preset library from 7 to 15 presets across 7 domains. Each preset now ships with a distinctive palette, branding colors, and map layers with GeoJSON data — transforming the out-of-box experience from "generic dark dashboard" to domain-specific intelligence views. Theming engine (#30): - ThemeSchema with mode (dark/light/auto), 7 palette presets, custom accent colors, panel position, width, and compact mode - `forge theme set` and `forge theme status` CLI commands - Runtime CSS variable injection in App.ts with OS theme listener - Light mode, auto mode, compact mode, and left-panel CSS layouts - Build-time theme resolution via theme-resolved.ts manifest Expanded presets (#29): - 8 new presets: cyber, climate, korea, health (minimal + full tiers) - 7 domain-specific GeoJSON files with 87 total data points - Map layers added to all 7 full-tier presets - _meta blocks on all 15 presets (category, difficulty, API keys) - `preset list` now shows category and difficulty metadata - Domain-specific branding colors and palette assignments Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
forge theme set/statusCLI, runtime CSS variable injection, and layout options (panel position, compact mode)_metametadata on all 15 presetsTogether:
forge preset apply cyber-fullnow gives a cyberpunk-themed threat intelligence dashboard with map data — not a generic dark page.Closes #29, Closes #30
Key Changes
Theming (
forge/src/theme/,forge/src/commands/theme.ts)ThemeSchemaadded to config — mode, palette, custom colors, panelPosition, panelWidth, compactModepalettes.tsresolver.tsmerges palette + custom colors + branding fallbacktheme-resolved.tsadded as 5th build manifestApp.tsinjects CSS variables at runtime, listens for OS theme changes in auto modebase.cssextended with light mode, auto mode, compact mode, left-panel layoutPresets (
presets/,data/geo/)_metablocks (category, difficulty, required/optional API keys)preset listnow shows category and difficulty columnsTest plan
npx tsc --noEmit— typecheck cleannpx vitest run— 650 tests pass (34 test files)_metavalidation)forge theme set --palette ocean && forge dev— visual verificationforge preset apply cyber-full && forge validate && forge dev— end-to-end🤖 Generated with Claude Code