@jjanczur/tyran 0.1.43 → 0.1.45

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.
@@ -30,7 +30,10 @@ import { COST_SCHEMA } from './cost.mjs';
30
30
  * version (operator-decided 2026-08-14: "a bit too flashy"), which filled
31
31
  * whole bars and whole cards at full saturation. Saturation is now spent on
32
32
  * text, edges and 3px rails; every large fill is a muted tone of the same
33
- * hue. System font stacks, no web fonts, dark only.
33
+ * hue. System font stacks, no web fonts. Two palettes since 2026-08-19
34
+ * (operator-decided: "daj dark mode i light mode"): the same warm families
35
+ * in a light and a dark rendering, following the OS by default with an
36
+ * explicit override stored per browser — see THEME_SCRIPT.
34
37
  *
35
38
  * ## Safety
36
39
  *
@@ -46,29 +49,72 @@ import { COST_SCHEMA } from './cost.mjs';
46
49
  * allowed, because it runs in the viewer's browser, not in the artifact.
47
50
  */
48
51
 
49
- const CSS = `
50
- :root{
51
- /* Warm near-black ground, unchanged in role. The accents below are the
52
- change: the first version filled whole bars and whole cards at full
53
- saturation, which reads as an alarm rather than as information. Colour is
54
- now spent on small things — text, edges, a 3px rail — and every large
55
- fill drops to a muted tone of the same hue. */
52
+ /*
53
+ * The dark palette, once. It is interpolated into the stylesheet TWICE —
54
+ * under the prefers-color-scheme media query for readers who never chose,
55
+ * and under [data-theme="dark"] for readers who did — because the two
56
+ * selectors cannot be combined and a palette maintained in two places is
57
+ * the drift ADR-21 names. The warm near-black ground is unchanged in role;
58
+ * --muted was raised from #8f8779 (5.4:1 on the ground, and it carries most
59
+ * of the small mono text on the page) to 7:1, operator-reported as hard to
60
+ * read on 2026-08-19.
61
+ */
62
+ const DARK_TOKENS = `
56
63
  --bg:#141210;--bg-raised:#1c1a16;--bg-sunken:#100e0c;
57
- --text:#cec7ba;--heading:#ece5d7;--muted:#8f8779;
64
+ --text:#d3ccbf;--heading:#ece5d7;--muted:#a49c8c;
58
65
  --hairline:#332e27;--hairline-soft:#26221d;
59
66
  --brass:#a8863c;--brass-bright:#cfae63;--brass-low:#221c11;--brass-edge:#5d4c22;
60
67
  --steel:#7d9ea9;--steel-bright:#9dbcc6;--steel-low:#17242a;--steel-edge:#3a545d;
61
68
  --clay:#c07a70;--clay-bright:#d9998f;--clay-low:#2a1a18;--clay-edge:#5a3430;
62
69
  --sage:#88a06a;--sage-bright:#a3ba86;
70
+ color-scheme:dark;`;
71
+
72
+ const CSS = `
73
+ :root{
74
+ /* The LIGHT rendering of the same families: warm paper instead of warm
75
+ near-black, every accent darkened until it reads at 4.5:1 or better on
76
+ the ground. The role vocabulary is unchanged — -low is still the quiet
77
+ fill, -bright is still the emphasised text tone, -edge the border — so
78
+ every rule below works in both palettes without knowing which one is
79
+ live. Colour is still spent on small things — text, edges, a 3px rail —
80
+ never on whole cards. */
81
+ --bg:#f4efe6;--bg-raised:#fbf8f1;--bg-sunken:#ebe4d5;
82
+ --text:#3d372b;--heading:#231e15;--muted:#6b6252;
83
+ --hairline:#d7cdba;--hairline-soft:#e3dbc9;
84
+ --brass:#7e6023;--brass-bright:#6d5316;--brass-low:#efe6cb;--brass-edge:#c8b173;
85
+ --steel:#41666f;--steel-bright:#2f505c;--steel-low:#dde8ea;--steel-edge:#93b1b8;
86
+ --clay:#a34a3d;--clay-bright:#88392d;--clay-low:#f2ded7;--clay-edge:#d19c8f;
87
+ --sage:#5d7440;--sage-bright:#4a6030;
63
88
  --display:ui-serif,'Iowan Old Style','Palatino Linotype',Palatino,'Book Antiqua',Georgia,'Times New Roman',serif;
64
89
  --font:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif;
65
90
  --mono:ui-monospace,SFMono-Regular,'SF Mono',Menlo,Consolas,'Liberation Mono',monospace;
66
- --radius:0.6rem;color-scheme:dark;
91
+ --radius:0.6rem;color-scheme:light;
92
+ }
93
+ /* Three theme states, not two. No stored choice: the OS decides, via this
94
+ media query. A stored choice: data-theme lands on <html> before first
95
+ paint (THEME_SCRIPT) and wins in both directions — the :not() guard is
96
+ what lets an explicit "light" beat a dark OS. */
97
+ @media (prefers-color-scheme: dark){
98
+ :root:not([data-theme="light"]){${DARK_TOKENS}
99
+ }
100
+ }
101
+ :root[data-theme="dark"]{${DARK_TOKENS}
67
102
  }
68
103
  *{box-sizing:border-box}
69
104
  body{margin:0;background:var(--bg);color:var(--text);font-family:var(--font);font-size:1rem;line-height:1.55;-webkit-font-smoothing:antialiased;padding:1.25rem}
70
105
  main{max-width:70rem;margin:0 auto}
71
106
  h1{font-family:var(--display);color:var(--heading);font-size:1.5rem;margin:0 0 .2rem;font-weight:600}
107
+ /* ---- masthead: title left, the person links and the theme switch right ---- */
108
+ .tophead{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start;flex-wrap:wrap}
109
+ .topside{display:flex;flex-direction:column;align-items:flex-end;gap:.4rem}
110
+ .toplinks{display:flex;gap:.75rem;font-size:.74rem}
111
+ .toplinks a{color:var(--muted);text-decoration:none;border-bottom:1px solid transparent;padding-bottom:.05rem}
112
+ .toplinks a:hover{color:var(--brass-bright);border-bottom-color:var(--brass-edge)}
113
+ .toplinks a:focus-visible{outline:2px solid var(--steel);outline-offset:2px}
114
+ .theme{display:flex;gap:.25rem}
115
+ .theme button{font-family:var(--mono);font-size:.66rem;letter-spacing:.06em;text-transform:uppercase;background:var(--bg-raised);color:var(--muted);border:1px solid var(--hairline);border-radius:.3rem;padding:.16rem .5rem;cursor:pointer}
116
+ .theme button[aria-pressed="true"]{background:var(--brass-low);border-color:var(--brass-edge);color:var(--brass-bright)}
117
+ .theme button:focus-visible{outline:2px solid var(--steel);outline-offset:2px}
72
118
  h2{font-family:var(--display);color:var(--heading);font-size:1.02rem;margin:1.4rem 0 .5rem;border-bottom:1px solid var(--hairline-soft);padding-bottom:.3rem;font-weight:600}
73
119
  h3{font-family:var(--font);color:var(--heading);font-size:.85rem;margin:1.1rem 0 .2rem;font-weight:650}
74
120
  .meta{color:var(--muted);font-family:var(--mono);font-size:.78rem}
@@ -89,7 +135,13 @@ h3{font-family:var(--font);color:var(--heading);font-size:.85rem;margin:1.1rem 0
89
135
  /* ---- tiles ---- */
90
136
  .tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(10.5rem,1fr));gap:.55rem;margin:.5rem 0 .2rem}
91
137
  .stile{background:var(--bg-raised);border:1px solid var(--hairline);border-radius:.5rem;padding:.6rem .8rem}
92
- .stile .lbl{display:block;font-family:var(--mono);font-size:.63rem;text-transform:uppercase;letter-spacing:.09em;color:var(--muted)}
138
+ /* A tile is a BUTTON since 2026-08-19: each headline number is also the way
139
+ to the place that explains it. The reset matters — a button inherits
140
+ neither the page font nor left alignment. */
141
+ button.stile{font:inherit;font-family:var(--font);color:var(--text);text-align:left;cursor:pointer;width:100%;display:block}
142
+ button.stile:hover{border-color:var(--steel-edge)}
143
+ button.stile:focus-visible{outline:2px solid var(--steel);outline-offset:2px}
144
+ .stile .lbl{display:block;font-family:var(--mono);font-size:.68rem;text-transform:uppercase;letter-spacing:.09em;color:var(--muted)}
93
145
  .stile .big{display:block;font-family:var(--mono);font-size:1.3rem;color:var(--heading);font-variant-numeric:tabular-nums;line-height:1.3}
94
146
  .stile .sub{display:block;font-family:var(--mono);font-size:.68rem;color:var(--muted)}
95
147
  .stile.lead{border-color:var(--brass-edge)}
@@ -101,6 +153,9 @@ h3{font-family:var(--font);color:var(--heading);font-size:.85rem;margin:1.1rem 0
101
153
  .agents{display:flex;flex-wrap:wrap;gap:.45rem}
102
154
  .agent{background:var(--bg-raised);border:1px solid var(--hairline);border-left:3px solid var(--steel-edge);border-radius:.45rem;padding:.42rem .65rem;font-family:var(--mono);font-size:.76rem;min-width:15rem}
103
155
  .agent .name{color:var(--steel-bright);font-weight:600}
156
+ /* The dot answers "is this alive" from across the room; the age lines below
157
+ still answer "how alive" up close. Same class vocabulary, one glyph. */
158
+ .dot{font-size:.62rem;margin-right:.28rem;vertical-align:.06rem}
104
159
  .agent .age-fresh{color:var(--sage)}
105
160
  .agent .age-warm{color:var(--brass-bright)}
106
161
  .agent .age-cold{color:var(--clay)}
@@ -122,7 +177,7 @@ h3{font-family:var(--font);color:var(--heading);font-size:.85rem;margin:1.1rem 0
122
177
  .moved{background:var(--brass-low);border:1px solid var(--brass-edge);border-radius:var(--radius);padding:.5rem .75rem;margin:.6rem 0;display:flex;gap:.6rem;align-items:center;flex-wrap:wrap;color:var(--brass-bright);font-size:.85rem}
123
178
  .markseen{background:var(--bg-raised);color:var(--text);border:1px solid var(--hairline);border-radius:.4rem;padding:.25rem .6rem;font:inherit;font-size:.78rem;cursor:pointer}
124
179
  .markseen:hover{border-color:var(--brass-edge);color:var(--brass-bright)}
125
- .card .movedtag{display:inline-block;background:var(--brass-low);color:var(--brass-bright);border:1px solid var(--brass-edge);border-radius:.3rem;padding:0 .3rem;font-size:.65rem;margin-left:.3rem;letter-spacing:.04em}
180
+ .card .movedtag{display:inline-block;background:var(--brass-low);color:var(--brass-bright);border:1px solid var(--brass-edge);border-radius:.3rem;padding:0 .3rem;font-size:.68rem;margin-left:.3rem;letter-spacing:.04em}
126
181
 
127
182
  /* ---- filter ---- */
128
183
  .filter{display:flex;gap:.6rem;align-items:center;margin:.5rem 0 .7rem}
@@ -134,22 +189,17 @@ h3{font-family:var(--font);color:var(--heading);font-size:.85rem;margin:1.1rem 0
134
189
  .file{display:flex;gap:.5rem;align-items:baseline;flex-wrap:wrap;font-size:.76rem}
135
190
  .file .fname{color:var(--steel-bright);font-family:var(--mono);font-weight:600;min-width:6rem}
136
191
  .file code{color:var(--muted);font-size:.72rem;word-break:break-all}
137
- /* On an initiative the name is a button that opens the file; on a ticket it is
138
- still a plain span. Underlined rather than boxed: it sits in a list of paths
139
- and a row of buttons there would read as a toolbar. */
192
+ /* The name is a button that opens the file, on initiatives and tickets both.
193
+ Underlined rather than boxed: it sits in a list of paths and a row of
194
+ buttons there would read as a toolbar. */
140
195
  .file button.fname{background:transparent;border:0;padding:0;font-size:inherit;cursor:pointer;
141
196
  text-align:left;text-decoration:underline;text-underline-offset:.18em}
142
197
  .file button.fname:hover{color:var(--brass-bright)}
143
198
  .file button.fname:focus-visible{outline:2px solid var(--steel);outline-offset:2px}
144
199
  .docview{margin-top:.5rem}
145
200
  .dochead{display:flex;gap:.6rem;align-items:baseline;flex-wrap:wrap;margin-bottom:.3rem}
146
- /* The document, as TEXT. It is agent-written markdown rendered by nothing —
147
- pre-wrap so a long line folds instead of pushing the page sideways, and a
148
- ceiling so a 2000-line NOTES.md scrolls inside the panel rather than
149
- burying the board under it. */
150
- pre.doc{background:var(--bg-sunken);border:1px solid var(--hairline);border-radius:.45rem;
151
- padding:.7rem .85rem;font-family:var(--mono);font-size:.74rem;line-height:1.5;color:var(--text);
152
- white-space:pre-wrap;word-break:break-word;max-height:32rem;overflow:auto;margin:0}
201
+ /* The document itself is rendered by renderMarkdown into .docmd (defined with
202
+ the other detail styles): structure, never active markup. */
153
203
 
154
204
  /* ---- what actually ran on a ticket ---- */
155
205
  .runs{width:100%;border-collapse:collapse;margin-top:.3rem;font-size:.74rem;display:block;overflow-x:auto}
@@ -194,12 +244,49 @@ pre.doc{background:var(--bg-sunken);border:1px solid var(--hairline);border-radi
194
244
  .ask .kindtag{display:inline-block;font-family:var(--mono);font-size:.63rem;letter-spacing:.06em;text-transform:uppercase;border-radius:.25rem;padding:.1rem .4rem;margin-bottom:.35rem}
195
245
  .ask .kindtag.blocking{background:var(--clay-low);color:var(--clay-bright);border:1px solid var(--clay-edge)}
196
246
  .ask .kindtag.decision{background:var(--steel-low);color:var(--steel-bright);border:1px solid var(--steel-edge)}
247
+ /* How long the question has been standing, as a pill beside the kind tag.
248
+ Brass while it is ordinary, clay after a day — the same two-tone reading
249
+ the agent ages use, computed in the reader's browser for the same reason. */
250
+ .waitchip{display:inline-block;font-family:var(--mono);font-size:.7rem;background:var(--brass-low);color:var(--brass-bright);border:1px solid var(--brass-edge);border-radius:999px;padding:.08rem .55rem;margin-left:.45rem;vertical-align:.08rem}
251
+ .waitchip.long{background:var(--clay-low);color:var(--clay-bright);border-color:var(--clay-edge)}
252
+ /* The two lines an operator decides from. The recommendation and the default
253
+ were dl rows styled like "ticket" and "since", and the answer to "what
254
+ happens if I ignore this" — the most load-bearing sentence on the page —
255
+ rendered at the same weight as a slug. */
256
+ .ask .row.defrow{font-weight:600;color:var(--heading)}
257
+ .ask .row.defrow .label{color:var(--clay)}
197
258
  .reply{margin-top:.6rem;border-top:1px solid var(--brass-edge);padding-top:.55rem}
198
- .reply textarea{display:block;width:100%;font-family:var(--font);font-size:.86rem;background:var(--bg-raised);color:var(--text);border:1px solid var(--hairline);border-radius:.35rem;padding:.4rem .55rem;min-height:3.4rem;resize:vertical}
259
+ /* A chat composer, not a form (operator-decided 2026-08-19): the field and a
260
+ round send sit on one line, the two canned moves are chips above it, and
261
+ Enter sends. The textarea still grows for an operator writing sentences. */
262
+ .composer{display:flex;gap:.45rem;align-items:flex-end}
263
+ .reply textarea{display:block;width:100%;font-family:var(--font);font-size:.86rem;background:var(--bg-raised);color:var(--text);border:1px solid var(--hairline);border-radius:.55rem;padding:.45rem .6rem;min-height:2.6rem;resize:vertical}
199
264
  .reply textarea:focus-visible{outline:2px solid var(--steel);outline-offset:1px}
200
265
  .reply textarea:disabled{opacity:.55;cursor:not-allowed}
201
- .reply .acts{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;margin-top:.4rem}
266
+ .sendbtn{flex:0 0 auto;width:2.3rem;height:2.3rem;border-radius:50%;background:var(--brass-low);color:var(--brass-bright);border:1px solid var(--brass-edge);font-size:1rem;line-height:1;cursor:pointer}
267
+ .sendbtn:hover:not(:disabled){background:var(--brass-edge)}
268
+ .sendbtn:disabled{opacity:.5;cursor:not-allowed}
269
+ .sendbtn:focus-visible{outline:2px solid var(--steel);outline-offset:2px}
270
+ .reply .acts{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;margin:.1rem 0 .4rem}
202
271
  .reply .hint{font-size:.75rem;color:var(--muted);margin-top:.3rem}
272
+ /* ---- a ticket's own history, oldest first ---- */
273
+ .tl{margin:.45rem 0 0;font-size:.78rem}
274
+ .tl .tlr{display:flex;gap:.55rem;padding:.16rem 0;border-top:1px dashed var(--hairline-soft);align-items:baseline}
275
+ .tl .tlt{color:var(--muted);font-family:var(--mono);min-width:6.5rem;white-space:nowrap}
276
+ .copysha{font-family:var(--mono);font-size:.68rem;background:var(--steel-low);color:var(--steel-bright);border:1px solid var(--steel-edge);border-radius:.3rem;padding:.06rem .4rem;cursor:pointer}
277
+ .copysha:hover{background:var(--steel-edge)}
278
+ .jumps{display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.6rem}
279
+ /* ---- initiative documents, rendered ---- */
280
+ .docmd{background:var(--bg-sunken);border:1px solid var(--hairline);border-radius:.45rem;padding:.7rem .95rem;font-size:.82rem;line-height:1.6;color:var(--text);max-height:32rem;overflow:auto}
281
+ .docmd .md-h{color:var(--heading);font-weight:700;margin:.7rem 0 .25rem}
282
+ .docmd .md-h.l1{font-size:.98rem}
283
+ .docmd .md-h.l2{font-size:.9rem}
284
+ .docmd .md-h.l3{font-size:.84rem}
285
+ .docmd p{margin:.3rem 0}
286
+ .docmd ul{margin:.25rem 0 .45rem 1.2rem;padding:0}
287
+ .docmd li{margin:.12rem 0}
288
+ .docmd pre{background:var(--bg-raised);border:1px solid var(--hairline-soft);border-radius:.35rem;padding:.5rem .65rem;font-family:var(--mono);font-size:.74rem;overflow-x:auto;margin:.35rem 0;white-space:pre-wrap;word-break:break-word}
289
+ .docmd .md-table{font-family:var(--mono);font-size:.74rem;white-space:pre-wrap;word-break:break-word;margin:.1rem 0}
203
290
  /* Folded shut on a board that can answer in the page, opened by the settings
204
291
  fetch on one that cannot. The summary is a sentence, not a chevron with a
205
292
  noun: what is behind it is a route, not a section. */
@@ -224,13 +311,15 @@ pre.how .c{color:var(--muted)}
224
311
  .toggle button[aria-pressed="true"]{background:var(--brass-low);border-color:var(--brass-edge);color:var(--brass-bright)}
225
312
  .toggle button:focus-visible{outline:2px solid var(--steel);outline-offset:2px}
226
313
  .comp{display:flex;height:1.35rem;border:1px solid var(--hairline);border-radius:.3rem;overflow:hidden;margin-top:.5rem}
227
- .comp span{display:flex;align-items:center;justify-content:center;font-family:var(--mono);font-size:.63rem;color:var(--bg);font-weight:700;white-space:nowrap;overflow:hidden}
314
+ .comp span{display:flex;align-items:center;justify-content:center;font-family:var(--mono);font-size:.66rem;color:var(--bg);font-weight:700;white-space:nowrap;overflow:hidden}
228
315
  .comp .s-cache_read{background:var(--brass)}
229
316
  .comp .s-cache_write{background:var(--steel)}
230
317
  /* The 1-hour write is its own segment because it is its own PRICE — 2x base
231
318
  input against the 5-minute write's 1.25x. Without a distinct colour the
232
- most expensive caching decision on the page is invisible. */
233
- .comp .s-cache_write_1h{background:var(--ink)}
319
+ most expensive caching decision on the page is invisible. --heading, not a
320
+ fifth family: it referenced an undefined --ink for months and rendered as
321
+ nothing, which is the bug being fixed here. */
322
+ .comp .s-cache_write_1h{background:var(--heading)}
234
323
  /* ---- initiatives ---- */
235
324
  .inits{display:flex;flex-direction:column;gap:.3rem;margin:.5rem 0}
236
325
  /* A button, because selecting one opens its detail — the same interaction the
@@ -252,7 +341,7 @@ pre.how .c{color:var(--muted)}
252
341
  .initrow .iw.done{color:var(--sage);font-weight:600}
253
342
  .initrow .il{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
254
343
  .initrow .islug{color:var(--muted);margin-left:.4rem;font-size:.85em}
255
- .initrow .ib{height:6px;background:var(--line);border-radius:3px;overflow:hidden}
344
+ .initrow .ib{height:6px;background:var(--hairline);border-radius:3px;overflow:hidden}
256
345
  .initrow .ib i{display:block;height:100%;background:var(--sage)}
257
346
  .initrow .iv,.initrow .iw{color:var(--muted);font-size:.9em;white-space:nowrap}
258
347
  .initrow .iw.warn{color:var(--brass);font-weight:600}
@@ -263,7 +352,7 @@ pre.how .c{color:var(--muted)}
263
352
  .day{flex:1 0 6px;min-width:6px;height:100%;display:flex;align-items:flex-end}
264
353
  .day i{display:block;width:100%;background:var(--brass);border-radius:1px 1px 0 0}
265
354
  /* Outside the chosen window: context, not absence. */
266
- .day.out i{background:var(--line)}
355
+ .day.out i{background:var(--hairline)}
267
356
  .comp .s-output{background:var(--sage)}
268
357
  .comp .s-input{background:var(--muted)}
269
358
  .compkey{display:flex;flex-wrap:wrap;gap:.85rem;font-family:var(--mono);font-size:.66rem;color:var(--muted);margin-top:.3rem}
@@ -295,6 +384,16 @@ pre.how .c{color:var(--muted)}
295
384
  .srow select:focus-visible,.srow input:focus-visible,.srow textarea:focus-visible{outline:2px solid var(--steel);outline-offset:1px}
296
385
  .srow select:disabled,.srow input:disabled,.srow textarea:disabled{opacity:.55;cursor:not-allowed}
297
386
  .srow .shelp{font-size:.8rem;color:var(--muted);line-height:1.6;margin-top:.35rem;max-width:52rem}
387
+ .sexplain{margin-top:.35rem;max-width:52rem}
388
+ .sexplain>summary{cursor:pointer;font-size:.78rem;color:var(--steel);list-style:none;padding:.15rem 0}
389
+ .sexplain>summary::-webkit-details-marker{display:none}
390
+ /* Character, not CSS escape — same reason as .howbox above. */
391
+ .sexplain>summary::before{content:"▸ ";color:var(--steel)}
392
+ .sexplain[open]>summary::before{content:"▾ "}
393
+ .sexplain>summary:hover{color:var(--text)}
394
+ .sexplain>summary:focus-visible{outline:2px solid var(--steel);outline-offset:2px}
395
+ .sexline{font-size:.8rem;line-height:1.6;margin:.25rem 0;padding-left:.6rem;border-left:2px solid var(--hairline)}
396
+ .sexline b{color:var(--heading);font-weight:600}
298
397
  .srow .schoice{font-size:.8rem;color:var(--text);line-height:1.6;margin-top:.3rem;padding-left:.6rem;border-left:2px solid var(--steel-edge)}
299
398
  .sstat{font-family:var(--mono);font-size:.75rem;line-height:1.7;margin-top:.35rem;color:var(--muted);word-break:break-word;white-space:pre-wrap}
300
399
  .sstat.ok{color:var(--sage-bright)}
@@ -311,6 +410,12 @@ pre.how .c{color:var(--muted)}
311
410
  .rule .sstat{grid-column:1 / -1}
312
411
  .caveat{color:var(--muted);font-size:.76rem;margin-top:.5rem;max-width:52rem}
313
412
  footer{margin-top:2rem;color:var(--muted);font-size:.72rem;border-top:1px solid var(--hairline-soft);padding-top:.6rem}
413
+ footer .made{margin-bottom:.3rem;font-size:.78rem}
414
+ footer .made a{color:var(--brass-bright);text-decoration:none}
415
+ footer .made a:hover{text-decoration:underline;text-underline-offset:.18em}
416
+ /* The one non-brass mark on the page, matching the docs site's own footer:
417
+ a gold heart would read as decoration. */
418
+ footer .heart{color:#c1442e}
314
419
  `;
315
420
 
316
421
  /**
@@ -424,11 +529,62 @@ if (data.schema !== 1) {
424
529
  }
425
530
 
426
531
  var app = document.getElementById('app');
427
- var head = el('div');
428
- head.appendChild(el('h1', null, 'Tyran board'));
429
- head.appendChild(el('div', 'meta',
532
+ var head = el('div', 'tophead');
533
+ var brand = el('div');
534
+ brand.appendChild(el('h1', null, 'Tyran board'));
535
+ brand.appendChild(el('div', 'meta',
430
536
  (totals.initiatives || 0) + ' initiative(s) · ' + (totals.merged || 0) + '/' + (totals.tickets || 0) +
431
537
  ' tickets merged (' + (totals.percent || 0) + '%) · as of ' + (data.as_of || 'unknown')));
538
+ head.appendChild(brand);
539
+ var topside = el('div', 'topside');
540
+ var toplinks = el('div', 'toplinks');
541
+ [['janczura.com', 'https://janczura.com/en/'],
542
+ ['LinkedIn', 'https://linkedin.com/in/jacekjanczura'],
543
+ ['GitHub', 'https://github.com/jjanczur/tyran']].forEach(function (pair) {
544
+ var link = el('a', null, pair[0]);
545
+ link.href = pair[1];
546
+ link.target = '_blank';
547
+ link.rel = 'noopener';
548
+ toplinks.appendChild(link);
549
+ });
550
+ topside.appendChild(toplinks);
551
+ // Three states, and "system" is a real one rather than the absence of the
552
+ // other two: it clears the stored choice so the OS decides again, which is
553
+ // the only way back once an override exists. The head script already
554
+ // applied the stored theme before first paint; this control only has to
555
+ // mirror it and move it.
556
+ var THEME_KEY = 'tyran-board-theme';
557
+ var themeRow = el('div', 'theme');
558
+ themeRow.setAttribute('role', 'group');
559
+ themeRow.setAttribute('aria-label', 'colour theme');
560
+ var themeButtons = {};
561
+ var storedTheme = function () {
562
+ try {
563
+ var t = localStorage.getItem(THEME_KEY);
564
+ return t === 'light' || t === 'dark' ? t : 'system';
565
+ } catch (e) { return 'system'; }
566
+ };
567
+ var applyTheme = function (mode) {
568
+ try {
569
+ if (mode === 'system') localStorage.removeItem(THEME_KEY);
570
+ else localStorage.setItem(THEME_KEY, mode);
571
+ } catch (e) { /* a stored theme is a nicety; never let it take the page down */ }
572
+ if (mode === 'light' || mode === 'dark') document.documentElement.setAttribute('data-theme', mode);
573
+ else document.documentElement.removeAttribute('data-theme');
574
+ Object.keys(themeButtons).forEach(function (k) {
575
+ themeButtons[k].setAttribute('aria-pressed', k === mode ? 'true' : 'false');
576
+ });
577
+ };
578
+ [['system', 'System'], ['light', 'Light'], ['dark', 'Dark']].forEach(function (pair) {
579
+ var b = el('button', null, pair[1]);
580
+ b.setAttribute('type', 'button');
581
+ b.setAttribute('aria-pressed', storedTheme() === pair[0] ? 'true' : 'false');
582
+ b.addEventListener('click', function () { applyTheme(pair[0]); });
583
+ themeButtons[pair[0]] = b;
584
+ themeRow.appendChild(b);
585
+ });
586
+ topside.appendChild(themeRow);
587
+ head.appendChild(topside);
432
588
  app.appendChild(head);
433
589
 
434
590
  // ---- tabs -------------------------------------------------------------
@@ -439,12 +595,15 @@ if (data.schema !== 1) {
439
595
  tabbar.setAttribute('role', 'tablist');
440
596
  var panels = {};
441
597
  var buttons = {};
598
+ // One emoji per label (operator-decided 2026-08-19, borrowed from a board
599
+ // the operator found more scannable): the glyph is what the eye finds, the
600
+ // word is still the identifier.
442
601
  var TABS = [
443
- ['overview', 'Overview', null],
444
- ['board', 'Board', null],
445
- ['questions', 'Waiting on you', asks.length],
446
- ['spend', 'Spend', null],
447
- ['settings', 'Settings', null],
602
+ ['overview', '📊 Overview', null],
603
+ ['board', '🗂 Board', null],
604
+ ['questions', '❓ Waiting on you', asks.length],
605
+ ['spend', '💸 Spend', null],
606
+ ['settings', '⚙️ Settings', null],
448
607
  ];
449
608
  // The open tab lives in the URL fragment, and that is not cosmetic. Tab
450
609
  // state was a local variable while this page reloads itself every 30
@@ -480,8 +639,15 @@ if (data.schema !== 1) {
480
639
  app.appendChild(tabbar);
481
640
  TABS.forEach(function (spec) { app.appendChild(panels[spec[0]]); });
482
641
 
483
- var tile = function (label, big, sub, cls) {
484
- var box = el('div', cls ? 'stile ' + cls : 'stile');
642
+ // A tile with a destination is a button; one without stays a div. The
643
+ // headline numbers were the one thing on the page you could read and not
644
+ // follow — every count now goes where its explanation lives.
645
+ var tile = function (label, big, sub, cls, go) {
646
+ var box = el(go ? 'button' : 'div', cls ? 'stile ' + cls : 'stile');
647
+ if (go) {
648
+ box.setAttribute('type', 'button');
649
+ box.addEventListener('click', go);
650
+ }
485
651
  box.appendChild(el('span', 'lbl', label));
486
652
  box.appendChild(el('span', 'big', big));
487
653
  box.appendChild(el('span', 'sub', sub));
@@ -512,6 +678,15 @@ if (data.schema !== 1) {
512
678
  if (ms < 172800000) return Math.round(ms / 3600000) + ' h ago';
513
679
  return Math.round(ms / 86400000) + ' d ago';
514
680
  };
681
+ // A duration, not an age: "waiting 2 h 15 min" on a question chip. Two
682
+ // units, never three — past two days the minutes are noise.
683
+ var durText = function (ms) {
684
+ var m = Math.floor(ms / 60000);
685
+ if (m < 60) return m + ' min';
686
+ var h = Math.floor(m / 60);
687
+ if (h < 48) return h + ' h ' + (m % 60) + ' min';
688
+ return Math.floor(h / 24) + ' d ' + (h % 24) + ' h';
689
+ };
515
690
 
516
691
  var fmtTokens = function (n) {
517
692
  if (n >= 1e9) return (n / 1e9).toFixed(2) + ' B';
@@ -532,7 +707,14 @@ if (data.schema !== 1) {
532
707
  if (agents.length === 0) strip.appendChild(el('div', 'empty', 'none running'));
533
708
  agents.forEach(function (a) {
534
709
  var chip = el('div', 'agent' + (a.stale ? ' stale' : ''));
535
- chip.appendChild(el('div', 'name', a.agent + (a.role ? ' · ' + a.role : '')));
710
+ // The dot reads freshness off the strongest signal available — evidence
711
+ // beats a bare progress ping beats spawn time — the same precedence the
712
+ // server sorts the strip by.
713
+ var dotMs = ageMsOf(a.last_evidence || a.last_signal || a.since);
714
+ var nameRow = el('div', 'name');
715
+ nameRow.appendChild(el('span', 'dot ' + ageClass(dotMs), '●'));
716
+ nameRow.appendChild(el('span', null, a.agent + (a.role ? ' · ' + a.role : '')));
717
+ chip.appendChild(nameRow);
536
718
  chip.appendChild(el('div', null, (a.init ? a.init + ' · ' : '') + (a.ticket || 'no ticket') + ' · ' + a.state));
537
719
  // NOT the same statement as the age lines below, and the wording keeps
538
720
  // them apart on purpose. Those are wall-clock: "how long since it spoke,
@@ -601,7 +783,8 @@ if (data.schema !== 1) {
601
783
  var laneCount = function (name) { return (lanes[name] || []).length; };
602
784
  var ovTiles = el('div', 'tiles');
603
785
  ovTiles.appendChild(tile('waiting on you', String(asks.length),
604
- asks.length === 0 ? 'nothing blocked on a decision' : 'answer them on the next tab', asks.length > 0 ? 'lead' : null));
786
+ asks.length === 0 ? 'nothing blocked on a decision' : 'answer them on the next tab', asks.length > 0 ? 'lead' : null,
787
+ function () { select('questions'); }));
605
788
  // The headline number is the LIVE one. "Agents running" counted every open
606
789
  // spawn, so an initiative abandoned a week ago reported a busy fleet; the
607
790
  // stale ones are still counted, still listed in the strip, and now said out
@@ -611,15 +794,17 @@ if (data.schema !== 1) {
611
794
  staleCount > 0
612
795
  ? staleCount + ' more stale · across ' + (totals.initiatives || 0) + ' initiative(s)'
613
796
  : 'across ' + (totals.initiatives || 0) + ' initiative(s)',
614
- staleCount > 0 ? 'lead' : null));
797
+ staleCount > 0 ? 'lead' : null,
798
+ function () { select('overview'); if (agentsHeading) agentsHeading.scrollIntoView({ behavior: 'smooth' }); }));
615
799
  // An initiative with no tickets used to read "0% · 0 of 0 merged", which is
616
800
  // exactly what a fully stalled one reads. Nothing-started and
617
801
  // nothing-finished are different situations and deserve different words.
618
802
  ovTiles.appendChild((totals.tickets || 0) === 0
619
803
  ? tile('progress', '—', (totals.initiatives || 0) === 0
620
804
  ? 'no initiatives yet — run /tyran to start one'
621
- : 'no tickets declared yet')
622
- : tile('progress', (totals.percent || 0) + '%', (totals.merged || 0) + ' of ' + totals.tickets + ' merged'));
805
+ : 'no tickets declared yet', null, function () { select('board'); })
806
+ : tile('progress', (totals.percent || 0) + '%', (totals.merged || 0) + ' of ' + totals.tickets + ' merged',
807
+ null, function () { select('board'); }));
623
808
  // Counted by the server, from the lanes AND the agents. Counting lanes here
624
809
  // read zero while an agent chip on the same screen said "blocked", because a
625
810
  // ticket parked by an override leaves no card in the blocked lane.
@@ -628,7 +813,8 @@ if (data.schema !== 1) {
628
813
  : laneCount('blocked') + laneCount('changes-requested') + blockedAgents;
629
814
  ovTiles.appendChild(tile('needs a human', String(stuck),
630
815
  laneCount('blocked') + ' blocked · ' + laneCount('changes-requested') + ' changes requested · '
631
- + blockedAgents + ' agent(s) blocked', stuck > 0 ? 'warn' : null));
816
+ + blockedAgents + ' agent(s) blocked', stuck > 0 ? 'warn' : null,
817
+ function () { select('board'); }));
632
818
  ov.appendChild(ovTiles);
633
819
 
634
820
  // The bar only appears once there IS a baseline: on a first visit nothing
@@ -675,9 +861,86 @@ if (data.schema !== 1) {
675
861
  // The request names an initiative and a FILE NAME, never a path - the server
676
862
  // matches that name against its own fixed list (see board.mjs), so no URL
677
863
  // this page can build reaches a file Tyran did not already agree to show.
678
- // The markdown is rendered as TEXT in a pre, deliberately not parsed: these
679
- // documents are written by agents, and the rule this whole page keeps is
680
- // that nothing from that side ever becomes markup.
864
+ //
865
+ // The markdown is rendered STRUCTURALLY and nothing more. The rule this
866
+ // page keeps had to be restated when the <pre> went away (operator-decided
867
+ // 2026-08-19: the documents should read as documents): agent-written text
868
+ // may become headings, lists and code blocks — inert structure, every
869
+ // character still landing through textContent — but it never becomes an
870
+ // anchor, an image, raw HTML or anything that runs or navigates. A URL in
871
+ // a document stays a string you can read and copy, not a link you can be
872
+ // sent down.
873
+ //
874
+ // The backtick appears only as \\u0060: this whole script is one template
875
+ // literal, and a literal backtick anywhere inside it — even in a regex —
876
+ // terminates the template and takes the module down.
877
+ var mdInline = function (node, text) {
878
+ var re = /(\\u0060[^\\u0060]+\\u0060)|(\\*\\*[^*]+\\*\\*)|(\\*[^*]+\\*)/g;
879
+ var last = 0;
880
+ var m;
881
+ while ((m = re.exec(text)) !== null) {
882
+ if (m.index > last) node.appendChild(document.createTextNode(show(text.slice(last, m.index))));
883
+ var token = m[0];
884
+ if (m[1]) node.appendChild(el('code', null, token.slice(1, -1)));
885
+ else if (m[2]) node.appendChild(el('b', null, token.slice(2, -2)));
886
+ else node.appendChild(el('i', null, token.slice(1, -1)));
887
+ last = m.index + token.length;
888
+ }
889
+ if (last < text.length) node.appendChild(document.createTextNode(show(text.slice(last))));
890
+ };
891
+ var renderMarkdown = function (text) {
892
+ var root = el('div', 'docmd');
893
+ var lines = String(text).split('\\n');
894
+ var i = 0;
895
+ var list = null;
896
+ var para = null;
897
+ var closeBlocks = function () { list = null; para = null; };
898
+ while (i < lines.length) {
899
+ var line = lines[i];
900
+ if (/^\\s*\\u0060\\u0060\\u0060/.test(line)) {
901
+ closeBlocks();
902
+ var code = [];
903
+ i += 1;
904
+ while (i < lines.length && !/^\\s*\\u0060\\u0060\\u0060/.test(lines[i])) { code.push(lines[i]); i += 1; }
905
+ i += 1;
906
+ root.appendChild(el('pre', null, code.join('\\n')));
907
+ continue;
908
+ }
909
+ var h = line.match(/^(#{1,6})\\s+(.*)$/);
910
+ if (h) {
911
+ closeBlocks();
912
+ var hd = el('div', 'md-h l' + (h[1].length > 3 ? 3 : h[1].length));
913
+ mdInline(hd, h[2]);
914
+ root.appendChild(hd);
915
+ i += 1;
916
+ continue;
917
+ }
918
+ var item = line.match(/^\\s*(?:[-*+]|\\d+[.)])\\s+(.*)$/);
919
+ if (item) {
920
+ para = null;
921
+ if (!list) { list = el('ul'); root.appendChild(list); }
922
+ var li = el('li');
923
+ mdInline(li, item[1]);
924
+ list.appendChild(li);
925
+ i += 1;
926
+ continue;
927
+ }
928
+ if (/^\\s*\\|/.test(line)) {
929
+ // A table row stays one mono line: pipes that still line up beat a
930
+ // table half-parsed.
931
+ closeBlocks();
932
+ root.appendChild(el('div', 'md-table', line));
933
+ i += 1;
934
+ continue;
935
+ }
936
+ if (line.trim() === '') { closeBlocks(); i += 1; continue; }
937
+ if (!para) { para = el('p'); root.appendChild(para); }
938
+ else para.appendChild(document.createTextNode(' '));
939
+ mdInline(para, line);
940
+ i += 1;
941
+ }
942
+ return root;
943
+ };
681
944
  var loadDoc = function (init, file, view) {
682
945
  clear(view);
683
946
  view.appendChild(el('div', 'hint', 'reading ' + file.name + '…'));
@@ -699,9 +962,7 @@ if (data.schema !== 1) {
699
962
  close.addEventListener('click', function () { clear(view); });
700
963
  head.appendChild(close);
701
964
  view.appendChild(head);
702
- var pre = el('pre', 'doc');
703
- pre.textContent = payload.text;
704
- view.appendChild(pre);
965
+ view.appendChild(renderMarkdown(payload.text));
705
966
  if (payload.truncated === true) {
706
967
  view.appendChild(el('div', 'hint',
707
968
  'Shown to ' + payload.bytes + ' bytes and cut there — open ' + payload.path + ' for the rest.'));
@@ -726,7 +987,7 @@ if (data.schema !== 1) {
726
987
  return (ageMsOf(b.last_ts) || 0) - (ageMsOf(a.last_ts) || 0);
727
988
  });
728
989
  var finished = inits.filter(isClosed);
729
- ov.appendChild(el('h2', null, 'Initiatives'));
990
+ ov.appendChild(el('h2', null, '🧭 Initiatives'));
730
991
  if (stalled.length > 0) {
731
992
  ov.appendChild(el('div', 'hint',
732
993
  stalled.length + ' of ' + inits.length + ' are waiting on an answer from you. ' +
@@ -832,7 +1093,8 @@ if (data.schema !== 1) {
832
1093
  ov.appendChild(initDetail);
833
1094
  }
834
1095
 
835
- ov.appendChild(el('h2', null, 'Agents'));
1096
+ var agentsHeading = el('h2', null, '🤖 Agents');
1097
+ ov.appendChild(agentsHeading);
836
1098
  // Named, not implied by the order: the strip is sorted stalest-first by the
837
1099
  // server, and a reader who does not know that reads the first chip as the
838
1100
  // newest one.
@@ -845,7 +1107,7 @@ if (data.schema !== 1) {
845
1107
  // never omit: a missing card is indistinguishable from an initiative with
846
1108
  // no work, which is the "all is well" reading the board exists to prevent.
847
1109
  if (errors.length > 0) {
848
- ov.appendChild(el('h2', null, 'Unreadable (' + errors.length + ')'));
1110
+ ov.appendChild(el('h2', null, '🚨 Unreadable (' + errors.length + ')'));
849
1111
  errors.forEach(function (e) {
850
1112
  ov.appendChild(el('div', 'paused', 'UNREADABLE — ' + e.name + ': ' + e.error));
851
1113
  });
@@ -857,7 +1119,7 @@ if (data.schema !== 1) {
857
1119
  var logged = data.errors_logged || [];
858
1120
  if (logged.length > 0) {
859
1121
  var total = data.errors_logged_total || logged.length;
860
- ov.appendChild(el('h2', null, 'Errors logged (' + total + ')'));
1122
+ ov.appendChild(el('h2', null, '🚨 Errors logged (' + total + ')'));
861
1123
  ov.appendChild(el('div', 'hint', 'Agents recorded these as failures. Newest first. An error carrying no ticket belongs to the initiative rather than to any one card, which is why it appears here and in no lane.'));
862
1124
  logged.forEach(function (e) {
863
1125
  var text = (e.class || 'error') + (e.detail ? ': ' + e.detail : '')
@@ -876,7 +1138,7 @@ if (data.schema !== 1) {
876
1138
  if (warned.length > 0) {
877
1139
  var warnCount = 0;
878
1140
  warned.forEach(function (d) { warnCount += d.warnings.length; });
879
- ov.appendChild(el('h2', null, 'Warnings (' + warnCount + ')'));
1141
+ ov.appendChild(el('h2', null, '⚠️ Warnings (' + warnCount + ')'));
880
1142
  ov.appendChild(el('div', 'hint', 'These initiatives rendered. What follows is what the fold could not account for — a skipped line is missing from every lane above, and a lease released by a non-holder is still open.'));
881
1143
  warned.forEach(function (d) {
882
1144
  d.warnings.forEach(function (w) {
@@ -966,22 +1228,102 @@ if (data.schema !== 1) {
966
1228
  });
967
1229
  box.appendChild(tbl);
968
1230
  }
1231
+ // The ticket's own history, oldest first, assembled from the lifecycle
1232
+ // facts the payload already carries — spawn, report, review, merge. The
1233
+ // execution table above answers "what did it cost and on which model";
1234
+ // this answers "what happened, in what order", which is the reading a
1235
+ // stuck or bounced ticket is opened for.
1236
+ var tl = [];
1237
+ runs.forEach(function (r) {
1238
+ if (r.started) tl.push({ ts: r.started, text: r.agent + (r.role ? ' (' + r.role + ')' : '') + ' spawned' + (r.model ? ' on ' + r.model : '') });
1239
+ if (r.ended) tl.push({ ts: r.ended, text: r.agent + ' reported' + (r.verdict ? ': ' + r.verdict : '') });
1240
+ });
1241
+ if (card.review && card.review.ts) {
1242
+ tl.push({ ts: card.review.ts, text: 'review: ' + (card.review.verdict || 'no verdict') + (card.review.by ? ' by ' + card.review.by : '') });
1243
+ }
1244
+ if (card.merge && card.merge.ts) {
1245
+ tl.push({ ts: card.merge.ts, text: 'merged' + (card.merge.mode ? ' (' + card.merge.mode + ')' : ''), sha: card.merge.sha || null });
1246
+ }
1247
+ tl.sort(function (x, y) { return Date.parse(x.ts) - Date.parse(y.ts); });
1248
+ if (tl.length > 0) {
1249
+ box.appendChild(el('div', 'dt', 'Timeline'));
1250
+ var tlBox = el('div', 'tl');
1251
+ tl.forEach(function (evt) {
1252
+ var trow = el('div', 'tlr');
1253
+ trow.appendChild(el('span', 'tlt', ago(evt.ts)));
1254
+ trow.appendChild(el('span', null, evt.text));
1255
+ if (evt.sha) {
1256
+ trow.appendChild(el('code', null, evt.sha));
1257
+ var cp = el('button', 'copysha', 'copy sha');
1258
+ cp.setAttribute('type', 'button');
1259
+ cp.addEventListener('click', function () {
1260
+ // Clipboard access can be refused outright (file://, an old
1261
+ // browser); the fallback is showing the sha, which is what the
1262
+ // button was saving you from selecting by hand.
1263
+ try {
1264
+ navigator.clipboard.writeText(evt.sha).then(
1265
+ function () { cp.textContent = 'copied \\u2713'; },
1266
+ function () { cp.textContent = evt.sha; });
1267
+ } catch (e) { cp.textContent = evt.sha; }
1268
+ });
1269
+ trow.appendChild(cp);
1270
+ }
1271
+ tlBox.appendChild(trow);
1272
+ });
1273
+ box.appendChild(tlBox);
1274
+ }
1275
+ // Answering where you clicked. A ticket standing in waiting-operator IS
1276
+ // an open question, so the composer comes to the card instead of the
1277
+ // operator being sent to the Waiting tab to find the same question again.
1278
+ var openHere = asks.filter(function (q) {
1279
+ return (q.ticket || '') === (card.id || '') && (q.init || '') === (card.init || '');
1280
+ });
1281
+ if (lane === 'waiting-operator' && openHere.length > 0) {
1282
+ openHere.forEach(function (q) {
1283
+ box.appendChild(el('div', 'dt', '\\u2753 ' + (q.question || 'gate ' + q.kind)));
1284
+ box.appendChild(replyBox(q, q.default !== null && q.default !== undefined));
1285
+ });
1286
+ }
969
1287
  // The files this initiative ACTUALLY has, listed by the server after an
970
1288
  // existsSync — never a fixed list of what a well-run initiative ought to
971
- // contain. Paths, not links: the board serves three URLs and derives a
972
- // filesystem path from none of them, which is worth more than a click.
1289
+ // contain. Buttons since 2026-08-19, exactly like the initiative rows:
1290
+ // "which plan does this ticket serve" was a path you copied into an
1291
+ // editor, from a page that already knows how to open it.
973
1292
  var docs = (data.files || {})[card.init] || [];
974
1293
  if (docs.length > 0) {
975
1294
  box.appendChild(el('div', 'dt', 'Files'));
1295
+ var view = el('div', 'docview');
976
1296
  var list = el('div', 'files');
977
1297
  docs.forEach(function (f) {
978
1298
  var line = el('div', 'file');
979
- line.appendChild(el('span', 'fname', f.name));
1299
+ var open = el('button', 'fname', f.name);
1300
+ open.setAttribute('type', 'button');
1301
+ open.addEventListener('click', function () { loadDoc(card.init, f, view); });
1302
+ line.appendChild(open);
980
1303
  line.appendChild(el('code', null, f.path));
981
1304
  list.appendChild(line);
982
1305
  });
983
1306
  box.appendChild(list);
1307
+ box.appendChild(view);
1308
+ }
1309
+ // Where to go from here — only the jumps this ticket can actually make.
1310
+ var jumps = el('div', 'jumps');
1311
+ if (openHere.length > 0) {
1312
+ var toAsk = el('button', 'sbtn', 'Open in Waiting tab');
1313
+ toAsk.setAttribute('type', 'button');
1314
+ toAsk.addEventListener('click', function () {
1315
+ select('questions');
1316
+ if (openHere[0].tyranCard) openHere[0].tyranCard.scrollIntoView({ behavior: 'smooth' });
1317
+ });
1318
+ jumps.appendChild(toAsk);
1319
+ }
1320
+ if (cost && (cost.by_ticket || []).some(function (r) { return r.ticket === card.id; })) {
1321
+ var toSpend = el('button', 'sbtn', 'Spend for this ticket');
1322
+ toSpend.setAttribute('type', 'button');
1323
+ toSpend.addEventListener('click', function () { select('spend'); });
1324
+ jumps.appendChild(toSpend);
984
1325
  }
1326
+ if (jumps.childNodes.length > 0) box.appendChild(jumps);
985
1327
  detail.appendChild(box);
986
1328
  };
987
1329
  // A filter, because ten lanes across dozens of initiatives is a pile.
@@ -1053,7 +1395,7 @@ if (data.schema !== 1) {
1053
1395
  // event on the ticket, and only a human knows whether that is a stall or
1054
1396
  // a long test run.
1055
1397
  if (STALLABLE.indexOf(lane) !== -1 && c.since) {
1056
- button.appendChild(el('span', 'note ' + ageClass(ageMsOf(c.since)), 'no event ' + ago(c.since).replace(/ ago$/, '')));
1398
+ button.appendChild(el('span', 'note ' + ageClass(ageMsOf(c.since)), '● no event ' + ago(c.since).replace(/ ago$/, '')));
1057
1399
  }
1058
1400
  button.addEventListener('click', function () { showDetail(c, lane, button); });
1059
1401
  box.appendChild(button);
@@ -1123,17 +1465,18 @@ if (data.schema !== 1) {
1123
1465
  var replyBox = function (a, hasDefault) {
1124
1466
  var box = el('div', 'reply');
1125
1467
  var input = el('textarea');
1126
- // The shortcut is named where the cursor already is. "Answer" IS the send
1127
- // button and always was, but a labelled verb beside a text box reads as a
1128
- // mode switch rather than as send, and an operator who types an answer and
1129
- // presses Enter gets a newline with nothing to say why.
1468
+ // The shortcut is named where the cursor already is. The round arrow IS
1469
+ // the send button; Enter is the same statement made from the keyboard.
1130
1470
  input.placeholder = (hasDefault
1131
- ? 'Your answer, in your own words \\u2014 or use the default button.'
1471
+ ? 'Your answer, in your own words \\u2014 or use the default chip.'
1132
1472
  : 'Your answer, in your own words. There is no recorded default for this one.')
1133
- + ' \\u2318/Ctrl+Enter sends.';
1473
+ + ' Enter sends; Shift+Enter for a new line.';
1474
+ input.setAttribute('rows', '1');
1134
1475
  var acts = el('div', 'acts');
1135
- var send = el('button', 'sbtn', 'Answer');
1476
+ var send = el('button', 'sendbtn', '\\u27A4');
1136
1477
  send.setAttribute('type', 'button');
1478
+ send.setAttribute('aria-label', 'Send answer');
1479
+ send.title = 'Send \\u00b7 Enter';
1137
1480
  var useDefault = hasDefault ? el('button', 'sbtn', 'Take the default') : null;
1138
1481
  if (useDefault) useDefault.setAttribute('type', 'button');
1139
1482
  // The recommendation was already shown, as TEXT, and the only way to
@@ -1142,7 +1485,7 @@ if (data.schema !== 1) {
1142
1485
  // page: the agent has said what it thinks should happen and the human is
1143
1486
  // asked to transcribe it. This fills the box instead of submitting, so
1144
1487
  // the wording stays editable and the answer is still deliberate.
1145
- var useRec = a.recommendation ? el('button', 'sbtn', 'Use the recommendation') : null;
1488
+ var useRec = a.recommendation ? el('button', 'sbtn', '\\u2B50 Use the recommendation') : null;
1146
1489
  if (useRec) {
1147
1490
  useRec.setAttribute('type', 'button');
1148
1491
  useRec.addEventListener('click', function () {
@@ -1155,6 +1498,8 @@ if (data.schema !== 1) {
1155
1498
 
1156
1499
  var submit = function (text) {
1157
1500
  [send, useDefault].forEach(function (b) { if (b) b.disabled = true; });
1501
+ status.className = 'sstat';
1502
+ status.textContent = 'sending\\u2026';
1158
1503
  post('/answer', { init: a.init, kind: a.kind, answer: text }, status, function (ok) {
1159
1504
  if (!ok) {
1160
1505
  [send, useDefault].forEach(function (b) { if (b) b.disabled = false; });
@@ -1165,7 +1510,7 @@ if (data.schema !== 1) {
1165
1510
  // with a live box invites answering it twice.
1166
1511
  input.disabled = true;
1167
1512
  }, function (p) {
1168
- return (p.mode === 'default' ? 'answered with the recorded default' : 'answered')
1513
+ return 'sent \\u2713 ' + (p.mode === 'default' ? 'answered with the recorded default' : 'answered')
1169
1514
  + ': ' + p.recorded + ' \\u00b7 decision ' + p.decision + ' \\u2014 reload to refresh the board';
1170
1515
  });
1171
1516
  };
@@ -1181,15 +1526,17 @@ if (data.schema !== 1) {
1181
1526
  submit(input.value);
1182
1527
  };
1183
1528
  send.addEventListener('click', attempt);
1184
- // Enter ALONE must not send, and the modifier is not decoration. This is a
1185
- // textarea because an operator explaining a decision writes sentences, and
1186
- // what it sends is appended to a journal that can never take it back — a
1187
- // question closed by a stray keystroke is a decision nobody made. The
1529
+ // Enter sends; Shift+Enter is the newline (operator-decided 2026-08-19:
1530
+ // the box should answer like a chat). The earlier rule — modifier
1531
+ // required, because the journal can never take an answer back — is
1532
+ // retired deliberately, not forgotten: the empty-input guard in attempt()
1533
+ // still means a stray Enter on a blank box sends nothing, and an answer
1534
+ // with text in it is what the operator typed, not an accident. The
1188
1535
  // keyCode fallback is for a browser that reports no key on a dead-key
1189
1536
  // layout; a duplicate hit is harmless because the handler is idempotent
1190
1537
  // once the field disables itself.
1191
1538
  input.addEventListener('keydown', function (e) {
1192
- if ((e.metaKey || e.ctrlKey) && (e.key === 'Enter' || e.keyCode === 13)) {
1539
+ if (!e.shiftKey && (e.key === 'Enter' || e.keyCode === 13)) {
1193
1540
  e.preventDefault();
1194
1541
  attempt();
1195
1542
  }
@@ -1206,17 +1553,25 @@ if (data.schema !== 1) {
1206
1553
  // reload with nothing to show for it.
1207
1554
  input.addEventListener('input', function () { holdRefresh(); });
1208
1555
 
1209
- box.appendChild(input);
1210
- acts.appendChild(send);
1556
+ // Chips first, then the composer row: the canned moves read as choices
1557
+ // ABOVE the field, the way a chat offers suggested replies.
1211
1558
  if (useRec) acts.appendChild(useRec);
1212
1559
  if (useDefault) acts.appendChild(useDefault);
1213
- box.appendChild(acts);
1560
+ if (useRec || useDefault) box.appendChild(acts);
1561
+ var composer = el('div', 'composer');
1562
+ composer.appendChild(input);
1563
+ composer.appendChild(send);
1564
+ box.appendChild(composer);
1214
1565
  box.appendChild(status);
1215
1566
  box.appendChild(el('div', 'hint', 'Answering writes a decision and closes the gate in ' + a.init + '\\u2019s journal. Needs the board started with --write.'));
1216
1567
  return box;
1217
1568
  };
1218
1569
  asks.forEach(function (a) {
1219
1570
  var card = el('div', 'ask');
1571
+ // The element rides on the ask itself so a ticket's detail panel can
1572
+ // scroll the Waiting tab to exactly this card — the jump is a reference,
1573
+ // never a second lookup that could drift.
1574
+ a.tyranCard = card;
1220
1575
  // The one distinction that changes what an operator does about it, and it
1221
1576
  // costs no new event type to say: an ask WITH a recorded default is a
1222
1577
  // decision you may leave to the recommendation, and an ask without one is
@@ -1225,8 +1580,14 @@ if (data.schema !== 1) {
1225
1580
  var hasDefault = a.default !== null && a.default !== undefined;
1226
1581
  card.appendChild(el('span', 'kindtag ' + (hasDefault ? 'decision' : 'blocking'),
1227
1582
  hasDefault ? 'decision \\u00b7 a default is recorded' : 'blocking \\u00b7 no safe default'));
1583
+ // How long it has been standing, beside the kind — the number that turns
1584
+ // "a question exists" into "a question has waited a day". Clay after 24h.
1585
+ var waitMs = ageMsOf(a.since);
1586
+ if (waitMs !== null) {
1587
+ card.appendChild(el('span', 'waitchip' + (waitMs >= 86400000 ? ' long' : ''), 'waiting ' + durText(waitMs)));
1588
+ }
1228
1589
  card.appendChild(el('div', 'q', a.question || '(no question recorded — gate ' + a.kind + ')'));
1229
- [['answer with', a.kind], ['recommendation', a.recommendation], ['default', a.default],
1590
+ [['answer with', a.kind], ['⭐ recommendation', a.recommendation],
1230
1591
  ['blocks', a.blocks && a.blocks.count > 0 ? a.blocks.count + ' ticket(s): ' + a.blocks.ids.join(', ') : null],
1231
1592
  ['ticket', a.ticket], ['initiative', a.init], ['since', a.since]].forEach(function (pair) {
1232
1593
  if (pair[1] === null || pair[1] === undefined) return;
@@ -1235,6 +1596,15 @@ if (data.schema !== 1) {
1235
1596
  row.appendChild(el('span', null, pair[1]));
1236
1597
  card.appendChild(row);
1237
1598
  });
1599
+ // The default gets its own row and its own weight: it is the answer to
1600
+ // "what happens if I never come back to this", which is the sentence an
1601
+ // operator scanning fourteen questions actually decides with.
1602
+ if (hasDefault) {
1603
+ var defRow = el('div', 'row defrow');
1604
+ defRow.appendChild(el('span', 'label', 'default \\u2014 if you don\\u2019t answer'));
1605
+ defRow.appendChild(el('span', null, a.default));
1606
+ card.appendChild(defRow);
1607
+ }
1238
1608
  card.appendChild(replyBox(a, hasDefault));
1239
1609
  qs.appendChild(card);
1240
1610
  });
@@ -1759,6 +2129,29 @@ if (data.schema !== 1) {
1759
2129
 
1760
2130
  if (choiceNote) bodyCell.appendChild(choiceNote);
1761
2131
  bodyCell.appendChild(el('div', 'shelp', setting.help));
2132
+ // The long answer, folded shut (operator-asked 2026-08-19: every setting
2133
+ // should say what it means, what changes, and how it lands on Tyran).
2134
+ // Three labelled sentences, plus the widening cost when there is one —
2135
+ // stated HERE, before the confirm dialog restates it as a question.
2136
+ if (setting.explain) {
2137
+ var why = el('details', 'sexplain');
2138
+ why.appendChild(el('summary', null, 'What does this change?'));
2139
+ [['What it is', setting.explain.what],
2140
+ ['If you change it', setting.explain.changes],
2141
+ ['How it lands on Tyran', setting.explain.effect],
2142
+ ['Loosening it means', setting.widens]].forEach(function (pair) {
2143
+ if (!pair[1]) return;
2144
+ var line = el('div', 'sexline');
2145
+ line.appendChild(el('b', null, pair[0] + ': '));
2146
+ line.appendChild(el('span', null, pair[1]));
2147
+ why.appendChild(line);
2148
+ });
2149
+ // An open explainer must not be yanked shut by the 30-second reload
2150
+ // mid-read; the held tab already stops the timer, this is for the
2151
+ // reader who opened it from a fresh load.
2152
+ why.addEventListener('toggle', function () { if (why.open) holdRefresh(); });
2153
+ bodyCell.appendChild(why);
2154
+ }
1762
2155
  bodyCell.appendChild(status);
1763
2156
  return row;
1764
2157
  };
@@ -1876,7 +2269,15 @@ if (data.schema !== 1) {
1876
2269
  (run.paused.used_percentage === null ? 'the threshold' : run.paused.used_percentage + '%') +
1877
2270
  '. Resumes ' + (run.paused.wait || 'later') + '.');
1878
2271
  }
1879
- if (run.watcher && run.watcher.alive === false) {
2272
+ // A dead watcher is only news while something is waiting to be
2273
+ // resumed. resume.json outlives its own cancellation — overnight
2274
+ // cancel writes state 'cancelled' rather than deleting the file —
2275
+ // so alive:false with no pause marker and no 'waiting' claim is a
2276
+ // leftover, not a failure. Measured 2026-08-19 on a live board: the
2277
+ // banner burned on a watcher cancelled the previous day, on a repo
2278
+ // with overnight mode off and nothing paused at all.
2279
+ var watcherMatters = run.paused !== null || (run.watcher && run.watcher.state === 'waiting');
2280
+ if (watcherMatters && run.watcher && run.watcher.alive === false) {
1880
2281
  lines.push('The resume watcher is not running, so nothing will restart this by itself.');
1881
2282
  }
1882
2283
  if (run.usage && run.usage.stale === true) {
@@ -1946,11 +2347,42 @@ if (data.schema !== 1) {
1946
2347
  window.addEventListener('hashchange', function () { select(tabFromHash()); });
1947
2348
 
1948
2349
  var foot = el('footer');
2350
+ // The same sentence the docs site signs off with, links and the one red
2351
+ // heart included — the board is the surface an operator actually lives on.
2352
+ var made = el('div', 'made');
2353
+ made.appendChild(el('span', null, 'From Berlin with '));
2354
+ made.appendChild(el('span', 'heart', '♥'));
2355
+ made.appendChild(el('span', null, ' by two buddies \\u2014 '));
2356
+ var madeSite = el('a', null, 'Jacek');
2357
+ madeSite.href = 'https://janczura.com/en/';
2358
+ madeSite.target = '_blank';
2359
+ madeSite.rel = 'noopener';
2360
+ made.appendChild(madeSite);
2361
+ made.appendChild(el('span', null, ' ('));
2362
+ var madeLi = el('a', null, 'LinkedIn');
2363
+ madeLi.href = 'https://linkedin.com/in/jacekjanczura';
2364
+ madeLi.target = '_blank';
2365
+ madeLi.rel = 'noopener';
2366
+ made.appendChild(madeLi);
2367
+ made.appendChild(el('span', null, ') and Piotr.'));
2368
+ foot.appendChild(made);
1949
2369
  foot.appendChild(el('div', null, 'GENERATED by tyran scripts/board.mjs — do not edit. Reloads itself every 30 s unless you are editing; ages are computed in this browser.'));
1950
2370
  app.appendChild(foot);
1951
2371
  }
1952
2372
  `;
1953
2373
 
2374
+ /**
2375
+ * Applies a stored theme override BEFORE first paint, in the head, so a
2376
+ * dark-choosing operator on a light OS never sees the page flash light for a
2377
+ * frame. Static bytes — it reads localStorage and nothing else, so it never
2378
+ * threatens the byte-compare under --check. The main script only mirrors and
2379
+ * moves the choice; this is what makes it visible on load.
2380
+ */
2381
+ const THEME_SCRIPT =
2382
+ '<script>(function () { try { var t = localStorage.getItem("tyran-board-theme");'
2383
+ + ' if (t === "light" || t === "dark") document.documentElement.setAttribute("data-theme", t);'
2384
+ + ' } catch (e) {} })();</script>\n';
2385
+
1954
2386
  /**
1955
2387
  * The page, from an already-serialized cross-board JSON string (the exact
1956
2388
  * bytes of board.json, so the two artefacts can never disagree). The extra
@@ -1974,6 +2406,7 @@ export function renderBoardError(message) {
1974
2406
  '<meta name="viewport" content="width=device-width, initial-scale=1">\n' +
1975
2407
  '<title>Tyran board — cannot render</title>\n' +
1976
2408
  `<style>${CSS}</style>\n` +
2409
+ THEME_SCRIPT +
1977
2410
  '</head><body><main id="app"></main>\n' +
1978
2411
  `<script type="application/json" id="board-error">${data}</script>\n` +
1979
2412
  '<script>\n' +
@@ -2007,6 +2440,7 @@ export function renderBoardHtml(payloadJsonText) {
2007
2440
  '<meta name="tyran-refresh" content="30">\n' +
2008
2441
  '<title>Tyran board</title>\n' +
2009
2442
  `<style>${CSS}</style>\n` +
2443
+ THEME_SCRIPT +
2010
2444
  '</head><body><main id="app"></main>\n' +
2011
2445
  `<script type="application/json" id="board-data">${embedded}</script>\n` +
2012
2446
  `<script>${CLIENT_JS}</script>\n` +