feat(visualize): add theme layer with cascade and bland built-in themes - #359
Merged
Merged
Conversation
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.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.
Diagram styling was a near-stub Theme threaded through the emitter but never rendered, and cascade graph --theme accepted only default.
This fleshes out Theme into a separable type holding a Mermaid base, a line color, and per-NodeKind styles. It ships two built-in palettes: cascade (branded, the new default) and bland (grayscale). The emitter renders the theme into a leading init directive plus classDef and class lines in both the flowchart and stateDiagram paths, so a theme swap restyles only the header block and the view model stays render-agnostic. The flag --theme cascade|bland| is wired through; a path loads and validates a JSON theme file with a clear error on a missing or malformed file, and default aliases cascade.
Verification: golden tests for both built-ins (valid Mermaid, outputs differ, per-theme determinism), a user-supplied-theme load-and-apply test, and error paths for missing and malformed files. The existing jobs, stages, and env goldens are regenerated to reflect the now-styled default; the regeneration is additive (the diagram structure is unchanged, only the init directive and classDef lines are added). Full suite, vet, and golangci-lint green. No schema or generator-output change.
Closes #304.