@gemboss/ui 0.68.0 → 0.69.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +148 -5
  2. package/README.md +89 -9
  3. package/catalog/editor.html +10 -8
  4. package/catalog/index.html +617 -566
  5. package/gemboss-ui.css +3 -3
  6. package/package.json +5 -2
  7. package/parts/components.css +1 -1
  8. package/parts/core.css +1 -1
  9. package/parts/shell.css +1 -1
  10. package/src/assistant/attachments.tsx +486 -0
  11. package/src/assistant/chat-cards.tsx +343 -0
  12. package/src/assistant/chat.tsx +29 -6
  13. package/src/assistant/host.tsx +8 -11
  14. package/src/assistant/index.ts +8 -1
  15. package/src/assistant-chat.css +1 -1
  16. package/src/assistant-plain.js +1 -1
  17. package/src/assistant.css +1 -1
  18. package/src/auth-field.css +1 -1
  19. package/src/auth.tsx +4 -2
  20. package/src/chat-attachments.css +1 -0
  21. package/src/chat-cards.css +1 -0
  22. package/src/chat-plain.js +5 -5
  23. package/src/collections.tsx +8 -1
  24. package/src/editor/controls.tsx +51 -10
  25. package/src/editor/field-frame.tsx +4 -10
  26. package/src/editor/index.ts +2 -4
  27. package/src/editor/inspector-frame.tsx +143 -32
  28. package/src/editor/items-field.tsx +8 -3
  29. package/src/editor/items.ts +30 -6
  30. package/src/editor/panel.tsx +4 -5
  31. package/src/editor-inspector-frame.css +1 -1
  32. package/src/editor-media.css +1 -0
  33. package/src/editor-plain.js +1 -1
  34. package/src/editor-rail.css +1 -1
  35. package/src/editor.css +1 -1
  36. package/src/email-editor/editor.tsx +96 -69
  37. package/src/email-editor.css +1 -1
  38. package/src/gem-at-work.css +1 -1
  39. package/src/gem-at-work.ts +177 -33
  40. package/src/gem-holo.css +1 -1
  41. package/src/icons.tsx +42 -0
  42. package/src/index-table-extras.css +1 -0
  43. package/src/index-table.tsx +37 -16
  44. package/src/menu.tsx +7 -3
  45. package/src/narration.css +1 -1
  46. package/src/selection.tsx +22 -12
  47. package/src/editor/chips.tsx +0 -24
  48. package/src/editor-chips.css +0 -1
@@ -0,0 +1,343 @@
1
+ "use client";
2
+
3
+ /**
4
+ * WHAT CAN APPEAR IN THE CHAT STREAM, BESIDE WORDS — @gemboss/ui (11/11/2026, Chris on the UI/UX canvas, board ChatKit "kho thành phần":
5
+ * "sưu tầm từ code và bổ sung kho các element/component sẽ xuất hiện trong khung chat … để còn tái sử dụng ở những chỗ khác", then
6
+ * "code kỹ cái khung chat … update cho tất cả các service theo gemboss ui").
7
+ *
8
+ * Until now the admin drew these in its own files (components/chat: ChatActions, DecideThing, TurnTextChanges, ChatPageBands, the
9
+ * feedback row and the choices inside GemChat), so no other surface could show a card, a poll or a change list the same way. They are
10
+ * the kit's now, grown from that code: same class names where the admin's sheet, its tests and its gates already name them
11
+ * (`gemboss-ec-*`), one new generic card (`gb-chat-card`) the result, the preview and any surface's own card are built on.
12
+ *
13
+ * The parts, as the board numbers them:
14
+ * ChatCard a thing the turn made or is making: picture, tag, title, one line, a bar while it runs, a note, buttons (10–12).
15
+ * ChatChoices the answer's choices: plain chips (05) or a poll with "Gem's pick" and "Something else" (06).
16
+ * ChatDecide the question waiting over the message box (07), with ChatThing for what it is about.
17
+ * ChatTextChanges the words a turn rewrote: old struck, new under it (14).
18
+ * ChatPageBands a page's sections as bars (13).
19
+ * ChatCta buttons that go somewhere the chat cannot do the work (16).
20
+ * ChatFeedback under a finished answer: helpful, not helpful, copy (22).
21
+ *
22
+ * Icons come from the kit's set only (<Icon>): no ✕ ⌖ 👍 → text glyphs, no Polaris icons (other services cannot use those).
23
+ * Every word a button says is English by default (Chris 03/10/2026: the chrome is English), and each part takes its words as props.
24
+ */
25
+ // Its own sheet, and the two that draw parts it shares with the chat body: chips and the poll's touch size (chat.css), the waiting box
26
+ // (assistant-chat.css). A surface that imports ChatChoices or ChatDecide alone gets them styled (review: chat.tsx may be tree-shaken away).
27
+ import "../chat.css";
28
+ import "../assistant-chat.css";
29
+ import "../chat-cards.css";
30
+ import React, { useEffect, useRef, useState, type ReactNode } from "react";
31
+ import { Icon, type IconName } from "../icons";
32
+ import { copyText } from "./engine";
33
+
34
+ const cx = (...p: Array<string | false | null | undefined>) => p.filter(Boolean).join(" ");
35
+
36
+ // ── The card ───────────────────────────────────────────────────────────────────────────────────────────────────────────────
37
+
38
+ /** What a card's tag says about it: an answer (iris), a change made (green), a job running or waiting (the brand's soft). */
39
+ export type ChatCardTone = "answer" | "change" | "job";
40
+ export interface ChatCardTag { label: ReactNode; tone?: ChatCardTone }
41
+
42
+ export interface ChatCardProps {
43
+ /** What it is: "New section: FAQ", "A new theme for your store". */
44
+ title: ReactNode;
45
+ /** One quiet line under the title: where it lives, its state ("Product page · Draft"). */
46
+ meta?: ReactNode;
47
+ /** A picture on the left: an <img>, a page poster, a button around one. Sized by the surface; the slot only places it. */
48
+ thumb?: ReactNode;
49
+ /** Or a kit icon in a 40px tile (a test, an inbox item). Ignored when `thumb` is given. */
50
+ icon?: IconName;
51
+ /** A small pill over the title: "Building…", "Draft · not live yet", "Changed". */
52
+ tag?: ChatCardTag;
53
+ /** 0–100: a bar under the title, only while there is one to show (a job running). Absent: no bar. */
54
+ pct?: number | null;
55
+ /** The bar's name for a screen reader (default "Progress"). */
56
+ pctLabel?: string;
57
+ /** A line under everything else (a reassurance, an undo outcome). */
58
+ note?: ReactNode;
59
+ /** Its buttons: ChatCardButton, or anything a surface needs there. */
60
+ actions?: ReactNode;
61
+ /** It is still being made: says so to a screen reader (aria-busy) and quietens the card. */
62
+ busy?: boolean;
63
+ className?: string;
64
+ }
65
+
66
+ /** A thing the turn made or is making (the board's job card, change card and result, one shape). */
67
+ export function ChatCard({ title, meta, thumb, icon, tag, pct, pctLabel, note, actions, busy, className }: ChatCardProps) {
68
+ const bar = typeof pct === "number" && Number.isFinite(pct) ? Math.min(100, Math.max(0, pct)) : null;
69
+ return (
70
+ <div className={cx("gb-chat-card", busy && "is-busy", className)} aria-busy={busy || undefined}>
71
+ {thumb ? <div className="gb-chat-card-thumb">{thumb}</div>
72
+ : icon ? <span className="gb-chat-card-icon" aria-hidden="true"><Icon name={icon} /></span> : null}
73
+ <div className="gb-chat-card-body">
74
+ {tag ? <span className="gb-chat-card-tag" data-tone={tag.tone ?? "answer"}>{tag.label}</span> : null}
75
+ <span className="gb-chat-card-title">{title}</span>
76
+ {meta ? <span className="gb-chat-card-meta">{meta}</span> : null}
77
+ {bar !== null ? (
78
+ <span className="gb-chat-card-bar" role="progressbar" aria-label={pctLabel ?? "Progress"} aria-valuemin={0} aria-valuemax={100} aria-valuenow={Math.round(bar)}>
79
+ <span style={{ width: `${bar}%` }} />
80
+ </span>
81
+ ) : null}
82
+ {note ? <span className="gb-chat-card-note">{note}</span> : null}
83
+ {actions ? <div className="gb-chat-card-actions">{actions}</div> : null}
84
+ </div>
85
+ </div>
86
+ );
87
+ }
88
+
89
+ /** A card's button: a link-weight action ("Open", "Open editor"); `primary` in the brand's colour with an arrow, the rest muted. */
90
+ export function ChatCardButton({ children, onPress, primary, disabled, label, title }: {
91
+ children: ReactNode; onPress: () => void; primary?: boolean; disabled?: boolean;
92
+ /** An accessible name when the words alone are not enough. */
93
+ label?: string; title?: string;
94
+ }) {
95
+ return (
96
+ <button type="button" className={cx("gb-chat-card-btn", primary && "is-primary")} onClick={onPress} disabled={disabled} aria-label={label} title={title}>
97
+ {children}{primary ? <Icon name="chevronRight" size={16} /> : null}
98
+ </button>
99
+ );
100
+ }
101
+
102
+ // ── Choices ────────────────────────────────────────────────────────────────────────────────────────────────────────────────
103
+
104
+ /** One choice: its words, or words with a line under them, Gem's pick, a picture (a product's photo). */
105
+ export type ChatChoiceItem = string | { label: string; hint?: ReactNode; recommended?: boolean; picture?: ReactNode };
106
+
107
+ const isRich = (o: ChatChoiceItem) => typeof o !== "string" && Boolean(o.hint || o.recommended || o.picture);
108
+ /** A choice's words. Read through the union, not the caller's `T`: narrowing a generic on `typeof` leaves `T & string`, whose `.label` tsc rejects. */
109
+ const labelOf = (o: ChatChoiceItem): string => (typeof o === "string" ? o : o.label);
110
+
111
+ export interface ChatChoicesProps<T extends ChatChoiceItem> {
112
+ options: readonly T[];
113
+ onChoose: (option: T) => void;
114
+ /** A turn is running: every choice off (pressed now it would land in the middle of it). */
115
+ busy?: boolean;
116
+ /** Which choices are cards (a hint, Gem's pick, a picture): the rest are chips. Any card makes the list a poll, a column where the
117
+ * chips sit among the cards. Default: a choice with a hint, a pick or a picture. */
118
+ rich?: (option: T) => boolean;
119
+ /** A choice's picture, read by the surface (a product's photo by its id). Wins over the choice's own `picture`. */
120
+ pictureOf?: (option: T, index: number) => ReactNode;
121
+ /** A choice's line under its words, read by the surface (a product's price before its hint). Wins over the choice's own `hint`;
122
+ * null/undefined falls back to it, as `pictureOf` does. */
123
+ hintOf?: (option: T, index: number) => ReactNode;
124
+ /** The pill on the recommended choice (default "Gem's pick"). */
125
+ pickLabel?: string;
126
+ /** The poll's last row, the way out when none fits: "Something else · Type it below"; pressing it puts the person in the box. A poll
127
+ * only (a chip row is two words; the box is right under it). Absent: no row. */
128
+ other?: { onPick: () => void; label?: string; hint?: string };
129
+ }
130
+
131
+ /** The answer's choices (the board's 05 and 06). Pressing one is the surface's: it sends it, or does what the choice says. */
132
+ export function ChatChoices<T extends ChatChoiceItem>({ options, onChoose, busy, rich, pictureOf, hintOf, pickLabel = "Gem's pick", other }: ChatChoicesProps<T>) {
133
+ if (!options.length) return null;
134
+ const isCard = rich ?? isRich;
135
+ const poll = options.some(isCard);
136
+ if (!poll) {
137
+ return (
138
+ <div className="gemboss-ec-chips">
139
+ {options.map((o, i) => (
140
+ <button key={i} type="button" className="gemboss-ec-chip" disabled={busy} onClick={() => onChoose(o)}>{labelOf(o)}</button>
141
+ ))}
142
+ </div>
143
+ );
144
+ }
145
+ return (
146
+ <div className="gemboss-ec-poll">
147
+ {options.map((o, i) => {
148
+ if (!isCard(o)) return <button key={i} type="button" className="gemboss-ec-chip" disabled={busy} onClick={() => onChoose(o)}>{labelOf(o)}</button>;
149
+ const c: ChatChoiceItem = o;
150
+ const picture = pictureOf?.(o, i) ?? (typeof c === "string" ? null : c.picture);
151
+ const hint = hintOf?.(o, i) ?? (typeof c === "string" ? null : c.hint);
152
+ const pick = typeof c !== "string" && c.recommended;
153
+ return (
154
+ <button key={i} type="button" className="gemboss-ec-opt" disabled={busy} onClick={() => onChoose(o)}>
155
+ {picture ? <span className="gemboss-ec-opt-pic" aria-hidden="true">{picture}</span> : null}
156
+ <span className="gemboss-ec-opt-col">
157
+ <span className="gemboss-ec-opt-label">{labelOf(c)}</span>
158
+ {hint ? <span className="gemboss-ec-opt-hint">{hint}</span> : null}
159
+ </span>
160
+ {pick ? <span className="gemboss-ec-opt-rec">{pickLabel}</span> : null}
161
+ </button>
162
+ );
163
+ })}
164
+ {other ? (
165
+ <button type="button" className="gemboss-ec-opt gemboss-ec-opt-other" disabled={busy} onClick={other.onPick}>
166
+ <span className="gemboss-ec-opt-col">
167
+ <span className="gemboss-ec-opt-label">{other.label ?? "Something else"}</span>
168
+ <span className="gemboss-ec-opt-hint">{other.hint ?? "Type it below"}</span>
169
+ </span>
170
+ </button>
171
+ ) : null}
172
+ </div>
173
+ );
174
+ }
175
+
176
+ // ── The question waiting on the person ─────────────────────────────────────────────────────────────────────────────────────
177
+
178
+ /**
179
+ * The last answer's question, over the message box while it waits (the board's 07): a line that says so, what it is about (ChatThing),
180
+ * the question in bold, then the choices the surface puts in it (ChatChoices). Its look is the kit's `.gemboss-ec-decide`
181
+ * (assistant-chat.css, 0.49).
182
+ */
183
+ export function ChatDecide({ label, thing, question, children }: { label: string; thing?: ReactNode; question?: ReactNode; children?: ReactNode }) {
184
+ return (
185
+ <div className="gemboss-ec-decide" role="group" aria-label={label}>
186
+ <span className="gemboss-ec-decide-label">{label}</span>
187
+ {thing}
188
+ {question ? <b className="gb-chat-question">{question}</b> : null}
189
+ {children}
190
+ </div>
191
+ );
192
+ }
193
+
194
+ /** What a waiting question is about: its picture, its name, one line (a page's poster and status, a product's photo and price). */
195
+ export function ChatThing({ picture, name, meta }: { picture?: ReactNode; name: ReactNode; meta?: ReactNode }) {
196
+ return (
197
+ <div className="gb-chat-thing">
198
+ {picture ? <span className="gb-chat-thing-pic">{picture}</span> : null}
199
+ <span className="gb-chat-thing-col">
200
+ <b className="gb-chat-thing-name">{name}</b>
201
+ {meta ? <span className="gb-chat-thing-meta">{meta}</span> : null}
202
+ </span>
203
+ </div>
204
+ );
205
+ }
206
+
207
+ // ── The words a turn rewrote ───────────────────────────────────────────────────────────────────────────────────────────────
208
+
209
+ export interface ChatTextChange { before: ReactNode; after: ReactNode; /** Where it is on the page ("Hero · heading"). */ where?: ReactNode }
210
+
211
+ /** The lines a turn rewrote (the board's 14): where, the old words struck, the new ones under them. Nothing when there are none. */
212
+ export function ChatTextChanges({ changes, wasLabel = "Was: ", nowLabel = "Now: " }: { changes: readonly ChatTextChange[]; wasLabel?: string; nowLabel?: string }) {
213
+ if (!changes.length) return null;
214
+ return (
215
+ <div className="gemboss-ec-textchanges" data-turn-text-changes="">
216
+ {changes.map((c, k) => (
217
+ <div key={k} className="gemboss-ec-textchange">
218
+ {c.where ? <span className="gemboss-ec-textchange-where">{c.where}</span> : null}
219
+ <del className="gemboss-ec-textchange-was"><span className="ui-sr-only">{wasLabel}</span>{c.before}</del>
220
+ <ins className="gemboss-ec-textchange-now"><span className="ui-sr-only">{nowLabel}</span>{c.after}</ins>
221
+ </div>
222
+ ))}
223
+ </div>
224
+ );
225
+ }
226
+
227
+ // ── A page's sections as bars ──────────────────────────────────────────────────────────────────────────────────────────────
228
+
229
+ export interface ChatPageBand {
230
+ label: ReactNode;
231
+ /** 0–100, or null when it was not measured (drawn "—", no bar). */
232
+ pct: number | null;
233
+ /** How strong the bar is drawn, 0–1 (one hue at a few strengths; default full). */
234
+ strength?: number;
235
+ /** A line of its own under the bar, in the danger colour ("14 frustrated clicks"). */
236
+ alert?: ReactNode;
237
+ }
238
+
239
+ /**
240
+ * A page's sections as bars under an answer about it (the board's 13; the admin's reach card): the page, what the numbers are, one
241
+ * bar per section, what is left out, and one button to the full view. Every word is the surface's.
242
+ */
243
+ export function ChatPageBands({ page, caption, notes, bands, more, openLabel, onOpen }: {
244
+ page: ReactNode; caption?: ReactNode; notes?: ReactNode[]; bands: readonly ChatPageBand[]; more?: ReactNode;
245
+ openLabel?: string; onOpen?: () => void;
246
+ }) {
247
+ return (
248
+ <div className="gemboss-ec-pagecard">
249
+ <div className="gemboss-ec-pagecard-head">
250
+ <span className="gemboss-ec-pagecard-page">{page}</span>
251
+ {caption ? <span className="gemboss-ec-pagecard-caption">{caption}</span> : null}
252
+ </div>
253
+ {(notes ?? []).filter(Boolean).map((n, i) => <div key={i} className="gemboss-ec-pagecard-note">{n}</div>)}
254
+ <ul className="gemboss-ec-pagecard-bands">
255
+ {bands.map((b, i) => {
256
+ const pct = b.pct === null ? null : Math.round(Math.min(100, Math.max(0, b.pct)));
257
+ return (
258
+ <li key={i} className="gemboss-ec-pagecard-band">
259
+ <span className="gemboss-ec-pagecard-label">{b.label}</span>
260
+ <span className="gemboss-ec-pagecard-value"><span className="gemboss-ec-pagecard-pct">{pct === null ? "—" : `${pct}%`}</span></span>
261
+ <span className="gemboss-ec-pagecard-track" aria-hidden="true">
262
+ {pct !== null ? <span className="gemboss-ec-pagecard-fill" style={{ width: `${Math.max(2, pct)}%`, opacity: b.strength ?? 1 }} /> : null}
263
+ </span>
264
+ {b.alert ? <span className="gemboss-ec-pagecard-stuck">{b.alert}</span> : null}
265
+ </li>
266
+ );
267
+ })}
268
+ </ul>
269
+ {more ? <div className="gemboss-ec-pagecard-more">{more}</div> : null}
270
+ {openLabel && onOpen ? <button type="button" className="gemboss-ec-pagecard-open" onClick={onOpen}>{openLabel}</button> : null}
271
+ </div>
272
+ );
273
+ }
274
+
275
+ // ── Buttons that go somewhere else ─────────────────────────────────────────────────────────────────────────────────────────
276
+
277
+ export interface ChatCtaAction {
278
+ label: ReactNode;
279
+ onPress: () => void;
280
+ /** The one to take: filled, with an arrow. The rest are outlined. */
281
+ primary?: boolean;
282
+ disabled?: boolean;
283
+ /** Why it is off, or what it opens. */
284
+ title?: string;
285
+ key?: string;
286
+ }
287
+
288
+ /** Buttons under an answer that lead to the screen where the work is done (the board's 16). They wrap; each grows with its words. */
289
+ export function ChatCta({ actions, className }: { actions: readonly ChatCtaAction[]; className?: string }) {
290
+ if (!actions.length) return null;
291
+ return (
292
+ <div className={cx("gemboss-ec-cta", className)}>
293
+ {actions.map((a, i) => (
294
+ <button key={a.key ?? i} type="button" className={cx("gemboss-ec-cta-btn", a.primary ? "primary" : "ghost")} disabled={a.disabled} title={a.title} onClick={a.onPress}>
295
+ {a.label}{a.primary ? <Icon name="chevronRight" size={16} className="gemboss-ec-cta-arrow" /> : null}
296
+ </button>
297
+ ))}
298
+ </div>
299
+ );
300
+ }
301
+
302
+ // ── Under a finished answer ────────────────────────────────────────────────────────────────────────────────────────────────
303
+
304
+ export type ChatRating = "up" | "down";
305
+
306
+ /**
307
+ * Under a finished answer (the board's 22): Helpful, Not helpful, Copy. A rating is given once (both buttons off after, the one given
308
+ * shown pressed); a surface that keeps no ratings leaves `onRate` out and only Copy is drawn. Copy says "Copied" to a screen reader.
309
+ */
310
+ export function ChatFeedback({ rating, onRate, copyText: text, labels }: {
311
+ rating?: ChatRating | null;
312
+ onRate?: (rating: ChatRating) => void;
313
+ copyText?: string;
314
+ labels?: { up?: string; down?: string; copy?: string; copied?: string };
315
+ }) {
316
+ const [copied, setCopied] = useState(false);
317
+ const timer = useRef<number | undefined>(undefined);
318
+ useEffect(() => () => window.clearTimeout(timer.current), []);
319
+ if (!onRate && !text) return null;
320
+ const L = { up: "Helpful", down: "Not helpful", copy: "Copy", copied: "Copied", ...labels };
321
+ const rate = (r: ChatRating) => (
322
+ <button type="button" className={cx("gemboss-ec-fb-btn", rating === r && "on")} aria-label={r === "up" ? L.up : L.down} title={r === "up" ? L.up : L.down}
323
+ aria-pressed={rating === r} disabled={Boolean(rating)} onClick={() => onRate?.(r)}>
324
+ <Icon name={r === "up" ? "thumbsUp" : "thumbsDown"} size={16} />
325
+ </button>
326
+ );
327
+ return (
328
+ <div className="gemboss-ec-fb">
329
+ {onRate ? <>{rate("up")}{rate("down")}</> : null}
330
+ {text ? (
331
+ <button type="button" className={cx("gemboss-ec-fb-btn", copied && "on")} aria-label={L.copy} title={L.copy} onClick={async () => {
332
+ if (!(await copyText(text))) return;
333
+ setCopied(true);
334
+ window.clearTimeout(timer.current);
335
+ timer.current = window.setTimeout(() => setCopied(false), 1500);
336
+ }}>
337
+ <Icon name={copied ? "check" : "copy"} size={16} />
338
+ </button>
339
+ ) : null}
340
+ {text ? <span className="ui-sr-only" role="status">{copied ? L.copied : ""}</span> : null}
341
+ </div>
342
+ );
343
+ }
@@ -35,6 +35,8 @@ import { DICTATION_NOTE, useDictation } from "./dictation";
35
35
  import { EngineMark } from "./engine-mark";
36
36
  import { isEngineMarkId } from "./engine-mark-art";
37
37
  import { CODE_FOLD_LINES, linkTarget, parseBlocks, parseInline, type Block, type ImageHost } from "./chat-markdown";
38
+ import { GemHolo } from "../gem-holo";
39
+ import { Icon, type IconName } from "../icons";
38
40
 
39
41
  const cx = (...p: Array<string | false | null | undefined>) => p.filter(Boolean).join(" ");
40
42
  const useBeforePaint = typeof window === "undefined" ? useEffect : useLayoutEffect;
@@ -332,6 +334,26 @@ const THINK_CLASS = { running: "gemboss-narr-row thinking running", ok: "gemboss
332
334
  const TRACE_CLASS = { running: "gemboss-narr-row trace running", ok: "gemboss-narr-row trace ok", failed: "gemboss-narr-row trace failed" } as const;
333
335
  const STEER_CLASS = { running: "gemboss-narr-row steer running", ok: "gemboss-narr-row steer ok", failed: "gemboss-narr-row steer failed" } as const;
334
336
 
337
+ /**
338
+ * THE MARK AT THE START OF A ROW (11/11/2026, Chris: "đổi icon các thứ cho đồng bộ"; canvas board ChatKit): from the GemBoss
339
+ * set, not ✓ ✕ · ✳ ❯ ⏺ typed as text in a font that drew each at its own size and weight. Done `check`, failed `close`, running
340
+ * or a call `dot` (static: the heartbeat under the turn is the only thing that moves), a thought `sparkle`, the user's own line
341
+ * typed into a running turn `chevronRight`, a plan's step `square` / `squareCheck`. The admin's NarrationTimeline draws its
342
+ * rows with this too, so every chat in the fleet marks a step the same way.
343
+ */
344
+ export type ChatStepMarkKind = "step" | "thinking" | "trace" | "steer" | "plan";
345
+ export function chatStepMarkIcon(kind: ChatStepMarkKind, state: "running" | "ok" | "failed" | "paused" | "open" | "done"): IconName {
346
+ if (kind === "thinking") return "sparkle";
347
+ if (kind === "steer") return "chevronRight";
348
+ if (kind === "plan") return state === "done" || state === "ok" ? "squareCheck" : "square";
349
+ if (state === "failed") return "close";
350
+ if (state === "ok" || state === "done") return kind === "trace" ? "dot" : "check";
351
+ return "dot";
352
+ }
353
+ export function ChatStepMark({ kind = "step", state = "ok", className }: { kind?: ChatStepMarkKind; state?: "running" | "ok" | "failed" | "paused" | "open" | "done"; className?: string }) {
354
+ return <span className={cx("gemboss-narr-dot", className)} aria-hidden="true"><Icon name={chatStepMarkIcon(kind, state)} size={12} /></span>;
355
+ }
356
+
335
357
  /** What the assistant did on the way to its answer, one row per step. */
336
358
  export function ChatSteps({ steps, label }: { steps: readonly ChatStep[]; label?: string }) {
337
359
  const L = useLabels();
@@ -343,7 +365,7 @@ export function ChatSteps({ steps, label }: { steps: readonly ChatStep[]; label?
343
365
  if (s.kind === "thinking") {
344
366
  return (
345
367
  <li key={s.id} className={THINK_CLASS[state]}>
346
- <span className="gemboss-narr-dot" aria-hidden="true">✳</span>
368
+ <ChatStepMark kind="thinking" state={state} />
347
369
  {state === "running" || !s.detail ? (
348
370
  <span className="gemboss-narr-text gemboss-narr-thinking-live">{s.label || L.thinking}</span>
349
371
  ) : (
@@ -358,7 +380,7 @@ export function ChatSteps({ steps, label }: { steps: readonly ChatStep[]; label?
358
380
  if (s.kind === "steer") {
359
381
  return (
360
382
  <li key={s.id} className={STEER_CLASS[state]}>
361
- <span className="gemboss-narr-dot" aria-hidden="true">❯</span>
383
+ <ChatStepMark kind="steer" state={state} />
362
384
  <span className="gemboss-narr-text gemboss-narr-steer">{s.label}</span>
363
385
  </li>
364
386
  );
@@ -366,7 +388,7 @@ export function ChatSteps({ steps, label }: { steps: readonly ChatStep[]; label?
366
388
  if (s.kind === "trace") {
367
389
  return (
368
390
  <li key={s.id} className={TRACE_CLASS[state]} title={s.error || undefined}>
369
- <span className="gemboss-narr-dot" aria-hidden="true">{state === "failed" ? "✕" : "⏺"}</span>
391
+ <ChatStepMark kind="trace" state={state} />
370
392
  {s.detail ? (
371
393
  <details className="gemboss-narr-trace">
372
394
  <summary><code>{s.label}</code></summary>
@@ -380,7 +402,7 @@ export function ChatSteps({ steps, label }: { steps: readonly ChatStep[]; label?
380
402
  <li key={s.id} className={STEP_CLASS[state]} title={s.error || undefined}>
381
403
  {s.engine && isEngineMarkId(s.engine)
382
404
  ? <span className="gemboss-narr-dot gemboss-narr-dot-engine"><EngineMark engine={s.engine} /></span>
383
- : <span className="gemboss-narr-dot" aria-hidden="true">{state === "ok" ? "✓" : state === "failed" ? "✕" : "·"}</span>}
405
+ : <ChatStepMark state={state} />}
384
406
  <span className="gemboss-narr-text">{s.label}{s.target ? <span className="gb-chat-target"> {s.target}</span> : null}</span>
385
407
  </li>
386
408
  );
@@ -392,7 +414,8 @@ export function ChatSteps({ steps, label }: { steps: readonly ChatStep[]; label?
392
414
  // ── Working, the heartbeat ─────────────────────────────────────────────────────────────────────────────────────────────
393
415
 
394
416
  /**
395
- * The one thing that moves while a turn runs and nothing is written yet: a pulsing ✳, a verb that changes every 2s, the
417
+ * The one thing that moves while a turn runs and nothing is written yet: Gem's hologram on the star's old beat (the admin's
418
+ * since 25/10, every surface's since 11/11/2026; it was a pulsing ✳), a verb that changes every 2s, the
396
419
  * seconds (and tokens, when known). For a screen reader it says its label ONCE (role="status"): the clock and the verbs
397
420
  * are hidden from it, or it would announce every second.
398
421
  */
@@ -414,7 +437,7 @@ export function ChatPending({ verbs, tokens, compact, label }: { verbs?: readonl
414
437
  return (
415
438
  <div className="gemboss-ec-pending" role="status">
416
439
  <span className="gemboss-assistant-sronly">{label ?? list[0]}</span>
417
- <span className="gemboss-ec-pending-star" aria-hidden="true">✳</span>
440
+ <GemHolo size={14} busy className="gemboss-ec-pending-star" />
418
441
  {!compact ? <span className="gemboss-ec-pending-verb" key={idx} aria-hidden="true">{list[idx % list.length]}…</span> : null}
419
442
  <span className="gemboss-ec-pending-meta" aria-hidden="true">{tokens && tokens > 0 ? `${tokens} token${tokens === 1 ? "" : "s"} · ` : ""}{elapsed}s</span>
420
443
  </div>
@@ -15,6 +15,7 @@
15
15
  import "../assistant.css"; // its own stylesheet travels with it (0.23.0): a surface that never renders it never loads it
16
16
  import React, { Children, isValidElement, useCallback, useEffect, useLayoutEffect, useRef, useState, type ReactNode } from "react";
17
17
 
18
+ import { Icon } from "../icons"; // every glyph in the frame is from the GemBoss set (11/11/2026), not an SVG drawn here
18
19
  import { DOCK_MIN_HEIGHT, SIDE_MIN_WIDTH, clampDockHeight, clampSideWidth } from "./dock";
19
20
  import { sideAvailable, useAssistant } from "./provider";
20
21
 
@@ -128,7 +129,7 @@ function HostMenu({ label, trigger = "gb-dock-icon", children }: { label: string
128
129
  return (
129
130
  <details ref={ref} className="gb-dock-menu">
130
131
  <summary className={trigger} title={label} aria-label={label}>
131
- <svg viewBox="0 0 20 20" aria-hidden><circle cx="5" cy="10" r="1.5" fill="currentColor"/><circle cx="10" cy="10" r="1.5" fill="currentColor"/><circle cx="15" cy="10" r="1.5" fill="currentColor"/></svg>
132
+ <Icon name="more" size={18} />
132
133
  </summary>
133
134
  {/* title="": the popup's header carries "Drag this bar…" as its title, and a browser shows an ancestor's title on
134
135
  any child without one of its own, so every row said it (review #3941). */}
@@ -480,9 +481,7 @@ export function AssistantHost({
480
481
  <button type="button" className="gb-dock-shrink" onClick={onShrink}>
481
482
  {/* Two arrows pulled INTO the centre. The first attempt drew two corner brackets, which at 16px
482
483
  reads as a plus sign — the opposite of "make this smaller". */}
483
- <svg viewBox="0 0 20 20" aria-hidden>
484
- <path d="M16 4l-5 5M11 9h3.5M11 9V5.5M4 16l5-5M9 11H5.5M9 11v3.5" stroke="currentColor" strokeWidth="1.6" fill="none" strokeLinecap="round" strokeLinejoin="round"/>
485
- </svg>
484
+ <Icon name="shrink" size={16} />
486
485
  <span>{shrinkLabel}</span>
487
486
  </button>
488
487
  </>}
@@ -497,7 +496,7 @@ export function AssistantHost({
497
496
  <span className="gb-dock-ministatus">
498
497
  {dock.busy && runStartedAt ? `${L.working} · ${elapsed(runStartedAt)}` : waiting ? L.waiting : dock.unread ? L.answerWaiting : miniHint || L.askAboutScreen}
499
498
  </span>
500
- <span className="gb-dock-minichevron" aria-hidden>▲</span>
499
+ <span className="gb-dock-minichevron" aria-hidden><Icon name="chevronUp" size={14} /></span>
501
500
  </button>
502
501
  {/* A bar that follows you onto every screen has to be closable from the bar itself. While a
503
502
  run is live `dismiss` opens it instead — see ./dock. */}
@@ -507,7 +506,7 @@ export function AssistantHost({
507
506
  onClick={dock.dismiss}
508
507
  title={dock.busy ? L.openInsteadTitle : L.hideTitle}
509
508
  >
510
- <svg viewBox="0 0 20 20" aria-hidden><path d="M6 6l8 8M14 6l-8 8" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round"/></svg>
509
+ <Icon name="close" size={18} />
511
510
  {/* The NAME follows the behaviour: while a run is live this button opens the popup rather
512
511
  than hiding it, and `title` is not the accessible name. */}
513
512
  <span className="gb-dock-sr">{dock.busy ? L.openInstead : L.hide}</span>
@@ -572,7 +571,7 @@ export function AssistantHost({
572
571
  title={L.newChat}
573
572
  onClick={onNewChat}
574
573
  >
575
- <svg viewBox="0 0 20 20" aria-hidden><path d="M10 4.5v11M4.5 10h11" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round"/></svg>
574
+ <Icon name="plus" size={18} />
576
575
  <span className="gb-dock-sr">{L.newChat}</span>
577
576
  </button>
578
577
  ) : null}
@@ -584,9 +583,7 @@ export function AssistantHost({
584
583
  >
585
584
  {/* The exact mirror of "Shrink to popup": same top-right ↔ bottom-left axis, arrows
586
585
  pointing OUT instead of in. */}
587
- <svg viewBox="0 0 20 20" aria-hidden>
588
- <path d="M11 9l5-5M16 4h-3.5M16 4v3.5M9 11l-5 5M4 16h3.5M4 16v-3.5" stroke="currentColor" strokeWidth="1.6" fill="none" strokeLinecap="round" strokeLinejoin="round"/>
589
- </svg>
586
+ <Icon name="expand" size={18} />
590
587
  <span className="gb-dock-sr">{L.openFull}</span>
591
588
  </button>
592
589
  {/* ⋯ (0.31.0): what is used once in a while — the surface's rows, Clear history, and the two window controls
@@ -608,7 +605,7 @@ export function AssistantHost({
608
605
  title={dock.busy ? L.closeBusyTitle : L.close}
609
606
  onClick={dock.dismiss}
610
607
  >
611
- <svg viewBox="0 0 20 20" aria-hidden><path d="M6 6l8 8M14 6l-8 8" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round"/></svg>
608
+ <Icon name="close" size={18} />
612
609
  <span className="gb-dock-sr">{dock.busy ? L.closeBusy : L.close}</span>
613
610
  </button>
614
611
  </div>
@@ -9,7 +9,14 @@ export { BRIDGE_TONE, BridgeNotice, ENGINE_PICKER_EN, EnginePicker, engineChipNa
9
9
  // (`onOpenSettings`), the section draws it.
10
10
  export { EngineSettings, EngineSettingsSection, type EngineSettingsProps } from "./engine-settings";
11
11
  // 0.29.0: the chat BODY as components (the surface hands in messages and actions), its markdown, and each engine's mark.
12
- export { AssistantChat, ChatAttach, ChatBubble, ChatComposer, ChatError, ChatLabelsProvider, ChatMarkdown, ChatMessage, ChatMeta, ChatNote, ChatPending, ChatStarters, ChatSteps, ChatThread, CHAT_EN, PaperclipIcon, firstBlank, selectBlank, useComposerDensity, useFullChromeRoom, type AssistantChatProps, type ChatComposerProps, type ChatComposerVoice, type ChatFix, type ChatLabels, type ChatMarkdownProps, type ChatMessageData, type ChatStarter, type ChatStep, type ComposerDensity } from "./chat";
12
+ export { AssistantChat, ChatAttach, ChatBubble, ChatComposer, ChatError, ChatLabelsProvider, ChatMarkdown, ChatMessage, ChatMeta, ChatNote, ChatPending, ChatStarters, ChatStepMark, chatStepMarkIcon, ChatSteps, ChatThread, CHAT_EN, PaperclipIcon, firstBlank, selectBlank, useComposerDensity, useFullChromeRoom, type AssistantChatProps, type ChatComposerProps, type ChatComposerVoice, type ChatFix, type ChatLabels, type ChatMarkdownProps, type ChatMessageData, type ChatStarter, type ChatStep, type ChatStepMarkKind, type ComposerDensity } from "./chat";
13
+ // Files in the chat (11/11/2026, canvas board ChatKit states 2–11): what is attached and its uploads, the panel as a drop target, the
14
+ // tray in the message box (ChatComposer `top`), the pictures of a sent message, one picture large. Its own stylesheet entry.
15
+ export { attachmentProblem, ChatAttachments, ChatDropZone, ChatImages, ChatLightbox, fileTypeName, limitsInWords, typesInWords, useChatAttachments, useChatDrop, type ChatAttachLimits, type ChatAttachment, type ChatAttachmentsProps, type ChatAttachmentsState, type ChatDrop, type ChatImage, type ChatUpload } from "./attachments";
16
+ // What can appear in the stream beside words (11/11/2026, canvas board ChatKit): the card a turn's result, job or change is drawn on,
17
+ // the choices (chips or a poll), the question waiting over the box, the words a turn rewrote, a page's bars, buttons that go
18
+ // elsewhere, the rating row. Its own module and stylesheet (`@gemboss/ui/chat-cards.css`).
19
+ export { ChatCard, ChatCardButton, ChatChoices, ChatCta, ChatDecide, ChatFeedback, ChatPageBands, ChatTextChanges, ChatThing, type ChatCardProps, type ChatCardTag, type ChatCardTone, type ChatChoiceItem, type ChatChoicesProps, type ChatCtaAction, type ChatPageBand, type ChatRating, type ChatTextChange } from "./chat-cards";
13
20
  // Speaking instead of typing (B15-voice, 08/11/2026): the hook ChatComposer's `voice` runs on, for a box that is not a chat. Also
14
21
  // its own entry, `@gemboss/ui/assistant/dictation` (no CSS on the way).
15
22
  export { DICTATION_NOTE, appendDictated, canDictate, dictationLanguage, dictationProblemText, useCanDictate, useDictation, type Dictation, type DictationOptions } from "./dictation";
@@ -1 +1 @@
1
- .gb-chat{display:flex;flex-direction:column;min-width:0;min-height:0;height:100%;background:var(--gemboss-surface, #fff)}.gemboss-assistant-layout:not(.is-dock) .gb-chat{background:transparent}.gb-chat>.gemboss-ec-scroll{flex:1 1 auto}.gb-dock:not(.gb-dock-full) .gb-chat-head{display:none}.gb-chat-head{flex:none;box-sizing:border-box;justify-content:center}.gb-chat[data-chrome]>.gb-chat-head{padding-right:var(--gb-chat-chrome-w);min-height:var(--gb-chat-chrome-h)}.gb-chat[data-chrome]:not(:has(>.gb-chat-head))>.gemboss-ec-scroll{padding-top:var(--gb-chat-chrome-h)}.gemboss-ec-starter.gb-chat-starter{white-space:normal;border-radius:12px;text-align:left;overflow-wrap:anywhere}.gb-chat-starter-hint{display:block;margin-bottom:4px;color:var(--gemboss-text-muted);font-size:var(--gemboss-fs-caption, 12px)}.gemboss-ec-starters.gb-chat-starters-cards{flex-direction:column;flex-wrap:nowrap;row-gap:8px}.gb-chat-starters-cards .gb-chat-starter{display:flex;align-items:center;gap:12px;padding:12px 16px}.gb-chat-starter-icon{flex:none;width:32px;height:32px;border-radius:var(--gemboss-radius-md, 8px);display:grid;place-items:center;background:var(--gemboss-accent-soft, #eef0fe);color:var(--gemboss-accent, #5661f5)}.gb-chat-starter-icon svg{width:20px;height:20px;fill:currentColor}.gb-chat-starter-body{display:flex;flex-direction:column;gap:2px;min-width:0}.gb-chat-starter-label{font-weight:600}.gb-chat-starter-sub{color:var(--gemboss-text-muted);font-size:var(--gemboss-fs-caption, 12px)}.gb-chat-label{margin:0;color:var(--gemboss-text-muted);font-size:var(--gemboss-fs-caption, 12px)}.gb-chat-target{color:var(--gemboss-text-muted)}.gb-chat-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px;color:var(--gemboss-text-muted);font-size:var(--gemboss-fs-caption, 12px)}.gb-chat-copy{flex:none}.gb-chat-note{margin:0;align-self:center;text-align:center;color:var(--gemboss-text-muted);font-size:var(--gemboss-fs-caption, 12px)}.gb-chat-notice{margin:0}.gb-chat-error{display:grid;gap:8px;margin:0;overflow-wrap:anywhere}.gb-chat-cmd{display:block;padding:6px 8px;border-radius:8px;background:#0000000d;color:var(--gemboss-text);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:16px;overflow-wrap:anywhere;user-select:all}.gb-chat-original>summary{cursor:pointer;min-height:24px;display:flex;align-items:center}.gemboss-ec-input .gemboss-ec-attach-btn{flex:0 0 auto;width:44px;height:44px;border-radius:50%;padding:0;display:inline-flex;align-items:center;justify-content:center;border:0;background-color:transparent;color:var(--gemboss-text-muted);cursor:pointer}.gemboss-ec-input .gemboss-ec-attach-btn:hover:not(:disabled){background-color:var(--gemboss-hover, rgba(0, 0, 0, .05));color:var(--gemboss-text)}.gemboss-ec-input .gemboss-ec-attach-btn:focus-visible{outline:2px solid var(--ui-focus, #5661f5);outline-offset:2px}.gemboss-ec-input .gemboss-ec-attach-btn:disabled{opacity:.5;cursor:default}.gemboss-ec-input .gemboss-ec-attach-btn svg{width:24px;height:24px}@media (pointer: fine){.gemboss-ec-input .gb-engine-chip{position:relative}.gemboss-ec-input .gb-engine-chip:after{content:"";position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);height:44px;z-index:1}}@media (pointer: coarse),(max-width: 47.9975em){.gb-chat-original>summary{min-height:44px}}.gemboss-ec-decide{display:flex;flex-direction:column;gap:8px;margin:0 12px;padding:12px;border:1px solid var(--gemboss-divider);border-radius:16px;background:var(--gemboss-surface);box-shadow:var(--gemboss-shadow-raised, 0 4px 16px rgba(31, 30, 29, .1))}.gemboss-ec-decide-label{font-size:var(--gemboss-fs-caption, 12px);font-weight:600;color:var(--gemboss-warning, #9a6700)}.gemboss-ec-decide+.gemboss-ec-input{margin-top:8px}
1
+ .gb-chat{display:flex;flex-direction:column;min-width:0;min-height:0;height:100%;background:var(--gemboss-surface, #fff)}.gemboss-assistant-layout:not(.is-dock) .gb-chat{background:transparent}.gb-chat>.gemboss-ec-scroll{flex:1 1 auto}.gb-dock:not(.gb-dock-full) .gb-chat-head{display:none}.gb-chat-head{flex:none;box-sizing:border-box;justify-content:center}.gb-chat[data-chrome]>.gb-chat-head{padding-right:var(--gb-chat-chrome-w);min-height:var(--gb-chat-chrome-h)}.gb-chat[data-chrome]:not(:has(>.gb-chat-head))>.gemboss-ec-scroll{padding-top:var(--gb-chat-chrome-h)}.gemboss-ec-starter.gb-chat-starter{white-space:normal;border-radius:12px;text-align:left;overflow-wrap:anywhere}.gb-chat-starter-hint{display:block;margin-bottom:4px;color:var(--gemboss-text-muted);font-size:var(--gemboss-fs-caption, 12px)}.gemboss-ec-starters.gb-chat-starters-cards{flex-direction:column;flex-wrap:nowrap;row-gap:8px}.gb-chat-starters-cards .gb-chat-starter{display:flex;align-items:center;gap:12px;padding:12px 16px}.gb-chat-starter-icon{flex:none;width:32px;height:32px;border-radius:var(--gemboss-radius-md, 8px);display:grid;place-items:center;background:var(--gemboss-accent-soft, #eef0fe);color:var(--gemboss-accent, #5661f5)}.gb-chat-starter-icon svg{width:20px;height:20px;fill:currentColor}.gb-chat-starter-body{display:flex;flex-direction:column;gap:2px;min-width:0}.gb-chat-starter-label{font-weight:600}.gb-chat-starter-sub{color:var(--gemboss-text-muted);font-size:var(--gemboss-fs-caption, 12px)}.gb-chat-label{margin:0;color:var(--gemboss-text-muted);font-size:var(--gemboss-fs-caption, 12px)}.gb-chat-target{color:var(--gemboss-text-muted)}.gb-chat-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px;color:var(--gemboss-text-muted);font-size:var(--gemboss-fs-caption, 12px)}.gb-chat-copy{flex:none}.gb-chat-note{margin:0;align-self:center;text-align:center;color:var(--gemboss-text-muted);font-size:var(--gemboss-fs-caption, 12px)}.gb-chat-notice{margin:0}.gb-chat-error{display:grid;gap:8px;margin:0;overflow-wrap:anywhere}.gb-chat-cmd{display:block;padding:6px 8px;border-radius:8px;background:#0000000d;color:var(--gemboss-text);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:16px;overflow-wrap:anywhere;user-select:all}.gb-chat-original>summary{cursor:pointer;min-height:24px;display:flex;align-items:center}.gemboss-ec-input .gemboss-ec-attach-btn{flex:0 0 auto;width:44px;height:44px;border-radius:50%;padding:0;display:inline-flex;align-items:center;justify-content:center;border:0;background-color:transparent;color:var(--gemboss-text-muted);cursor:pointer}.gemboss-ec-input .gemboss-ec-attach-btn:hover:not(:disabled){background-color:var(--gemboss-hover, rgba(0, 0, 0, .05));color:var(--gemboss-text)}.gemboss-ec-input .gemboss-ec-attach-btn:focus-visible{outline:2px solid var(--ui-focus, #5661f5);outline-offset:2px}.gemboss-ec-input .gemboss-ec-attach-btn:disabled{opacity:.5;cursor:default}.gemboss-ec-input .gemboss-ec-attach-btn svg{width:24px;height:24px}@media (pointer: fine){.gemboss-ec-input .gb-engine-chip{position:relative}.gemboss-ec-input .gb-engine-chip:after{content:"";position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);height:44px;z-index:1}}@media (pointer: coarse),(max-width: 47.9975em){.gb-chat-original>summary{min-height:44px}}.gemboss-ec-decide{display:flex;flex-direction:column;gap:8px;margin:0 12px;padding:12px;border:1px solid var(--gemboss-divider);border-radius:16px;background:var(--gemboss-surface);box-shadow:var(--gemboss-shadow-raised, 0 4px 16px rgba(31, 30, 29, .1))}.gemboss-ec-decide-label{font-size:var(--gemboss-fs-caption, 12px);font-weight:600;color:var(--gemboss-warning, #9a6700)}.gemboss-ec-decide+.gemboss-ec-input{margin-top:8px}:where(.gemboss-ec-pending-star){display:inline-block;width:10px;height:10px;border-radius:50%;background:currentColor}.gemboss-narr-row.thinking .gemboss-narr-dot{margin-top:2px}