fix(design-systems): the empty state's create button did nothing, and one surface
CI & Build / Python lint (push) Successful in 4s
CI & Build / Plugin hooks (push) Successful in 12s
CI & Build / integration (push) Successful in 28s
CI & Build / TypeScript typecheck (push) Successful in 33s
CI & Build / Python tests (push) Successful in 57s
CI & Build / Build & push image (push) Successful in 47s
CI & Build / Python lint (push) Successful in 4s
CI & Build / Plugin hooks (push) Successful in 12s
CI & Build / integration (push) Successful in 28s
CI & Build / TypeScript typecheck (push) Successful in 33s
CI & Build / Python tests (push) Successful in 57s
CI & Build / Build & push image (push) Successful in 47s
Two reports, one root cause each. **The dead button.** "Create the first one" set `showCreate = true`, but the create form lived inside `<div v-else class="ds-body">` — the sibling branch of the empty state. The two are mutually exclusive, so on a fresh install the flag flipped and nothing rendered. The first action a new install can take was the one that didn't work, which is a poor way to honour "an install with zero design systems is the ordinary state". The first system now gets its own form outside the list layout, and it drops the parent picker entirely: there is nothing to inherit from yet, so it says so instead of offering an empty select. **Two surfaces, the wrong one first.** /design and /design-systems are halves of one thing — the record that decides the styling, and what the browser renders from it — and I had added them as two separate nav entries with the read-only diagnostic listed first. Backwards: the record is what you work with; the live view is the check on it. Now one nav entry pointing at the record, with a shared tab bar joining the two. The explorer is renamed "Live tokens", which is what it actually shows. The tab bar is a component rather than the same markup in both views. Two copies diverge the moment a third tab appears — and a design surface that ships duplicated markup would be arguing against itself.
This commit is contained in:
@@ -42,6 +42,7 @@ import {
|
||||
type StylesheetResult,
|
||||
} from "@/api/designSystems";
|
||||
import { listRulebooks, type Rulebook } from "@/api/rulebooks";
|
||||
import DesignTabs from "@/components/DesignTabs.vue";
|
||||
import { ApiError } from "@/api/client";
|
||||
import { useToastStore } from "@/stores/toast";
|
||||
|
||||
@@ -528,14 +529,14 @@ function isColourish(value: string): boolean {
|
||||
|
||||
<template>
|
||||
<div class="ds-view">
|
||||
<DesignTabs />
|
||||
|
||||
<header class="ds-header">
|
||||
<h1>Design systems</h1>
|
||||
<p class="lede">
|
||||
The design system as the record holds it. A system with a parent stores
|
||||
only what it changes, so its own list is the answer to "what does this
|
||||
one alter?" — nothing to compute.
|
||||
<router-link to="/design">The design page</router-link> shows the other
|
||||
side: what the browser is actually rendering right now.
|
||||
</p>
|
||||
</header>
|
||||
|
||||
@@ -547,7 +548,7 @@ function isColourish(value: string): boolean {
|
||||
</div>
|
||||
|
||||
<!-- Empty is the ordinary state for most installs, not a broken one. -->
|
||||
<div v-else-if="!systems.length" class="notice">
|
||||
<div v-else-if="!systems.length && !showCreate" class="notice">
|
||||
<strong>No design systems yet.</strong>
|
||||
<p>
|
||||
A design system holds your tokens — colours, spacing, radii — as records
|
||||
@@ -557,6 +558,39 @@ function isColourish(value: string): boolean {
|
||||
<button class="btn-primary" @click="showCreate = true">Create the first one</button>
|
||||
</div>
|
||||
|
||||
<!-- The FIRST system gets its own form, outside the list layout below.
|
||||
`.ds-body` and the empty state are mutually exclusive branches, so a
|
||||
form nested in the former is unreachable from the latter — which is
|
||||
exactly the dead button this replaces. Once a system exists, the form
|
||||
inside `.ds-body` takes over and this branch never renders. -->
|
||||
<section v-else-if="!systems.length" class="ds-section">
|
||||
<h2>New design system</h2>
|
||||
<p class="section-note">
|
||||
Nothing to inherit from yet, so this one is a family system — the house
|
||||
style everything else departs from.
|
||||
</p>
|
||||
<div class="field">
|
||||
<label class="field-label" for="first-title">Title</label>
|
||||
<input
|
||||
id="first-title" v-model="newTitle" class="input" type="text"
|
||||
placeholder="FabledSword" @keyup.enter="submitCreate"
|
||||
/>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="field-label" for="first-desc">Description</label>
|
||||
<input
|
||||
id="first-desc" v-model="newDescription" class="input" type="text"
|
||||
placeholder="What it covers"
|
||||
/>
|
||||
</div>
|
||||
<div class="row-actions">
|
||||
<button class="btn-primary" :disabled="!newTitle.trim() || creating" @click="submitCreate">
|
||||
{{ creating ? "Creating…" : "Create" }}
|
||||
</button>
|
||||
<button class="btn-ghost" @click="showCreate = false">Cancel</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div v-else class="ds-body">
|
||||
<!-- Systems list -->
|
||||
<aside class="ds-sidebar">
|
||||
|
||||
Reference in New Issue
Block a user