Skip to content

Frontend P2-1b: YAML/TOML config-debug views #425

@tvna

Description

@tvna

Summary

P2-1b: add YAML and TOML views to the config-debug panel (P2-1 added JSON only). A ConfigDebug component re-serializes the parsed config (the existing configDebug JSON string from the worker) into JSON / YAML / TOML via a format toggle. UI-only; no worker change.

Part of epic #395. Plan: docs/superpowers/plans/2026-06-12-frontend-p2-parity.md (P2-1b).

Scope

  • web/src/components/ConfigDebug.tsx: a JSON/YAML/TOML sub-toggle; JSON shows the configDebug string as-is, YAML/TOML do JSON.parse(configDebug) then js-yaml.dump / smol-toml.stringify. A try/catch shows a loud message if serialization fails (e.g. a CSV with unfilled NaN, which is not strict JSON / not representable in TOML -- an uncommon edge case since enableFillNan defaults to true).
  • web/src/components/Preview.tsx: revert the config mode (back to "text" | "markdown"); config display moves to ConfigDebug.
  • web/src/App.tsx: in config preview mode, render <ConfigDebug json={result?.configDebug ?? ""} /> instead of <Preview>.
  • New deps: js-yaml + @types/js-yaml, smol-toml.

Acceptance

  • bash scripts/ci-parity.sh green (whole-project vitest incl. a ConfigDebug test: JSON shows the string; YAML/TOML toggles render the re-serialized forms for a simple {"a":1} config; a non-parseable input shows the error, not a crash).
  • npm run build emits dist/. Completes P2.

Refs #395.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions