Skip to content

Surface theme drop-in parse errors as startup notices - #111

Merged
github-actions[bot] merged 1 commit into
mainfrom
theme/file-based-registry
Aug 1, 2026
Merged

Surface theme drop-in parse errors as startup notices#111
github-actions[bot] merged 1 commit into
mainfrom
theme/file-based-registry

Conversation

@mohitranka

Copy link
Copy Markdown
Contributor

Summary

  • A malformed drop-in theme file under .forge/themes/*.toml (e.g. a truncated hex color) was silently dropped by ThemeRegistry::load with zero indication why — the theme just vanished from the picker.
  • ThemeRegistry::load now delegates to a new load_with_diagnostics, which collects a human-readable message for each drop-in file that fails to parse.
  • TuiApp::new threads those messages into the existing startup-notices banner, so a bad theme.toml is now reported instead of silently skipped.

Test plan

  • cargo test -p forge-tui (670 passed, including new invalid_drop_in_is_skipped_but_reported regression test)
  • cargo clippy -p forge-tui --all-targets
  • cargo fmt -p forge-tui -- --check

A malformed .forge/themes/*.toml (e.g. a truncated hex color) was
silently dropped by ThemeRegistry, so a custom theme could vanish from
the picker with no indication why. load_with_diagnostics now collects
a message per file that fails to parse, and TuiApp::new surfaces them
through the existing startup-notices banner.
@mohitranka
mohitranka force-pushed the theme/file-based-registry branch from e071eb6 to 3a58bff Compare August 1, 2026 10:18
@github-actions
github-actions Bot enabled auto-merge (squash) August 1, 2026 10:18
@github-actions
github-actions Bot merged commit 5ce24bb into main Aug 1, 2026
6 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