Skip to content

UI Design Prototypes (Pending Review) ​

Two static HTML prototypes, design only, not wired to any code. Implementation starts only after this pending review passes.

UI copy decision (2026-10-18, decided under the user's 2026-10-14 delegation): prototype UI copy stays Chinese — the interactive HTML and the PNG screenshots form one consistent artifact (the PNGs are design assets and will not be re-rendered in English); bilingual coverage lives at the documentation layer (this page, mirrored in /zh/design-prototypes.md, and the English design document design.md, mirrored in /zh/design.md). To overturn this, edit this section and reopen todo.md D4.

Sources live in docs/design/ (this directory is committed with the repo; open it in a browser directly and they are interactive):

  • docs/design/init-wizard.html — the interactive cage init question flow
  • docs/design/validation-result.html — configuration validation result visualization

I. The cage init question flow ​

Nine terminal questions. Each step accepts b to go back to the previous question, leaving the answer blank takes the bracketed default; once everything is a flag it runs non-interactively in CI.

cage init interactive question prototype (step 4 · environment set)

Interaction contract ​

  • Each question takes a single line of input, Enter confirms, b goes back, blank takes the default.
  • Multi-select (target generators) uses comma separation; both numbering and values work.
  • An unrecognized value lists the allowed values and re-asks — no silent fallback.
  • Before generating, print the pending-artifact list and require confirmation.
  • When a project already exists in the same directory, refuse to overwrite and exit 1 (never overwrite user data).

The order matches the current 9 questions in crates/cage-cli/src/init.rs: project directory → project name → configuration source type → environment set → target generators → template style → git init → include sample tables → confirm.

II. Configuration validation result visualization ​

Three views: error list (error code + location + suggestion), structure tree (schema and field constraints), environment differences (a convergence heatmap of the four env_overrides sets).

Validation result · error list

Validation result · structure tree

Validation result · environment differences

Interaction contract ​

  • The error list supports filtering by table/level; clicking a location jumps to the matching line in the source file.
  • One-click copy of the diagnostics JSON (isomorphic to what cage mcp check_schema returns, so it can be fed straight to an AI).
  • The structure tree shows the real hierarchy of the schema and its fields, their types, constraints and profile visibility.
  • Environment differences render the field-level constraint convergence of the four env_overrides sets as a heatmap (the closer to prod, the tighter).
  • Read-only by default: diagnostics and fix suggestions are kept separate, data is not edited here.

The diagnostic data comes from real cage check output: E1201 (value below minimum), E1101 (type mismatch), Shop.discount max across the four environments 0.9 → 0.7 → 0.6 → 0.5, assert: min_level <= max_level (L6) and hp <= attack (L7).

III. Open decisions ​

Decided 2026-10-30 (under the user's 2026-10-14 delegation, see docs/review/2026-10-30-decisions.md §1; user may overturn):

  1. Web UI form — confirmed: extend the existing cage web /status/. Already delivered in practice by the 2026-10-20 planner rule interface (data table view + diagnostic filtering + point highlight + upload-replace + one-click validate).
  2. Cross-table reference linkage — deferred. The shipped web UI has no structure tree view; the planner's core need (jump to the offending row/column) is already covered by diagnostic point highlight, and schema structure browsing belongs to the editor page. Reopen on real demand.
  3. Environment heatmap collapse — deferred. No heatmap view exists; environment differences are already visible via the per-profile/env build cards and the diff section. Reopen on real demand.

The original questions, kept for the record:

  1. Do we build a Web UI form (extending /status/ of the existing cage web), or keep CLI + MCP as a dual front end and let Web only do the schema editor?
  2. Does the structure tree need cross-table reference highlight linkage (click Ref(Item.id) to jump to the Item table)?
  3. Does the environment difference heatmap need a "collapse adjacent environments with identical values" affordance (as when staging/prod agree)?

Released under the Apache-2.0 license