@alis-build/design-system 0.21.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/alisx.css CHANGED
@@ -699,6 +699,8 @@ span.app-account__avatar{display:flex;align-items:center;justify-content:center;
699
699
  /* ── Empty state · speaks to the user; may take the drafting field ── */
700
700
  .app-empty{position:relative;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-8);min-height:320px;padding:var(--space-48) var(--space-24);text-align:center;color:var(--on-surface)}
701
701
  .app-empty__headline{margin:0;max-width:22ch}
702
+ /* The tile above the headline sits 16 clear of it */
703
+ .app-empty>.app-avatar{margin-bottom:var(--space-8)}
702
704
  .app-empty__line{margin:0 0 var(--space-8);max-width:44ch;color:var(--on-surface-variant)}
703
705
  .app-empty-line{margin:0;color:var(--on-surface-variant)}
704
706
  /* The drafting field around an empty state fills the pane with it */
@@ -947,7 +949,7 @@ button.app-attachment{border:0;color:inherit;font:inherit;text-align:left;cursor
947
949
  .app-turn__line{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-4);margin:0;color:var(--on-surface-variant)}
948
950
  .app-turn__line .app-icon{font-size:16px}
949
951
  .app-turn__line.is-error{color:var(--error)}
950
- .app-turn__line-action{margin-left:var(--space-4);padding:0;border:0;background:none;color:var(--primary);font:inherit;font-weight:600;cursor:pointer}
952
+ .app-turn__line-action,.app-empty-line__action{margin-left:var(--space-4);padding:0;border:0;background:none;color:var(--primary);font:inherit;font-weight:600;cursor:pointer}
951
953
  @media (hover:none){.app-turn__tools,.app-turn--alis:not(.is-latest) .app-turn__foot{display:none}}
952
954
  /* What your message was about: the context chip as you sent it */
953
955
  .app-turn__about{max-width:80%;color:var(--on-surface-variant);text-align:right}
@@ -1075,7 +1077,7 @@ a.app-token,button.app-token{border:0;font:inherit;font-weight:600;cursor:pointe
1075
1077
  .app-avatar--thing{border-radius:var(--radius-sm)}
1076
1078
  .app-avatar--thing.app-avatar--small{border-radius:var(--radius-xs)}
1077
1079
  .app-avatar--thing.app-avatar--large{border-radius:var(--radius-lg)}
1078
- .app-avatar--large>.app-icon{font-size:40px}
1080
+ .app-avatar--large>.app-icon{font-size:40px;font-variation-settings:"FILL" 0,"wght" 400,"GRAD" 0,"opsz" 40}
1079
1081
  /* A logo and the Alis mark arrive with their own ground (rules/chips-alerts.md) */
1080
1082
  .app-avatar--logo,.app-avatar--alis{background:transparent}
1081
1083
  .app-avatar--logo{object-fit:contain}
@@ -1083,6 +1085,12 @@ a.app-token,button.app-token{border:0;font:inherit;font-weight:600;cursor:pointe
1083
1085
  /* Several people: side by side, never overlapped, so no ring has to guess the ground under it */
1084
1086
  .app-avatar-group{display:inline-flex;align-items:center;gap:var(--space-4)}
1085
1087
  .app-avatar-group__more{font-variant-numeric:tabular-nums}
1088
+ /* An avatar inside a button: the button is the control, and its state layer lies over the picture */
1089
+ .app-avatar-btn{display:inline-flex;flex:none;padding:0;border:0;border-radius:var(--radius-pill);background:transparent;color:var(--on-surface)}
1090
+ .app-avatar-btn:has(>.app-avatar--thing){border-radius:var(--radius-sm)}
1091
+ .app-avatar-btn:has(>.app-avatar--thing.app-avatar--small){border-radius:var(--radius-xs)}
1092
+ .app-avatar-btn:has(>.app-avatar--thing.app-avatar--large){border-radius:var(--radius-lg)}
1093
+ .app-avatar-btn::before{z-index:1}
1086
1094
 
1087
1095
  /* ── Checkbox and radio · native inputs; the row is the target ── */
1088
1096
  .app-check-group{display:flex;flex-direction:column}
package/classes.json CHANGED
@@ -45,6 +45,7 @@
45
45
  "app-avatar--logo",
46
46
  "app-avatar--small",
47
47
  "app-avatar--thing",
48
+ "app-avatar-btn",
48
49
  "app-avatar-group",
49
50
  "app-avatar-group__more",
50
51
  "app-brand",
@@ -123,6 +124,7 @@
123
124
  "app-empty",
124
125
  "app-empty-field",
125
126
  "app-empty-line",
127
+ "app-empty-line__action",
126
128
  "app-empty__headline",
127
129
  "app-empty__line",
128
130
  "app-field",
@@ -9,11 +9,12 @@ See [chips-alerts.md](../rules/chips-alerts.md).
9
9
  - Never filled, never `primary`, never more than one on a surface. A button in it is a text [AppButton](AppButton.md). Radius `radius-xs`.
10
10
  - **A panel that *is* the status is an alert; a panel that *has* one carries a chip.** A row or card with a status keeps its neutral fill and shows an [AppChip](AppChip.md).
11
11
  - **Where**: a page-level notice goes directly after the title bar, in the flow, so it moves the content down. In a detail pane, at the top of the pane under its bar.
12
- - **An error says what happened and what to do next**, and offers the next step as its one action ("View logs").
12
+ - **An error says what happened and what to do next**, and offers the next step as its one action ("View logs"). In words a person wrote: never a status code or the machine's own message ([errors.md](../rules/errors.md)). When there is nothing they can do, the action is Copy details, for support.
13
+ - **The connection dropped**: one `warning` alert as the page-level notice, until it returns ("You're offline. What you do now may not be saved.").
13
14
  - **Narrow**: in the detail pane and below 600px the action stacks under the message automatically; `app-alert--stacked` does it anywhere.
14
15
  - **It stays** until the user acts again or leaves. It never times out.
15
16
 
16
- **Snackbar** confirms a result whose evidence is off-screen or easy to miss (a removed row, a closed pane, a save that changes nothing in view, a deploy finishing in a list); not when the change is plainly in view. Level 3 on `surface-variant`, light, bottom centre, one text action at most (Undo). A failure is never a snackbar: it is an alert that stays.
17
+ **Snackbar** confirms a result whose evidence is off-screen or easy to miss (a removed row, a closed pane, a save that changes nothing in view, a deploy finishing in a list); not when the change is plainly in view. Level 3 on `surface-variant`, light, bottom centre, one text action at most (Undo). A failure is never a snackbar: it is an alert that stays. **One snackbar stays**: "A new version is ready." with Reload, which waits until it is pressed and never reloads by itself.
17
18
 
18
19
  ## Markup
19
20
 
@@ -37,11 +38,31 @@ See [chips-alerts.md](../rules/chips-alerts.md).
37
38
  </div>
38
39
  <!-- Icons: info → info, success → check_circle, warning → warning, error → error. Title and actions are optional. -->
39
40
 
41
+ <!-- Something they did failed: at the top of the form or pane; what happened, then what to do -->
42
+ <div role="alert" class="app-alert app-alert--error">
43
+ <span class="app-icon" aria-hidden="true">error</span>
44
+ <div class="app-alert__body">
45
+ <strong class="app-alert__title">Couldn't save the environment</strong>
46
+ The name is already in use. Choose another, then save again.
47
+ </div>
48
+ </div>
49
+
50
+ <!-- The connection dropped: the page-level notice, until it returns -->
51
+ <div role="status" class="app-alert app-alert--warning">
52
+ <span class="app-icon" aria-hidden="true">warning</span>
53
+ <div class="app-alert__body">You're offline. What you do now may not be saved.</div>
54
+ </div>
55
+
40
56
  <!-- Snackbar -->
41
57
  <div role="status" class="app-snackbar">
42
58
  <span class="app-snackbar__text">Deleted preview-pr-218</span>
43
59
  <button type="button" class="app-btn app-state app-target">Undo</button>
44
60
  </div>
61
+ <!-- The one snackbar that stays -->
62
+ <div role="status" class="app-snackbar">
63
+ <span class="app-snackbar__text">A new version is ready.</span>
64
+ <button type="button" class="app-btn app-state app-target">Reload</button>
65
+ </div>
45
66
  <!-- app-snackbar--inline: in the flow instead of fixed, for docs -->
46
67
  ```
47
68
 
@@ -8,12 +8,12 @@ See [chips-alerts.md](../rules/chips-alerts.md) § Avatars.
8
8
 
9
9
  - **A person is round**: their photo, else their initials. **A thing is a square tile** (`app-avatar--thing`): an organisation by its logo or initials, anything else by its icon. The shape says which before the words do, so never a round organisation or a square person.
10
10
  - **Alis is the mark**, with no ground (`app-avatar--alis`, [AlisMark](AlisMark.md)).
11
- - **Three sizes, nothing between.** 24 (`app-avatar--small`) in a line of text: a who-line, a menu row, a table cell. 36 (the default, `control-height`) leading a row or a card with two lines. 80 (`app-avatar--large`) once, on the page that is about them. An icon tile is 36 or 80; at 24 the icon stands alone.
11
+ - **Three sizes, nothing between.** 24 (`app-avatar--small`) in a line of text: a who-line, a menu row, a table cell. 36 (the default, `control-height`) leading a row or a card with two lines. 80 (`app-avatar--large`) once: on the page that is about them, or as the tile above an empty state's headline ([AppEmptyState](AppEmptyState.md)). An icon tile is 36 or 80; at 24 the icon stands alone.
12
12
  - **Initials are two letters**, the first of the first and last names ("Thandi Mokoena" is TM); one when there is one name. An organisation takes the first letters of its first two words. Uppercase is typed in the data, never transformed.
13
13
  - **Neutral**: `surface-container-highest` behind `on-surface` ink. People are never coloured by their name. A category colour (`app-avatar--cat1` to `--cat6`) is for a thing whose category the screen already colours, and matches it. Never `primary`, never a status role: a state is a chip beside the name.
14
14
  - **A logo takes no ground** (`app-avatar--logo`): it arrives with its own, so no tile and no white plate behind it.
15
15
  - **Several people** sit side by side at 24 in an `.app-avatar-group`: three at most, then a count ("+4"). Never overlapped.
16
- - **Not a control.** The row, the name or a button is what you press; an avatar inside it adds no target. No presence dot and no badge on it.
16
+ - **Never the control, but it may sit inside one.** A button that holds an avatar (`.app-avatar-btn`: the account card, a person you can message) is the control, and its tooltip says what pressing does ("Message Thandi Mokoena privately"). **Nothing is drawn on the avatar**: no badge, no presence dot, no hover overlay. Changing the picture is a text button beside it ("Change photo"), never a press on the picture.
17
17
  - **An icon tile leads a row or a card whose subject has no picture of its own**: an action to take ("Invite your team"), a kind of thing (a guide, a flow). Inside a control (a button, a chip, a menu row, the rail) an icon is never tiled, and a file is an [AppAttachment](AppAttachment.md).
18
18
 
19
19
  ## Markup
@@ -50,6 +50,17 @@ See [chips-alerts.md](../rules/chips-alerts.md) § Avatars.
50
50
  <!-- Alis -->
51
51
  <span class="app-avatar app-avatar--small app-avatar--alis" aria-hidden="true"><svg …></svg></span>
52
52
 
53
+ <!-- Inside a button: the tooltip says what pressing does -->
54
+ <button type="button" class="app-avatar-btn app-state app-target" aria-label="Message Thandi Mokoena privately" title="Message Thandi Mokoena privately">
55
+ <span class="app-avatar" aria-hidden="true">TM</span>
56
+ </button>
57
+
58
+ <!-- Changing the picture: a text button beside it -->
59
+ <div class="app-btn-row">
60
+ <span class="app-avatar app-avatar--large" aria-hidden="true">TM</span>
61
+ <button type="button" class="app-btn app-state app-target">Change photo</button>
62
+ </div>
63
+
53
64
  <!-- Several people, then a count -->
54
65
  <span class="app-avatar-group" role="group" aria-label="Thandi Mokoena, Jan Krynauw, Priya Naidoo and 4 more">
55
66
  <span class="app-avatar app-avatar--small" aria-hidden="true">TM</span>
@@ -64,7 +75,8 @@ See [chips-alerts.md](../rules/chips-alerts.md) § Avatars.
64
75
  - **A photo that fails to load** becomes the initials: swap the `<img>` for the `<span>` on `error`. With no name either, a person is the `person` icon and an organisation the `domain` icon.
65
76
  - **The name**: beside its name an avatar is hidden from assistive technology (`aria-hidden`, or `alt=""`). Alone, it carries the name (`role="img"` and `aria-label`, or `alt`); a group carries everyone's on the group.
66
77
  - **The count** is the number left out, never the total.
78
+ - **A button holding an avatar** takes an `aria-label` that says what pressing does, and an [AppTooltip](AppTooltip.md) with the same words.
67
79
 
68
80
  ## Classes
69
81
 
70
- `.app-avatar`, `.app-avatar--small`, `.app-avatar--large`, `.app-avatar--thing`, `.app-avatar--logo`, `.app-avatar--alis`, `.app-avatar--cat1` to `.app-avatar--cat6`; `.app-avatar-group`, `.app-avatar-group__more`.
82
+ `.app-avatar`, `.app-avatar--small`, `.app-avatar--large`, `.app-avatar--thing`, `.app-avatar--logo`, `.app-avatar--alis`, `.app-avatar--cat1` to `.app-avatar--cat6`; `.app-avatar-group`, `.app-avatar-group__more`; `.app-avatar-btn`, with `.app-state` and `.app-target`.
@@ -6,6 +6,7 @@ A dialog: `surface-container-high` (white in light) at `elevation-3`, an object-
6
6
 
7
7
  - Actions are [AppButton](AppButton.md)s on the trailing edge, affirmative last. A dialog is a screen of its own, so the affirmative is filled when it commits (`app-btn--filled`, with `app-btn--error` when it destroys) and the rest, Cancel always among them, are text. An affirmative that only opens, copies or reads stays text, so the whole dialog is text. The affirmative names the outcome ("Delete environment", not "OK"). A dialog is never heavier than what it interrupts, and never dark.
8
8
  - **Confirm** what is hard to undo or reaches past the user: deleting, sending to people, deploying to production. Restate it in the title as a question ("Delete staging?") and say what goes with it in the body.
9
+ - **Signed out** is the one dialog with no Cancel: there is nothing to go back to. It sits over the screen as it was, Escape and the scrim don't close it, and signing in returns to the same screen ([errors.md](../rules/errors.md)).
9
10
  - **A form in a dialog** (Invite people) follows the form rules: fields 24 apart, validated on submit, and persistent (Escape and the scrim don't close it). The dialog is the confirmation, so its affirmative ("Send 3 invites") needs no second one; it is the dialog's filled button.
10
11
 
11
12
  ## Markup
@@ -24,6 +25,17 @@ A dialog: `surface-container-high` (white in light) at `elevation-3`, an object-
24
25
  </div>
25
26
  </div>
26
27
 
28
+ <!-- Signed out: the one dialog with no Cancel -->
29
+ <div class="app-scrim">
30
+ <div role="dialog" aria-modal="true" aria-labelledby="d-out-t" tabindex="-1" class="app-dialog">
31
+ <h2 id="d-out-t" class="app-dialog__title text-object-title">You're signed out</h2>
32
+ <div class="app-dialog__body text-body">Sign in again to pick up where you left off.</div>
33
+ <div class="app-btn-row app-btn-row--end">
34
+ <button type="button" class="app-btn app-state app-target">Sign in again</button>
35
+ </div>
36
+ </div>
37
+ </div>
38
+
27
39
  <!-- In the flow, for docs: no scrim, no aria-modal, no focus handling -->
28
40
  <div class="app-scrim app-scrim--inline">…</div>
29
41
  <!-- or the .app-dialog alone -->
@@ -7,8 +7,11 @@ An empty state that fills its pane and invites a first step.
7
7
  See [page.md](../rules/page.md).
8
8
 
9
9
  - It speaks to the user: a headline that says why you would act (never the screen's name), one supporting line that says how, and an outlined [AppButton](AppButton.md) (`app-btn--outlined`) that repeats the title bar's lead under the same label and glyph: the empty state is a surface, and that action is its lead.
10
+ - **It may lead with one icon tile**, above the headline: the avatar's thing tile at 80 ([AppAvatar](AppAvatar.md)), holding the icon of what the screen is about. Neutral, as every tile is, and never a status colour: a result says how it went in its headline. Leave it out when no icon is plainly the thing's own.
10
11
  - It takes the drafting field, one per screen. In `.app-shell__content` or the detail pane the field bleeds to the pane's edges (the CSS cancels the pane padding). Where the list pane and the detail pane are both empty, the detail pane takes the field and the list pane's empty state goes without it.
11
12
  - Keep the title bar's name and verb; hide search and the filter row.
13
+ - **A pane that can't show its content** (it couldn't load, they may not open it, it isn't there) is this same block without the drafting field: a headline in ink that says what couldn't happen, one line that says what to do, one outlined action. Never red: nothing they did failed. In a detail pane or a card the headline is `text-section-title`. The words for each case are in [errors.md](../rules/errors.md).
14
+ - **One section that couldn't load** is an empty line with Try again beside it (`.app-empty-line__action`); the rest of the screen stays.
12
15
  - An empty line inside working content ("No files yet" in a tab) is not this: use one supporting line, `.app-empty-line`.
13
16
 
14
17
  ## Markup
@@ -30,6 +33,14 @@ See [page.md](../rules/page.md).
30
33
  </div>
31
34
  </div>
32
35
 
36
+ <!-- Led by an icon tile -->
37
+ <div class="app-empty">
38
+ <span class="app-avatar app-avatar--thing app-avatar--large" aria-hidden="true"><span class="app-icon" aria-hidden="true">forum</span></span>
39
+ <h2 class="app-empty__headline text-page-title">Hear from the people closest to the problem</h2>
40
+ <p class="app-empty__line text-supporting">Create an interview and send it to the people who do the work.</p>
41
+ <button type="button" class="app-btn app-state app-target app-btn--outlined"><span class="app-icon" aria-hidden="true">add</span>New interview</button>
42
+ </div>
43
+
33
44
  <!-- Without the field: just the .app-empty block -->
34
45
  <div class="app-empty">
35
46
  <h2 class="app-empty__headline text-page-title">…</h2>
@@ -37,6 +48,31 @@ See [page.md](../rules/page.md).
37
48
  <!-- action -->
38
49
  </div>
39
50
 
51
+ <!-- Couldn't load: no field, in ink, Try again -->
52
+ <div class="app-empty">
53
+ <h2 class="app-empty__headline text-page-title">Couldn't load environments</h2>
54
+ <p class="app-empty__line text-supporting">Check your connection, then try again.</p>
55
+ <button type="button" class="app-btn app-state app-target app-btn--outlined"><span class="app-icon" aria-hidden="true">refresh</span>Try again</button>
56
+ </div>
57
+
58
+ <!-- No access: led by the tile, says who can help -->
59
+ <div class="app-empty">
60
+ <span class="app-avatar app-avatar--thing app-avatar--large" aria-hidden="true"><span class="app-icon" aria-hidden="true">lock</span></span>
61
+ <h2 class="app-empty__headline text-page-title">You don't have access to Renewal calls</h2>
62
+ <p class="app-empty__line text-supporting">Ask one of its owners to add you.</p>
63
+ <button type="button" class="app-btn app-state app-target app-btn--outlined">Request access</button>
64
+ </div>
65
+
66
+ <!-- Not there -->
67
+ <div class="app-empty">
68
+ <h2 class="app-empty__headline text-page-title">This project doesn't exist</h2>
69
+ <p class="app-empty__line text-supporting">It may have been deleted, or the link may be wrong.</p>
70
+ <a class="app-btn app-state app-target app-btn--outlined" href="/projects">Go to projects</a>
71
+ </div>
72
+
73
+ <!-- One section that couldn't load: a line, with Try again beside it -->
74
+ <p class="app-empty-line text-supporting">Couldn't load spend history.<button type="button" class="app-empty-line__action">Try again</button></p>
75
+
40
76
  <!-- An empty line inside working content -->
41
77
  <p class="app-empty-line text-supporting">No environments match. Try All, or clear the search.</p>
42
78
  ```
@@ -48,4 +84,4 @@ See [page.md](../rules/page.md).
48
84
 
49
85
  ## Classes
50
86
 
51
- `.app-empty`, `.app-empty__headline`, `.app-empty__line`, `.app-empty-line`, `.app-empty-field`; the drafting field: `.ax-field`, `.ax-field__glow`, `.ax-field__grid`, `.ax-field__noise`.
87
+ `.app-empty`, `.app-empty__headline`, `.app-empty__line`, `.app-empty-line`, `.app-empty-line__action`, `.app-empty-field`; the drafting field: `.ax-field`, `.ax-field__glow`, `.ax-field__grid`, `.ax-field__noise`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alis-build/design-system",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "description": "The AlisX design system for coding agents: tokens, product CSS, component markup, capability marks and rules.",
5
5
  "keywords": ["alisx", "design-system", "design-tokens", "css"],
6
6
  "homepage": "https://alisx.com",
package/rules/README.md CHANGED
@@ -24,6 +24,7 @@ Read only what the job needs.
24
24
  | [selection.md](selection.md) | How a selected thing is drawn |
25
25
  | [chips-alerts.md](chips-alerts.md) | Chips, alerts, status |
26
26
  | [loading.md](loading.md) | Skeleton, loader, progress |
27
+ | [errors.md](errors.md) | What shows when something fails, can't load, isn't allowed or isn't there |
27
28
  | [page.md](page.md) | Page anatomy, forms, empty states |
28
29
  | [icons.md](icons.md) | Material Symbols and the capability marks |
29
30
  | [shortcuts.md](shortcuts.md) | How a key is written, where it shows, the sheet, the keys that mean the same everywhere |
@@ -62,10 +62,15 @@ Icon tiles and initials take `surface-container-highest` with `on-surface` ink;
62
62
  categorical avatar takes a `catN-container` with its `on-catN-container` ink. Never a status role, never `primary`.
63
63
  People are never coloured by their name.
64
64
 
65
- **Three sizes: 24 in a line, 36 leading a row, 80 on the page about them.**
65
+ **Three sizes: 24 in a line, 36 leading a row, 80 on the page about them or as the
66
+ tile above an empty state's headline.**
66
67
  Several people sit side by side at 24, three then a count, never overlapped: a
67
68
  ring round each would have to match whatever ground is under it.
68
69
 
70
+ **An avatar is never the control, but it may sit inside a button**, whose tooltip
71
+ says what pressing does. Nothing is drawn on it: no badge, no presence dot, no
72
+ hover overlay. Changing a picture is a text button beside it.
73
+
69
74
  **A logo takes no ground.** It arrives with its own, so no disc and no white plate
70
75
  behind it. The tile returns only when the logo is absent and a drawn mark stands
71
76
  in.
@@ -0,0 +1,152 @@
1
+ # When something goes wrong
2
+
3
+ ## The one rule
4
+
5
+ **Say what happened and what to do next, in the place it happened, and keep
6
+ everything else on screen.** A failure never passes silently, never shows the
7
+ machine's own words, and never takes the screen away.
8
+
9
+ ## The decision
10
+
11
+ ```
12
+ What went wrong?
13
+ ├─ A value in a field → the field's error line
14
+ │ (page.md § Forms)
15
+ ├─ Something the person just did: a save,
16
+ │ a send, a deploy, a delete → one error alert at the top of the
17
+ │ form or pane they acted in
18
+ ├─ Work that failed after they moved on → the thing's own state says Failed,
19
+ │ and the alert waits in its pane
20
+ ├─ A screen or a pane could not load → a pane state in the content's place
21
+ ├─ One section of a screen could not load → one line in that section's place
22
+ ├─ What is on screen could not refresh → it stays; an alert only if they
23
+ │ asked for the refresh
24
+ ├─ They may not open this, or it isn't there → a pane state in the content's place
25
+ ├─ They may not do this one thing → the control leaves, or says why
26
+ │ beside it
27
+ ├─ The connection dropped → one page-level notice until it
28
+ │ returns
29
+ ├─ They were signed out → a dialog over the screen as it was
30
+ ├─ A new version is waiting → the one snackbar that stays
31
+ └─ A message didn't send, or Alis couldn't
32
+ finish a reply → the turn says so (AppTurn)
33
+ ```
34
+
35
+ **One failure, one notice.** The field, or the alert, or the pane state: never
36
+ two for the same thing.
37
+
38
+ ## Never
39
+
40
+ - **Silent.** A failure a person would notice always shows. Writing it to a log
41
+ is not showing it.
42
+ - **The machine's words.** No status code, no exception's message, no stack, no
43
+ "[unknown] Load failed". When the service sent a sentence written for a
44
+ person, show that sentence; otherwise write one.
45
+ - **A snackbar.** A failure stays until the person acts
46
+ ([AppAlert](../components/AppAlert.md)).
47
+ - **Red for what they didn't do.** A pane that couldn't load, or that they can't
48
+ open, is in ink: nothing they did failed. `error` is for an alert, a field, and
49
+ a thing whose state is Failed.
50
+ - **The whole screen.** The rail and the title bar stay, and so does every part
51
+ of the screen that did load.
52
+ - "Something went wrong" on its own, "Error:", "Oops", an apology, "please", an
53
+ exclamation mark.
54
+
55
+ ## The words
56
+
57
+ **What happened, then what to do, each as a sentence.** "Couldn't save the
58
+ environment. Check the name, then try again."
59
+
60
+ - **Start with "Couldn't" and name the thing in the person's words**: "Couldn't
61
+ load environments", "Couldn't send the interview". The product speaks; never
62
+ "I" or "we".
63
+ - **Say whose move it is.**
64
+
65
+ | The next step | Say |
66
+ | --- | --- |
67
+ | It will likely work again | "Try again.", with Try again as the action |
68
+ | It needs a moment | "Wait a moment, then try again." |
69
+ | They need to change something | what to change: "Use lowercase letters, numbers and hyphens only." |
70
+ | Someone else has to act | who: "Ask one of its owners to add you." |
71
+ | Nothing they can do | what happens to their work, and **Copy details** for support |
72
+
73
+ - **Details for support are copied, never shown.** Copy details is the notice's
74
+ one action only when there is no better next step.
75
+ - **No promise** about when it will work, and none that anyone has been told,
76
+ unless it is true.
77
+
78
+ ## A pane that can't show its content
79
+
80
+ [AppEmptyState](../components/AppEmptyState.md), without the drafting field:
81
+ this is work, not an invitation ([page.md](page.md) § The drafting field). A
82
+ headline in ink that says what couldn't happen, one supporting line that says
83
+ what to do, and one outlined action, the surface's lead. It may lead with the
84
+ neutral tile.
85
+
86
+ | | Headline | Line | Action |
87
+ | --- | --- | --- | --- |
88
+ | **Couldn't load** | "Couldn't load environments" | "Check your connection, then try again." | Try again, led by `refresh` |
89
+ | **No access** | "You don't have access to Renewal calls" | "Ask one of its owners to add you." | Request access, where the product can ask |
90
+ | **Not there** | "This project doesn't exist" | "It may have been deleted, or the link may be wrong." | Go to projects |
91
+ | **The service won't say which** | "You can't open this project" | "It may have been deleted, or you may not have access. Ask the person who sent you the link." | Go to projects |
92
+
93
+ - **It stands where the content would**, in the same conditional that renders
94
+ it ([loading.md](loading.md)). The title bar keeps the screen's name; search
95
+ and the filter row go, as when a list is empty. When they can't open the screen
96
+ at all, the bar's verbs go too.
97
+ - **The headline is `text-page-title` when it fills the screen's content, and
98
+ `text-section-title` in a detail pane or a card.**
99
+ - **Try again** shows its work on the button; the state stays until the content
100
+ arrives.
101
+ - **One section** that couldn't load is one line in its place
102
+ (`.app-empty-line`) with Try again beside it: "Couldn't load spend history."
103
+ The sections that did load stay.
104
+
105
+ ## Something they did failed
106
+
107
+ - **One error alert at the top of the form or pane they acted in**
108
+ ([AppAlert](../components/AppAlert.md)); a failure that belongs to a field
109
+ goes to the field instead ([page.md](page.md) § Forms).
110
+ - **The control returns to rest and what they entered stays.** A switch that
111
+ didn't apply flips back.
112
+ - **An action taken from a row or a menu** (Delete, Pause) puts its alert at the
113
+ top of the page, as a page-level notice ([page.md](page.md)).
114
+ - **The alert leaves when they act again**, never on a timer.
115
+ - **Work that fails later** (a deploy, an upload, a send to many people) changes
116
+ the thing's own state: its chip says Failed, and the alert waits in its pane
117
+ with the next step ([quick-start.md](quick-start.md) § 5).
118
+
119
+ ## What they may not do
120
+
121
+ - **Never theirs here**: leave the control out. The bar's verbs follow what can
122
+ be done ([page.md](page.md) § The title bar).
123
+ - **Theirs, but not now** (it needs a published version first, a limit is
124
+ reached): the control stays, disabled, with the reason in a supporting line
125
+ beside it. Never in a tooltip ([AppTooltip](../components/AppTooltip.md)), and
126
+ a lead that starts disabled is text until it can act
127
+ ([buttons.md](buttons.md)).
128
+ - **A whole screen they may not use** is the pane state above, never a screen of
129
+ disabled controls.
130
+
131
+ ## The app itself
132
+
133
+ - **The connection dropped.** One `warning` alert as the page-level notice:
134
+ "You're offline. What you do now may not be saved." It leaves by itself when
135
+ the connection returns. Nothing on the screen is disabled; what needs the
136
+ service fails into its own alert.
137
+ - **Signed out.** An [AppDialog](../components/AppDialog.md) over the screen as
138
+ it was: "You're signed out", "Sign in again to pick up where you left off.",
139
+ and one text action, Sign in again. It is the one dialog with no Cancel: there
140
+ is nothing to go back to. Signing in returns to the same screen, with what was
141
+ typed still there.
142
+ - **A new version is waiting.** The one snackbar that stays: "A new version is
143
+ ready." with Reload. It never interrupts and never reloads by itself.
144
+
145
+ ## Before you hand it back
146
+
147
+ 1. Switch the network off and load each screen you touched. Does every one say
148
+ what couldn't load, with a way to try again?
149
+ 2. Make the action you built fail. Does the button return to rest, with what
150
+ was entered still there?
151
+ 3. Is any text on screen something the machine wrote?
152
+ 4. Is there a `catch` that only logs?
package/rules/loading.md CHANGED
@@ -66,6 +66,9 @@ decides which screen comes next (an invitation link, account setup, a handoff).
66
66
  - **What is on screen stays on screen.** A refetch, a poll or a regeneration
67
67
  never blanks content or turns it back into a skeleton. A refresh the user asked
68
68
  for shows on the control they pressed.
69
+ - **A wait that fails says so where it stood**: the skeleton or the mark gives
70
+ way to what couldn't load and a way to try again ([errors.md](errors.md)),
71
+ never to a blank region or an endless wait.
69
72
  - **An empty state is an answer, not a wait.** Never show "No … yet" before the
70
73
  first response is back: start in the loading state, or gate the empty state on
71
74
  having loaded.
package/rules/page.md CHANGED
@@ -154,7 +154,8 @@ Then:
154
154
 
155
155
  Directly after the title bar, in the flow, never over it or inside it, so it
156
156
  moves the content down instead of covering the name. A screen with no title bar
157
- leads its content with it, or leaves it out.
157
+ leads its content with it, or leaves it out. What a failure shows, and where, is
158
+ [errors.md](errors.md).
158
159
 
159
160
  ## Empty and entry screens
160
161
 
@@ -170,6 +171,10 @@ leads its content with it, or leaves it out.
170
171
  would act and never repeats the screen's name: "Hear from the people closest to
171
172
  the problem", not "Interviews". One `text-supporting` line says how, once, with
172
173
  no second line pointing at the button.
174
+ - **It may lead with one icon tile**, the avatar's thing tile at 80, above the
175
+ headline ([AppAvatar](../components/AppAvatar.md)): the icon of what the screen
176
+ is about, neutral, never a status colour. Never a round disc, a tint, or an
177
+ icon with no ground.
173
178
  - **The button repeats the bar's action under the bar's label**
174
179
  ([buttons.md](buttons.md) § Naming the action), outlined at the default size:
175
180
  the empty state is a surface, and that action is its lead.
@@ -65,6 +65,8 @@ AppShell
65
65
  | Waiting, shape known | `AppSkeleton` in the content's shape |
66
66
  | Waiting, shape unknown | `AppLoader` |
67
67
  | Work you can count (a deploy, an upload) | `AppProgress`, with `AppSteps` for named stages |
68
+ | A screen or pane that couldn't load, or that they can't open | `AppEmptyState` without the drafting field: what couldn't happen, what to do, one action ([errors.md](errors.md)) |
69
+ | Something they did failed | one `AppAlert tone="error"` at the top of the form or pane, in words a person wrote; never a snackbar, never the machine's message |
68
70
  | Nothing yet | `AppEmptyState` filling the pane; keep the bar's name and verb, hide search and the filter row |
69
71
 
70
72
  ## 4. The values you'll reach for