Conversation
Move every dotfiles-specific string and setting out of the viz code into an optional repo-root viz.toml: display strings (header name/badge, (?) help bubble, page title), the darwin/nixos platform filter (packages.nix path + optionalAttrs guard map, host list, type rule table, segment labels), the type/legend taxonomy (palette slot order, dir->group map, group order), embed cap, bundle dir, output name, and a repo-URL override. New shared viz-app/config.ts normalizes strictly at build (Bun.TOML.parse; unknown keys and dangling refs fail with their key path) and leniently in the app off the #data blob. Without viz.toml the viewer builds generic: no platform control, alphabetical types with generated colors, flat legend, generic header/about. The sidebar header now identifies the repo (owner/repo + badge) with a hoverable (?) explainer. pages CI also triggers on viz.toml.
Fixes from the adversarial review of the viz.toml PR: - buildModel no longer double-appends the other bucket when group-order already lists it (listing it there now pins the overflow cluster's position instead of crashing Legend's keyed each at mount) - strict validation rejects duplicate taxonomy.types / group-order entries (same each_key_duplicate crash class) - path fields (bundle.dir/out, packages-nix) drop trailing slashes at normalize time, so the bundle-prefix compares in viz.ts and markdown.ts can't silently misclassify in-bundle links - empty-string display.name / repo.url / host-default / packages-nix mean 'unset' (TOML has no null), instead of rendering a blank header - repoNameFromUrl accepts the same URL shapes as githubRemoteUrl (https/ssh, ±.git); non-GitHub URLs fall back to display.name - stale TYPE_ORDER comment updated; markdown.ts's bundleDir default now shares config.ts's DEFAULT_BUNDLE_DIR
The root config's name should say what tool it belongs to; update the loader, error messages, pages CI trigger, and all docs/knowledge references.
7 tasks
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
First step toward other projects consuming the OKF viz for their own bundles: every dotfiles-specific string and setting moves out of the viz code into an optional repo-root
okf-viz.toml, andokf vizbuilds a fully working generic viewer when the file is absent.scripts/okf/viz-app/config.ts—VizConfigschema, generic defaults, andnormalizeVizConfig(): strict at build (Bun's built-in TOML parser, zero new deps; unknown keys / type mismatches / reserved platform names / dangling cross-references fail the build with the offending key path), lenient in the app off the existing#datablob. Accepts kebab- and camelCase keys, so normalization is idempotent (test-enforced).[bundle]dir/out,[display]title/badge/fallback-name/name/about-html (sidebar header + the (?) explainer bubble),[embed]max-bytes,[taxonomy]types/dir-groups/group-order/other,[platform]values/types/hosts/host-default/packages-nix/nix-guards,[repo]url.TYPE_ORDER/GROUP_OF_DIR/GROUP_ORDER/NIXOS_HOSTSare deleted fromdata.ts;markdown.tsloses its hardcodedknowledge/prefix andslice(10, -3)offsets.os=deep links clamp toall), alphabetical types with generated colors, flat legend, generic "OKF bundle" header/about.okf-viz.toml; decision record inknowledge/decisions/viz-config-toml.md.Verification
bundleDirmarkdown case);okf viz --checkclean.okf viz --perfboots the built page to interactive in headless Chrome (~260 ms).okf validate: 0 errors, 0 warnings.