feat(ui): add config-generator YAML preview serializer with copy panel - #4717
Conversation
Closes JSONbored#2210 Adds formStateToYaml(state), a pure GeneratorFormState -> .gittensory.yml text serializer in src/lib/, plus a read-only ConfigGeneratorYamlPreview using the CodeBlock primitive's built-in copy button. Key names/nesting match the real manifest schema (gate.aiReview), and unset fields are omitted so partial/empty state always serializes to valid YAML. Scoped to the serializer + preview slice only (per JSONbored#2210); it does not touch the field-group panel/route/nav wiring being built separately in the still-open PR for JSONbored#2208, to avoid overlapping that work.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-10 18:56:00 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
formStateToYaml(state), a pureGeneratorFormState -> .gittensory.ymltext serializer inapps/gittensory-ui/src/lib/config-generator-yaml.ts— the reviewable-output half of the config generator (feat(dashboard): design self-host review config generator #1683).gate.aiReview.{combine, provider, model}) match the real manifest schema (packages/gittensory-engine/src/focus-manifest.ts'sgateConfigToJson, the same shape already documented in this repo's own root.gittensory.ymlunder the commented-outaiReview:example) — no parallel schema.ConfigGeneratorYamlPreview, a read-only presentational component that renders the serialized YAML via the existingCodeBlockprimitive (primitives.tsx:194), which already has a built-in copy-to-clipboard button — no changes needed toCodeBlockitself.config-generator-panel.tsx,app.config-generator.tsx,app-shell.tsx, orcommand-palette.tsx— those are being built in the still-open PR feat(ui): config-generator AI provider mode field group (#2208) #4713 for sibling issue feat(ui): config-generator AI-provider-mode field group #2208, which defines the canonicalGeneratorFormState/AiCombineStrategy/AiProvidertypes (apps/gittensory-ui/src/lib/config-generator-form-state.ts, not yet merged). I mirrored those exact type/field names locally so this PR is structurally compatible and low-conflict-risk regardless of merge order; once feat(ui): config-generator AI provider mode field group (#2208) #4713 lands, wiring<ConfigGeneratorYamlPreview>intoConfigGeneratorPanelis a one-line follow-up.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally (apps/**is Codecov-ignored — UI-only change, no patch-coverage obligation — but shipped 11 new tests anyway: full/partial/empty config, null-vs-unset, empty-string-vs-unset, and YAML-special-character/whitespace quoting for the serializer, plus rendering + empty-state tests for the preview component)npm run test:workersnpm run build:mcpnpm run ui:openapi:checknpm run ui:openapi:settings-paritynpm run ui:version-auditnpm run docs:drift-checknpm run manifest:drift-checknpm run command-reference:checknpm run db:migrations:checknpm run db:schema-drift:checknpm run ui:lintnpm run ui:typechecknpm run ui:test(133/133 passed across both UI workspaces)npm run ui:buildnpm audit --audit-level=moderate(0 vulnerabilities)If any required check was skipped, explain why:
npm run test:mcp-packandnpm run cf-typegen:checkfail locally only due to a pre-existing Windows dev-machinespawnSyncbare-command resolution gap (ENOENTfornpm/wranglerwithoutshell: true), reproduced in isolation and unrelated to this diff — nopackages/gittensory-mcporwrangler.jsonc/Cloudflare-binding changes here.npm run engine-parity:drift-checkfails locally only because it falls back to my local (stale) forkorigin/mainref absentGITHUB_BASE_SHA, which real CI sets. Nosrc/signals/**/packages/gittensory-engine/**files are touched by this PR.Safety
formStateprop (no fetch, no fallback data); the empty-state case is a real, tested branch (header-only output), not a demo placeholder.UI Evidencesection below with JPG/JPEG or PNG screenshots.UI Evidence
gate.aiReview)combine/provider/model all set
fresh/unset form state — header-only, still valid YAML
Notes
formStatein, JSX out) so it can be dropped intoConfigGeneratorPanelonce feat(ui): config-generator AI provider mode field group (#2208) #4713 merges without any API changes on this side.