samagotchi 0.125.0 → 0.127.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 (59) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +50 -1
  3. data/docs/architecture.md +1 -0
  4. data/docs/cli.md +1 -1
  5. data/docs/configuration.md +2 -2
  6. data/docs/guardrails.md +22 -0
  7. data/docs/internals/participants.md +82 -8
  8. data/docs/internals/web-push.md +10 -6
  9. data/docs/sessions.md +6 -1
  10. data/lib/samagotchi/bridge.rb +4 -3
  11. data/lib/samagotchi/bridge_client.rb +8 -1
  12. data/lib/samagotchi/bundles/known-names/hooks/known_names.rb +25 -4
  13. data/lib/samagotchi/bundles/known-names/manifest.yml +2 -2
  14. data/lib/samagotchi/bundles/system/manifest.yml +1 -1
  15. data/lib/samagotchi/child_reports.rb +3 -0
  16. data/lib/samagotchi/children_status.rb +6 -1
  17. data/lib/samagotchi/engine.rb +43 -7
  18. data/lib/samagotchi/guardrail_wiring.rb +10 -1
  19. data/lib/samagotchi/llm/chat_loop.rb +1 -0
  20. data/lib/samagotchi/session.rb +40 -3
  21. data/lib/samagotchi/session_inbox.rb +14 -8
  22. data/lib/samagotchi/session_manager.rb +11 -4
  23. data/lib/samagotchi/session_participants.rb +24 -3
  24. data/lib/samagotchi/verdict.rb +20 -0
  25. data/lib/samagotchi/verify_anchor.rb +28 -0
  26. data/lib/samagotchi/verify_fresh.rb +275 -0
  27. data/lib/samagotchi/verify_fresh_origin.rb +71 -0
  28. data/lib/samagotchi/version.rb +1 -1
  29. data/lib/samagotchi/web/app.rb +15 -0
  30. data/lib/samagotchi/web/participant_access.rb +31 -5
  31. data/lib/samagotchi/web/participant_review.rb +7 -1
  32. data/lib/samagotchi/web/participant_view.rb +46 -5
  33. data/lib/samagotchi/web/project_list.rb +52 -0
  34. data/lib/samagotchi/web/public/annotate_bar.js +9 -1
  35. data/lib/samagotchi/web/public/app.js +77 -4
  36. data/lib/samagotchi/web/public/composer.css +12 -1
  37. data/lib/samagotchi/web/public/data.js +2 -1
  38. data/lib/samagotchi/web/public/index.html +36 -16
  39. data/lib/samagotchi/web/public/notify.js +15 -2
  40. data/lib/samagotchi/web/public/participant.html +33 -32
  41. data/lib/samagotchi/web/public/participant.js +70 -7
  42. data/lib/samagotchi/web/public/project_picker.js +115 -0
  43. data/lib/samagotchi/web/public/restore.js +7 -4
  44. data/lib/samagotchi/web/public/scope.js +8 -10
  45. data/lib/samagotchi/web/public/send_turn.js +8 -1
  46. data/lib/samagotchi/web/public/session_state.js +5 -0
  47. data/lib/samagotchi/web/public/stage_view.js +1 -1
  48. data/lib/samagotchi/web/public/stream_handlers.js +6 -1
  49. data/lib/samagotchi/web/public/verdict_card.js +65 -0
  50. data/lib/samagotchi/web/public/verdict_fresh.js +120 -0
  51. data/lib/samagotchi/web/public/verify_card.css +17 -0
  52. data/lib/samagotchi/web/push/attention.rb +48 -9
  53. data/lib/samagotchi/web/push/notifier.rb +4 -3
  54. data/lib/samagotchi/web/session_control.rb +2 -0
  55. data/lib/samagotchi/web/session_summary.rb +25 -1
  56. data/lib/samagotchi/web/verify_fresh_routes.rb +110 -0
  57. data/lib/samagotchi/worker.rb +75 -13
  58. data/lib/samagotchi/worker_inbound.rb +4 -4
  59. metadata +11 -1
@@ -56,7 +56,7 @@ import { actionEnabled, actionTitle, sameActions, selectionFields, splitInline }
56
56
  // @return {schedule(), hide(), el}; schedule() re-reads the selection on the
57
57
  // next frame (call it on scroll)
58
58
  export function createAnnotateBar({
59
- presets, canAnnotate, roots, isLive, onQuote, actions = () => [], running = () => false, onAction = () => {},
59
+ presets, canAnnotate, roots, isLive, onQuote, onPreset = () => {}, actions = () => [], running = () => false, onAction = () => {},
60
60
  dock = () => null, source: sourceOf = annotationSource, quote = quoteBlock, link = () => null, onLink = () => {},
61
61
  doc = globalThis.document, win = globalThis.window,
62
62
  }) {
@@ -93,6 +93,8 @@ export function createAnnotateBar({
93
93
  const touch = win.matchMedia?.("(pointer: coarse)");
94
94
  let pendingQuote = null;
95
95
  let pendingFields = null;
96
+ let pendingSource = null;
97
+ let pendingRange = null;
96
98
  let pendingLink = null;
97
99
  let drawn = [];
98
100
  let moreList = null;
@@ -141,6 +143,8 @@ export function createAnnotateBar({
141
143
  function hide() {
142
144
  pendingQuote = null;
143
145
  pendingFields = null;
146
+ pendingSource = null;
147
+ pendingRange = null;
144
148
  pendingLink = null;
145
149
  if (moreList) moreList.hidden = true;
146
150
  bar.hidden = true;
@@ -164,6 +168,8 @@ export function createAnnotateBar({
164
168
  if (!block) return hide();
165
169
  pendingQuote = block;
166
170
  pendingFields = selectionFields(raw, source);
171
+ pendingSource = source;
172
+ pendingRange = clipped;
167
173
  pendingLink = link(source, clipped) || null;
168
174
  linkBtn.hidden = !pendingLink;
169
175
  linkBtn.title = pendingLink?.title || "";
@@ -243,8 +249,10 @@ export function createAnnotateBar({
243
249
  }
244
250
  const preset = btn.dataset.index === undefined ? null : presets[Number(btn.dataset.index)];
245
251
  const text = preset ? presetNote(pendingQuote, presetParts(preset).text) : pendingQuote;
252
+ const fields = { ...pendingFields, source: pendingSource, range: pendingRange };
246
253
  win.getSelection()?.removeAllRanges();
247
254
  hide();
255
+ if (preset) onPreset(preset, fields);
248
256
  onQuote(text);
249
257
  });
250
258
 
@@ -30,6 +30,7 @@ import {
30
30
  restartWorkers,
31
31
  restartWeb,
32
32
  onAuthLost,
33
+ api,
33
34
  } from "./data.js";
34
35
  import { authProbe, createAuthLost } from "./auth_lost.js";
35
36
  import { REPLACE_SESSION_TEXT, fragmentCode, tradeFragmentCode } from "./token_fragment.js";
@@ -58,10 +59,12 @@ import { createTaskStopper } from "./task_stop.js";
58
59
  import { createSystemOneWrongAction } from "./system_one_wrong.js";
59
60
  import { appendQuote } from "./annotations.js";
60
61
  import { applyComposerText, applyRowTemplate, fetchApply } from "./review_apply.js";
62
+ import { nameVerdictCards } from "./verdict_card.js";
63
+ import { freshURL, placeVerdictWithFresh, settleRunning } from "./verdict_fresh.js";
61
64
  import { authorBadge, nameUnnamedBadges } from "./participant_names.js";
62
65
  import { parsePresets } from "./annotate_presets.js";
63
66
  import { createAnnotateBar } from "./annotate_bar.js";
64
- import { withVerify } from "./verify_preset.js";
67
+ import { VERIFY_PRESET, withVerify } from "./verify_preset.js";
65
68
  import { actionLine, annotationActions, composerWithAction } from "./annotate_actions.js";
66
69
  import { copyText, installCopy } from "./copy.js";
67
70
  import { createQuestionCards } from "./question_cards.js";
@@ -75,6 +78,7 @@ import {
75
78
  claimFromHash, ownerClaimHash, participantClaimLink, selectionClaim, showClaim, turnIdOf,
76
79
  } from "./claim_link.js";
77
80
  import { scopeDir, scopeTemplate } from "./scope.js";
81
+ import { createProjectPicker } from "./project_picker.js";
78
82
  import { html, render } from "./vendor/lit-html.js";
79
83
  import { shouldFollowScroll } from "./scroll.js";
80
84
  import { SHORT_WINDOW_QUERY, stripAutoHidden } from "./strip.js";
@@ -179,7 +183,13 @@ const participantsControl = createParticipantsControl({
179
183
  startReview: (opts) => sessionActions.reviewSelected(opts),
180
184
  reviewing: () => sessionActions.reviewing.has(selected),
181
185
  // An older prompt drawn before the list came says "a participant": named now.
182
- onNames: () => nameUnnamedBadges(document),
186
+ onNames: () => {
187
+ nameUnnamedBadges(document);
188
+ nameVerdictCards(historyEl, (author) => {
189
+ const badge = authorBadge(author);
190
+ return badge && !badge.unnamed ? badge.name : null;
191
+ });
192
+ },
183
193
  onChange: () => updateInfoBar(),
184
194
  toast: (text, action, options) => showToast(text, action, options),
185
195
  });
@@ -224,6 +234,7 @@ const infoCancelBtn = $("#infoCancelBtn");
224
234
  const composeHintEl = $("#composeHint");
225
235
 
226
236
  let selected = null;
237
+ let pendingVerifyAnchor = null;
227
238
  // The session the composer's text was last written in ("" the start page,
228
239
  // undefined unknown): the composer is one for every session, and continue →
229
240
  // keeps only a draft of its own (fillOpener).
@@ -599,6 +610,11 @@ function renderScope() {
599
610
  updateSessionTitle();
600
611
  }
601
612
 
613
+ createProjectPicker({
614
+ el: $("#scope"), scope, scopeError: () => scopeError, api,
615
+ where: () => ({ search: location.search }),
616
+ });
617
+
602
618
  // The session lists (lists_view.js): the strip, all sessions, their cards,
603
619
  // select mode, the family and chain popovers.
604
620
  const lists = createListsView({
@@ -970,13 +986,16 @@ function clearNotice() {
970
986
  }
971
987
  promptEl.addEventListener("input", clearNotice);
972
988
  promptEl.addEventListener("input", () => noteDraft());
973
- // An emptied composer lets go of its Apply turn.
989
+ // An emptied composer lets go of its Apply turn and its Verify claim.
974
990
  promptEl.addEventListener("input", () => {
975
- if (!promptEl.value.trim()) deliveryControl.release();
991
+ if (promptEl.value.trim()) return;
992
+ deliveryControl.release();
993
+ pendingVerifyAnchor = null;
976
994
  });
977
995
 
978
996
  async function select(id) {
979
997
  clearNotice();
998
+ if (selected !== id) pendingVerifyAnchor = null;
980
999
  selected = id;
981
1000
  setSessionHash(id);
982
1001
  lists.paintActive();
@@ -1173,6 +1192,7 @@ function renderHistory(items) {
1173
1192
  }
1174
1193
  if (typeof items[0] === "object" && items[0].role) {
1175
1194
  historyEl.replaceChildren(turnHistoryNodes(items, current.timing, { thumbs: (images) => thumbsTemplate(selected, images), workingSet: !!workingSet }));
1195
+ renderSavedVerdicts();
1176
1196
  // The live dividers count from the history's last activity.
1177
1197
  gapClock.seed(lastActivity(turnGroups(items, current.timing), items));
1178
1198
  linkTextRefs();
@@ -1314,6 +1334,44 @@ function placeApply(data) {
1314
1334
  appendToHistory(elementOf(applyRowTemplate(data.turn_id, badge)));
1315
1335
  }
1316
1336
 
1337
+ function placeVerdict(record) {
1338
+ if (!record) return;
1339
+ const known = (current.verdicts || []).some((item) => item.check_turn_id === record.check_turn_id);
1340
+ if (!known) current.verdicts = [...(current.verdicts || []), record];
1341
+ // A fresh verdict ends its check's "verifying fresh" (the card shows it).
1342
+ if (record.fresh) current.verifyFresh = settleRunning(current.verifyFresh, record);
1343
+ const badge = record.by && authorBadge(record.by);
1344
+ placeVerdictWithFresh(historyEl, record, {
1345
+ who: badge ? badge.name : "You",
1346
+ author: record.by || null,
1347
+ }, verifyFreshState());
1348
+ }
1349
+
1350
+ // The owner's Verify fresh on an unclear verdict's card (verdict_fresh.js):
1351
+ // always theirs to start; its running check links to the child's session.
1352
+ function verifyFreshState() {
1353
+ const id = selected;
1354
+ if (!Array.isArray(current.verifyFresh)) current.verifyFresh = [];
1355
+ return {
1356
+ verdicts: current.verdicts || [],
1357
+ running: current.verifyFresh,
1358
+ canStart: !!id,
1359
+ start: async (of) => {
1360
+ try {
1361
+ const body = await api(freshURL(id, of), { method: "POST", body: "{}" });
1362
+ return { ok: true, child_id: body.child_id || null };
1363
+ } catch (error) {
1364
+ return { ok: false, error: error.message };
1365
+ }
1366
+ },
1367
+ childHref: (childId) => sessionHash(childId),
1368
+ };
1369
+ }
1370
+
1371
+ function renderSavedVerdicts() {
1372
+ for (const record of current.verdicts || []) placeVerdict(record);
1373
+ }
1374
+
1317
1375
  // Apply: the owner's Apply turn into the composer, after what is typed
1318
1376
  // there; never sent from here.
1319
1377
  historyEl.addEventListener("click", async (e) => {
@@ -1551,6 +1609,8 @@ const streamHandlers = createStreamHandlers({
1551
1609
  workingSet,
1552
1610
  participantsControl,
1553
1611
  placeApply,
1612
+ placeVerdict,
1613
+ restoreVerify: (anchor) => { pendingVerifyAnchor = anchor; },
1554
1614
  sentIds,
1555
1615
  earlyRestores,
1556
1616
  stream: {
@@ -1656,6 +1716,9 @@ const sendTurnControl = createSendTurn({
1656
1716
  sentIds,
1657
1717
  earlyRestores,
1658
1718
  api: { createIdleSession, uploadImage, sendTurn },
1719
+ verify: () => pendingVerifyAnchor,
1720
+ clearVerify: (anchor) => { if (pendingVerifyAnchor === anchor) pendingVerifyAnchor = null; },
1721
+ restoreVerify: (anchor) => { pendingVerifyAnchor = anchor; },
1659
1722
  dir: scope.dir,
1660
1723
  startPage,
1661
1724
  takeDelivery: () => deliveryControl.take(),
@@ -1899,6 +1962,9 @@ const annotateBar = createAnnotateBar({
1899
1962
  roots: turnRoots,
1900
1963
  isLive: (root) => liveTurn.running && turnDom.containsLive(root),
1901
1964
  onQuote: (text) => fillComposer(appendQuote(promptEl.value, text)),
1965
+ onPreset: (preset, fields) => {
1966
+ pendingVerifyAnchor = preset === VERIFY_PRESET ? verifyAnchorFor(fields) : null;
1967
+ },
1902
1968
  actions: () => annotationActions(current.commands),
1903
1969
  running: () => liveTurn.running,
1904
1970
  onAction: (action, fields) => {
@@ -1910,6 +1976,13 @@ const annotateBar = createAnnotateBar({
1910
1976
  onLink: copyClaimLink,
1911
1977
  dock: () => $("#dock"),
1912
1978
  });
1979
+
1980
+ function verifyAnchorFor({ source, range }) {
1981
+ if (!source || !["answer", "step", "user"].includes(source.kind) || !historyEl.contains(source.root)) return null;
1982
+ const turnId = turnIdOf(historyEl, source.root);
1983
+ const quote = selectionClaim(source.root, range, claimOpts()).q;
1984
+ return turnId && quote ? { turn_id: turnId, quote } : null;
1985
+ }
1913
1986
  historyEl.addEventListener("scroll", annotateBar.schedule);
1914
1987
  // A command bubble's Apply (CacheConfirm): sends the change's --yes line
1915
1988
  // once; its own bubble then says what it did.
@@ -1,11 +1,22 @@
1
1
  /* The composer (composer_mount.js): the message box, its image chips, grip and fold, its key hint and its toolbar row
2
2
  (the image button, Send). Shared by the owner's page (index.html) and the participant page (participant.html);
3
3
  linked after tokens.css and before a page's own <style>, so a page's rules of the same weight win. The owner's
4
- own parts stay in index.html: the card (#dock), the delivery line, Stop turn, the start page's picker and chips,
4
+ own parts stay in index.html: the card's placing (#dock), the delivery line's links, Stop turn, the start page's picker and chips,
5
5
  the / list, and the 16px text fields for iOS. */
6
6
  /* The image button's icon mask (the stroke only shapes the mask; the icon takes currentColor); index.html's phone info
7
7
  bar and all view's cards use it too. */
8
8
  :root{--icon-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='2.75' width='12' height='10.5' rx='1.5'/%3E%3Ccircle cx='5.75' cy='6.25' r='1.1'/%3E%3Cpath d='m2.5 12.5 3.75-3.75 2.5 2.5 1.75-1.75 3 3'/%3E%3C/svg%3E")}
9
+ /* The composer card: the glass card both pages' composers sit in (the owner's #dock, the stage view's .dock-card, the
10
+ participant page's .p-card), with its focus ring; its footer (the owner's info bar, the participant's usage) under
11
+ a hairline; and the composer's line, the quiet row above the text field (the owner's delivery line, the
12
+ participant's key hint). A page's own rules only place the card. */
13
+ .composer-card{display:flex;flex-direction:column;border-radius:16px;position:relative;background:var(--glass-bg);-webkit-backdrop-filter:blur(18px) saturate(1.35);backdrop-filter:blur(18px) saturate(1.35);border:1px solid var(--glass-border);box-shadow:inset 0 1px 0 var(--glass-highlight),var(--glass-shadow);transition:border-color .12s ease,box-shadow .12s ease}
14
+ .composer-card:focus-within{border-color:color-mix(in srgb,var(--accent) 70%,transparent);box-shadow:0 0 0 3px var(--accent-ring),var(--glass-shadow)}
15
+ @supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){.composer-card{background:var(--bg-panel)}}
16
+ @media (prefers-reduced-transparency:reduce){.composer-card{background:var(--bg-panel);-webkit-backdrop-filter:none;backdrop-filter:none}}
17
+ body.no-glass .composer-card{background:var(--bg-panel);-webkit-backdrop-filter:none;backdrop-filter:none}
18
+ .composer-card-foot{padding:8px 14px 10px;border-top:1px solid var(--glass-border)}
19
+ .composer-line{flex:1 0 100%;min-width:0;height:20px;padding:0 2px;overflow:hidden;font-size:12px;line-height:18px;color:var(--text-muted);user-select:none}
9
20
  #composer{display:flex;flex-direction:column;gap:8px;padding:14px 14px 10px}
10
21
  #composer .compose-col{flex:1;display:flex;flex-direction:column;gap:6px;min-width:0}
11
22
  #composer.dropping{outline:2px dashed var(--accent);outline-offset:-4px}
@@ -140,11 +140,12 @@ export function getSession(id, { tail, recent, turnId, timing, parts, cards, ...
140
140
  // image-only send, whose text is only its [image: …] placeholders).
141
141
  // delivery: what the message does to a running turn ("cut": /cut TEXT);
142
142
  // none = the server's default (the next step).
143
- export function sendTurn(id, prompt, { clientId, images, history = true, delivery = null, ...opts } = {}) {
143
+ export function sendTurn(id, prompt, { clientId, images, history = true, delivery = null, verify = null, ...opts } = {}) {
144
144
  const body = clientId ? { prompt, client_id: clientId } : { prompt };
145
145
  if (images?.length) body.images = images;
146
146
  if (delivery) body.delivery = delivery;
147
147
  if (history === false) body.history = false;
148
+ if (verify) body.verify = verify;
148
149
  return api(`/api/sessions/${id}/turn`, {
149
150
  method: "POST",
150
151
  body: JSON.stringify(body),
@@ -10,6 +10,7 @@
10
10
  <meta name="apple-mobile-web-app-title" content="Chi">
11
11
  <meta name="viewport" content="width=device-width,initial-scale=1">
12
12
  <link rel="stylesheet" href="/assets/tokens.css">
13
+ <link rel="stylesheet" href="/assets/verify_card.css">
13
14
  <link rel="stylesheet" href="/assets/annotate_bar.css">
14
15
  <link rel="stylesheet" href="/assets/composer.css">
15
16
  <link rel="stylesheet" href="/assets/forms.css">
@@ -21,7 +22,7 @@
21
22
  html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
22
23
  body{font-family: ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;background:radial-gradient(1100px 700px at 8% 0%,color-mix(in srgb,var(--accent) 13%,transparent),transparent 70%),var(--bg);background-attachment:fixed;color:var(--text);height:100vh;display:flex;flex-direction:column}
23
24
  /* Glass: the composer card, the strip cards, the all-sessions cards and the question cards (by selector, so app.js is untouched). */
24
- #dock,.turn-stage,.dock-card,#topStrip .card,#allList .card,.bubble.question,.bubble.plugin-card{background:var(--glass-bg);-webkit-backdrop-filter:blur(18px) saturate(1.35);backdrop-filter:blur(18px) saturate(1.35);border:1px solid var(--glass-border);box-shadow:inset 0 1px 0 var(--glass-highlight),var(--glass-shadow)}
25
+ .turn-stage,#topStrip .card,#allList .card,.bubble.question,.bubble.plugin-card{background:var(--glass-bg);-webkit-backdrop-filter:blur(18px) saturate(1.35);backdrop-filter:blur(18px) saturate(1.35);border:1px solid var(--glass-border);box-shadow:inset 0 1px 0 var(--glass-highlight),var(--glass-shadow)}
25
26
  #topStrip .card:hover,#allList .card:hover{background:color-mix(in srgb,var(--bg-hover) 75%,transparent);border-color:var(--card-hover-border)}
26
27
  #topStrip .card.active,#allList .card.active{background:color-mix(in srgb,var(--accent-bg) 75%,transparent);border-color:color-mix(in srgb,var(--accent) 35%,transparent)}
27
28
  /* A parent whose folded family holds the open session: a quieter mark than .active. */
@@ -29,9 +30,9 @@ body{font-family: ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetic
29
30
  /* A session that waits on the user (a question, an approval, a card with actions): the warning colour of its question card, also when active or hovered. */
30
31
  #topStrip .card.waiting,#allList .card.waiting{border-color:color-mix(in srgb,var(--warn) 75%,transparent)}
31
32
  #topStrip .card.waiting:hover,#allList .card.waiting:hover{border-color:var(--warn)}
32
- @supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){#dock,.turn-stage,.dock-card,#topStrip .card,#allList .card,#allHead input{background:var(--bg-panel)}.bubble.question{background:color-mix(in srgb,var(--warn) 7%,var(--bg-panel))}.bubble.plugin-card{background:color-mix(in srgb,var(--accent) 6%,var(--bg-panel))}}
33
- @media (prefers-reduced-transparency:reduce){#dock,.turn-stage,.dock-card,#topStrip .card,#allList .card,#allHead input{background:var(--bg-panel);-webkit-backdrop-filter:none;backdrop-filter:none}.bubble.question{background:color-mix(in srgb,var(--warn) 7%,var(--bg-panel));-webkit-backdrop-filter:none;backdrop-filter:none}.bubble.plugin-card{background:color-mix(in srgb,var(--accent) 6%,var(--bg-panel));-webkit-backdrop-filter:none;backdrop-filter:none}}
34
- body.no-glass #dock,body.no-glass .turn-stage,body.no-glass .dock-card,body.no-glass #topStrip .card,body.no-glass #allList .card,body.no-glass #allHead input{background:var(--bg-panel);-webkit-backdrop-filter:none;backdrop-filter:none}
33
+ @supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){.turn-stage,#topStrip .card,#allList .card,#allHead input{background:var(--bg-panel)}.bubble.question{background:color-mix(in srgb,var(--warn) 7%,var(--bg-panel))}.bubble.plugin-card{background:color-mix(in srgb,var(--accent) 6%,var(--bg-panel))}}
34
+ @media (prefers-reduced-transparency:reduce){.turn-stage,#topStrip .card,#allList .card,#allHead input{background:var(--bg-panel);-webkit-backdrop-filter:none;backdrop-filter:none}.bubble.question{background:color-mix(in srgb,var(--warn) 7%,var(--bg-panel));-webkit-backdrop-filter:none;backdrop-filter:none}.bubble.plugin-card{background:color-mix(in srgb,var(--accent) 6%,var(--bg-panel));-webkit-backdrop-filter:none;backdrop-filter:none}}
35
+ body.no-glass .turn-stage,body.no-glass #topStrip .card,body.no-glass #allList .card,body.no-glass #allHead input{background:var(--bg-panel);-webkit-backdrop-filter:none;backdrop-filter:none}
35
36
  body.no-glass .bubble.question{background:color-mix(in srgb,var(--warn) 7%,var(--bg-panel));-webkit-backdrop-filter:none;backdrop-filter:none}
36
37
  body.no-glass .bubble.plugin-card{background:color-mix(in srgb,var(--accent) 6%,var(--bg-panel));-webkit-backdrop-filter:none;backdrop-filter:none}
37
38
  button,input,textarea,select{font:inherit}
@@ -565,8 +566,8 @@ button.system-one-wrong:hover:not(:disabled){background:var(--bg-hover);color:va
565
566
  .bubble.output.markdown .code-wrap>pre{margin:0}
566
567
  .code-wrap>.copy-btn{top:5px;right:5px}
567
568
  @media (hover:none){.copy-btn{opacity:.55}}
568
- /* The dock is the composer card: the text field, a toolbar row, the info bar as its footer. */
569
- #dock{display:flex;flex-direction:column;flex-shrink:0;margin:0 12px 12px;border-radius:16px;position:relative;transition:border-color .12s ease,box-shadow .12s ease}
569
+ /* The dock is the composer card (composer.css .composer-card): the text field, a toolbar row, the info bar as its footer. */
570
+ #dock{flex-shrink:0;margin:0 12px 12px}
570
571
  /* In a session the card floats over the history, so the glass blurs it; the history's bottom padding follows the card (--dock-h, set from dock_reserve.js). */
571
572
  /* The session panel lets the page's glow through (the history's own layers go clear), so the card and its footer read as glass over it, not as a flat box on black. */
572
573
  body.has-session #center{background:color-mix(in srgb,var(--bg) 35%,transparent);border-color:var(--glass-border);position:relative}
@@ -575,9 +576,8 @@ body.has-session #stage,body.has-session #history{background:transparent}
575
576
  body.no-glass.has-session #center{background:var(--bg);border-color:var(--border)}
576
577
  body.has-session #dock{position:absolute;left:16px;right:16px;bottom:16px;margin:0;z-index:3}
577
578
  body.has-session #history{padding-bottom:calc(var(--dock-h,160px) + 32px)}
578
- #dock:focus-within{border-color:color-mix(in srgb,var(--accent) 70%,transparent);box-shadow:0 0 0 3px var(--accent-ring),var(--glass-shadow)}
579
579
  /* The delivery line (delivery_line.js): a session's row above the text field, always there so the composer never changes height: the key hint while idle; while a turn runs, where a message typed now goes in, then the cut and queue links. One quiet row, ellipsised; a phone gets the short text and chips. */
580
- #deliveryLine{display:flex;align-items:center;gap:10px;min-width:0;flex:1 0 100%;height:20px;padding:0 2px;overflow:hidden;font-size:12px;line-height:18px;color:var(--text-muted);user-select:none}
580
+ #deliveryLine{display:flex;align-items:center;gap:10px}
581
581
  #deliveryLine[hidden]{display:none}
582
582
  #deliveryLine .delivery-where{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
583
583
  #deliveryLine .delivery-where.idle{color:var(--text-faint)}
@@ -671,8 +671,6 @@ body.has-session.fresh-link #composer .actions-col .model-pick:not([hidden]){dis
671
671
  /* D2: its own glass card above the composer card (as a section of one card the composer's focus ring wrapped the turn too):
672
672
  in the stage view #dock is a clear column holding the stage and .dock-card (the composer and its footer, stage_view.js). */
673
673
  body.stage-view #dock,body.stage-view #dock:focus-within{background:transparent;border:0;box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none;gap:10px}
674
- .dock-card{display:flex;flex-direction:column;border-radius:16px;position:relative;transition:border-color .12s ease,box-shadow .12s ease}
675
- .dock-card:focus-within{border-color:color-mix(in srgb,var(--accent) 70%,transparent);box-shadow:0 0 0 3px var(--accent-ring),var(--glass-shadow)}
676
674
  /* The live slots' heights (headline, tool row, trail); --ts-live-h is their running height with the two 8 px gaps. */
677
675
  .turn-stage{--ts-head-h:42px;--ts-now-h:32px;--ts-trail-h:18px;--ts-live-h:calc(var(--ts-head-h) + var(--ts-now-h) + var(--ts-trail-h) + 16px)}
678
676
  .turn-stage{display:flex;flex-direction:column;min-height:0;max-height:var(--stage-max,60vh);border-left:3px solid var(--accent);border-radius:14px;overflow:hidden}
@@ -994,7 +992,7 @@ button.ws-row:hover:not(:disabled){filter:none;background:var(--bg-hover)}
994
992
  .ts-trail-item{max-width:24ch}
995
993
  }
996
994
  @media (prefers-reduced-motion:reduce){.turn-stage.enter,.ts-arrive,.ts-headline.fresh,.ts-tick.running,.ts-mark,.turn-work:not(.done) .activity-status.running::before{animation:none}.turn-stage.leaving,#center.reserve-easing #history{transition:none}}
997
- #infoBar{display:flex;padding:8px 14px 10px;border-top:1px solid var(--glass-border);background:transparent;border-radius:0 0 16px 16px;color:var(--text-2);gap:10px;align-items:flex-start;flex-wrap:wrap;flex-shrink:0;transition:opacity 280ms ease}
995
+ #infoBar{display:flex;background:transparent;border-radius:0 0 16px 16px;color:var(--text-2);gap:10px;align-items:flex-start;flex-wrap:wrap;flex-shrink:0;transition:opacity 280ms ease}
998
996
  #infoBar.visible{display:flex}
999
997
  /* The meta row keeps its room: with a plain flex:1 the bar's own buttons (continue, archive, stop session, delete)
1000
998
  shrink it to a narrow column in a small window and its items wrap into five lines. With a 640px basis they share
@@ -1267,13 +1265,35 @@ body.has-session #newBtn .brand-new{display:inline}
1267
1265
  /* The scope chip: "<project> · all", or "all projects" and where a new session starts (start page only). */
1268
1266
  #scope{display:inline-flex;align-items:center;gap:8px;min-width:0;font-size:12px;color:var(--text-muted)}
1269
1267
  #scope[hidden]{display:none}
1270
- #scope .scope-name{flex-shrink:0;padding:2px 9px;border:1px solid var(--border-strong);border-radius:999px;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:40vw}
1268
+ #scope .scope-name{display:inline-flex;align-items:center;flex-shrink:0;padding:2px 9px;border:1px solid var(--border-strong);border-radius:999px;background:transparent;color:var(--text-2);font:inherit;line-height:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:40vw;cursor:pointer;transition:none}
1269
+ #scope .scope-name:hover:not(:disabled){filter:none}
1271
1270
  #scope .scope-name.error{color:var(--warn-text);border-color:var(--warn-border)}
1272
1271
  #scope .scope-all{color:var(--text-muted);text-decoration:none}
1273
1272
  #scope .scope-all:hover{color:var(--accent);text-decoration:underline}
1274
1273
  #scope .scope-where{display:inline-flex;gap:5px;min-width:0;white-space:nowrap;font-size:11px}
1275
1274
  /* The path cuts on the left, so its last folders stay in view. */
1276
1275
  #scope .scope-where .path{overflow:hidden;text-overflow:ellipsis;direction:rtl;min-width:0;font-family:ui-monospace,monospace}
1276
+ #projectPicker{width:min(380px,calc(100vw - 32px))}
1277
+ .project-picker.sheet{border-radius:14px;padding:14px 16px}
1278
+ .project-picker .ctx-pop-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
1279
+ .project-picker .ctx-pop-head strong{font-family:inherit}
1280
+ .project-list{display:flex;flex-direction:column;gap:6px;margin:2px 0;padding:0}
1281
+ .project-row{display:flex;align-items:center;gap:12px;padding:8px 10px;border:1px solid transparent;border-radius:9px;background:var(--bg-inset);color:var(--text);text-decoration:none}
1282
+ .project-row:hover{background:var(--bg-hover);color:var(--text-hover)}
1283
+ .project-row:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
1284
+ .project-row[aria-current="page"]{border-color:var(--accent-border);background:var(--accent-bg)}
1285
+ .project-main{display:flex;flex:1;align-items:center;gap:7px;min-width:0;flex-wrap:wrap}
1286
+ .project-name{font-weight:600;overflow-wrap:anywhere}
1287
+ .project-root{flex-basis:100%;min-width:0;color:var(--text-muted);font:11px ui-monospace,monospace;overflow-wrap:anywhere}
1288
+ .project-meta{display:flex;flex-shrink:0;align-items:center;gap:7px;color:var(--text-muted);font-size:11px;white-space:nowrap}
1289
+ .project-default{padding:1px 6px;border-radius:999px;background:var(--bg-raised);color:var(--text-muted);font-size:10px}
1290
+ .project-check{color:var(--accent);font-weight:700}
1291
+ .project-hint{flex-basis:100%;color:var(--text-muted);font-size:12px}
1292
+ /* The divider is its own hairline above the row: a border-top on the rounded row curved up at both ends. */
1293
+ .project-all{position:relative;margin-top:12px;background:transparent}
1294
+ .project-all::before{content:"";position:absolute;left:-1px;right:-1px;top:-9px;height:1px;background:var(--border);pointer-events:none}
1295
+ .project-note{padding:5px 2px;color:var(--text-muted);font-size:12px}
1296
+ .project-error{color:var(--warn-text)}
1277
1297
  body.has-session #scope .scope-where{display:none}
1278
1298
  /* A phone has no room for both; the hidden strip's pill (count, live) wins. */
1279
1299
  @media(max-width:600px){body.strip-hidden #scope .scope-where{display:none}}
@@ -1524,7 +1544,7 @@ body.all-view #center, body.all-view #topStrip{display:none}
1524
1544
  .card .dot.waiting,.family-row .dot.waiting{background:var(--warn);animation:attn-pulse 1.6s ease-in-out var(--pulse-delay,0s) infinite}
1525
1545
  @keyframes attn-pulse{0%,100%{box-shadow:0 0 0 0 color-mix(in srgb,var(--warn) 60%,transparent)}50%{box-shadow:0 0 0 4px color-mix(in srgb,var(--warn) 0%,transparent)}}
1526
1546
  @media (prefers-reduced-motion:reduce){.card .dot.running,.card .dot.waiting,.family-row .dot.running,.family-row .dot.waiting{animation:none}}
1527
- .card .attn,.family-row .attn{font-size:11px;font-weight:600;padding:1px 7px;border-radius:999px;white-space:nowrap;flex-shrink:0;background:var(--warn-bg);color:var(--warn-text);border:1px solid var(--warn-border)}
1547
+ .card .attn,.family-row .attn,.project-picker .attn{font-size:11px;font-weight:600;padding:1px 7px;border-radius:999px;white-space:nowrap;flex-shrink:0;background:var(--warn-bg);color:var(--warn-text);border:1px solid var(--warn-border)}
1528
1548
  .card .stopped-badge,.family-row .stopped-badge{font-size:11px;font-weight:600;padding:1px 7px;border-radius:999px;white-space:nowrap;flex-shrink:0;background:var(--warn);color:var(--bg)}
1529
1549
  .status.running{background:var(--ok-bg);color:var(--ok-text)}
1530
1550
  .status.idle{background:var(--bg-raised)}
@@ -1568,7 +1588,7 @@ a{color:var(--accent)}
1568
1588
  <div id="notice" role="status" hidden></div>
1569
1589
  </div>
1570
1590
  <div id="lightbox" hidden><img alt=""></div>
1571
- <div id="dock">
1591
+ <div id="dock" class="composer-card">
1572
1592
  <div id="initRow" role="status" aria-live="polite" hidden></div>
1573
1593
  <div id="composeGrip" class="edge-grip" tabindex="0" aria-label="Message box" title="Drag to make the message box taller (double-click resets)"></div>
1574
1594
  <div id="composer" style="position:relative">
@@ -1577,7 +1597,7 @@ a{color:var(--accent)}
1577
1597
  <label class="model-search"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><circle cx="7" cy="7" r="4.5"/><path d="M10.5 10.5 14 14" stroke-linecap="round"/></svg><input id="modelSearch" type="text" placeholder="Search models" autocomplete="off" spellcheck="false" role="combobox" aria-label="Search models" aria-autocomplete="list" aria-controls="modelList" aria-expanded="false"></label>
1578
1598
  <div id="modelList" role="listbox" aria-label="Models"></div>
1579
1599
  </div>
1580
- <div id="deliveryLine" aria-live="off" hidden></div>
1600
+ <div id="deliveryLine" class="composer-line" aria-live="off" hidden></div>
1581
1601
  <div class="compose-col">
1582
1602
  <div id="chips" hidden></div>
1583
1603
  <textarea id="prompt" placeholder="Ask chi anything…" aria-controls="commandList" aria-autocomplete="list" aria-expanded="false"></textarea>
@@ -1596,7 +1616,7 @@ a{color:var(--accent)}
1596
1616
  </div>
1597
1617
  </div>
1598
1618
  </div>
1599
- <div id="infoBar">
1619
+ <div id="infoBar" class="composer-card-foot">
1600
1620
  <div class="info" id="infoText"></div>
1601
1621
  <div id="contextChips" aria-label="Attached context" hidden></div>
1602
1622
  <button class="ghost" id="infoCancelBtn" title="Cancel the running turn, whoever sent it" style="display:none">Stop turn</button>
@@ -20,6 +20,7 @@ export function notifyState({ hasNotification, secureContext, permission, wanted
20
20
  // (task): nobody started it, so nobody watched it.
21
21
  const DONE_MIN_SECONDS = 10;
22
22
  const UNWATCHED_ORIGINS = ["delegate_report", "context", "task"];
23
+ const VERDICT_REASON_MAX = 120;
23
24
 
24
25
  // The step-limit question (kind "continue": a turn ran out of iterations
25
26
  // and asks whether to go on) has its own reason: "out of steps".
@@ -52,7 +53,7 @@ const RELAYED_KINDS = new Set(["approval", "hook"]);
52
53
  // What changed between two summaries of one session that needs the user.
53
54
  // @param prev the summary held before (null for a session not seen yet)
54
55
  // @param next the new summary
55
- // @return null | {reason: "question"|"approval"|"card"|"failed"|"done", sessionId, key}
56
+ // @return null | {reason: "question"|"approval"|"card"|"failed"|"done"|"verdict", sessionId, key}
56
57
  // key names this one event, the same in every tab (the Notification tag);
57
58
  // holdMs, when there, delays it (a delegated child's approval)
58
59
  export function attentionFor(prev, next) {
@@ -75,6 +76,10 @@ export function attentionFor(prev, next) {
75
76
  // A delegated child's turn is reported by its parent's.
76
77
  if (next.parent_id) return null;
77
78
  const key = `${next.id}:${turn.ended_at}`;
79
+ const verdict = next.last_verdict;
80
+ if (verdict?.check_turn_id && verdict.check_turn_id !== prev?.last_verdict?.check_turn_id) {
81
+ return { reason: "verdict", sessionId: next.id, key: `${next.id}:${verdict.check_turn_id}` };
82
+ }
78
83
  if (turn.outcome === "failed") return { reason: "failed", sessionId: next.id, key };
79
84
  if (turn.outcome === "completed" && (Number(turn.seconds) >= DONE_MIN_SECONDS || UNWATCHED_ORIGINS.includes(turn.origin))) {
80
85
  return { reason: "done", sessionId: next.id, key };
@@ -157,13 +162,21 @@ export function attentionText(session, attention) {
157
162
  const name = String(session?.title || session?.auto_title || session?.recap || session?.first_preview || session?.last_prompt || "chi session").trim();
158
163
  const title = clip(name, 61);
159
164
  const seconds = Math.round(Number(session?.last_turn?.seconds) || 0);
165
+ const verdict = session?.last_verdict;
166
+ // An owner's verdict has no participant author (none, "" or "owner").
167
+ const byParticipant = !!verdict?.by && verdict.by !== "owner";
168
+ const who = verdict?.by_name || (byParticipant ? "A participant" : "You");
169
+ const verdictReason = clip(String(verdict?.reason || ""), VERDICT_REASON_MAX);
170
+ const verdictIcon = { confirmed: "✅", refuted: "❌", unclear: "❓" }[verdict?.verdict] || "";
171
+ const verdictBody = `${who}: ${verdictIcon} ${verdict?.verdict || ""} — ${verdictReason}`;
160
172
  const body = {
161
173
  question: "needs an answer",
162
174
  approval: "needs approval",
163
175
  continue: "hit its step limit",
164
176
  card: "needs you",
165
177
  failed: "turn failed",
166
- done: `done in ${seconds} s`
178
+ done: `done in ${seconds} s`,
179
+ verdict: verdictBody
167
180
  }[attention.reason] || "";
168
181
  return { title, body };
169
182
  }
@@ -6,6 +6,7 @@
6
6
  <link rel="icon" href="/assets/favicon.svg" type="image/svg+xml">
7
7
  <meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
8
8
  <link rel="stylesheet" href="/assets/tokens.css">
9
+ <link rel="stylesheet" href="/assets/verify_card.css">
9
10
  <link rel="stylesheet" href="/assets/annotate_bar.css">
10
11
  <link rel="stylesheet" href="/assets/composer.css">
11
12
  <link rel="stylesheet" href="/assets/forms.css">
@@ -94,7 +95,7 @@ main{flex:1;min-height:0;overflow-y:auto;padding:16px 16px 8px}
94
95
  .p-tools{font-size:12.5px;color:var(--text-muted)}
95
96
  .p-tools summary{cursor:pointer;list-style:none;display:inline-flex;align-items:center;gap:6px;padding:2px 0}
96
97
  .p-tools summary::-webkit-details-marker{display:none}
97
- .p-tools summary::before{content:"▸";font-size:10px}
98
+ .p-tools summary::before{content:"▸"}
98
99
  .p-tools[open] summary::before{content:"▾"}
99
100
  .p-tools ul{list-style:none;padding:2px 0 0 14px;display:flex;flex-direction:column;gap:1px}
100
101
  .p-tools li{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@@ -104,42 +105,42 @@ main{flex:1;min-height:0;overflow-y:auto;padding:16px 16px 8px}
104
105
  .p-tool-one.error{color:var(--danger-text)}
105
106
  .p-tag{font-size:11px;padding:0 6px;border-radius:999px;background:var(--bg-raised);color:var(--text-3)}
106
107
  .p-waiting{align-self:flex-start;font-size:13px;color:var(--warn-text);background:var(--warn-bg);border:1px solid var(--warn-border);border-radius:999px;padding:3px 12px}
107
- .p-dock{border-top:1px solid var(--border);background:var(--bg-panel);padding:10px 16px calc(10px + env(safe-area-inset-bottom))}
108
+ /* The dock is the owner's composer card (index.html's #dock): a glass card over the page's bottom edge, holding the
109
+ comment box (key hint, text field, usage footer); the queue and errors sit above it. */
110
+ .p-dock{padding:6px 16px calc(16px + env(safe-area-inset-bottom))}
108
111
  .p-dock-in{max-width:760px;margin:0 auto;display:flex;flex-direction:column;gap:8px}
109
112
  .p-queue{display:flex;flex-direction:column;gap:4px;font-size:13px}
110
113
  .p-queued{display:flex;align-items:center;gap:8px;color:var(--text-3)}
111
114
  .p-queued span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
112
115
  .p-queue-note{font-size:12.5px;color:var(--text-muted)}
113
116
  .p-error{font-size:13px;color:var(--danger-text);background:var(--danger-bg-dim);border-radius:8px;padding:6px 10px}
114
- /* The comment box: the shared composer (composer.css, composer_mount.js), as the owner's session composer lays it out
115
- (participant.js sets body.has-session for a participant: one row, the text field and Send at its bottom right). Its
116
- grip straddles the dock's top border; folded, the dock keeps the queue and the grip as the handle. No `/` list,
117
- delivery line or model picker here. */
118
- #composer{background:var(--bg-inset);border:1px solid var(--border-strong);border-radius:12px}
119
- #composer:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-ring)}
120
- body.has-session #composer{padding:6px 6px 6px 10px}
117
+ /* The comment box: the shared composer in the shared card (composer.css, composer_mount.js), as the owner's session
118
+ composer lays it out (participant.js sets body.has-session for a participant): the key hint as the composer's line,
119
+ the text field and Send, the usage as the card's footer. Its grip sits on the card's top edge, as the owner's does;
120
+ folded, the card keeps its footer under the grip, the owner's info bar's way. No `/` list, delivery choices or model
121
+ picker here. */
121
122
  #composer textarea{font:inherit;line-height:1.45;padding:2px 0}
122
123
  #composer textarea:disabled{cursor:not-allowed}
123
124
  #composer .actions-col #send{height:30px;min-height:30px;line-height:30px;padding:0 16px;font-weight:600}
124
- .p-dock #composeGrip{margin:-15px 0 5px}
125
- body.composer-folded .p-hint{display:none}
126
- /* The participant's own usage (participant_model.js usageItems: the fields their grant's exposure shows), one line
127
- beside the hint; a phone shows it alone, one line, the end cut. Folded, it goes with the hint. */
128
- .p-foot{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 14px;min-width:0}
129
- .p-foot .p-hint{flex:1 1 320px;min-width:0}
125
+ /* The participant's own usage (participant_model.js usageItems: the fields their grant's exposure shows), one line in
126
+ the card's footer, the end cut. Folded, it stays under the grip. */
127
+ .p-hint.composer-line{color:var(--text-faint);white-space:nowrap;text-overflow:ellipsis}
128
+ .p-foot{min-width:0}
129
+ .p-foot:has(> .p-usage[hidden]){display:none}
130
+ /* Folded before the usage loads, the card keeps a footer's height under its grip, not a 2 px sliver. */
131
+ body.composer-folded .p-foot:has(> .p-usage[hidden]){display:block;min-height:18px}
130
132
  .p-usage{display:flex;align-items:baseline;min-width:0;max-width:100%;font-size:12px;color:var(--text-muted);font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
131
133
  .p-usage span{flex:0 0 auto}
132
134
  .p-usage span+span::before{content:"·";padding:0 6px;color:var(--text-faint)}
133
135
  .p-usage span.model{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}
134
136
  .p-usage .warn{color:var(--warn-text)}
135
137
  .p-usage .over{color:var(--danger-text);font-weight:600}
136
- body.composer-folded .p-foot{display:none}
138
+ body.composer-folded .p-foot{border-top-color:transparent}
137
139
  button{font:inherit;cursor:pointer;border-radius:8px;border:1px solid var(--border-strong);background:var(--bg-raised);color:var(--text);padding:6px 12px}
138
140
  button:hover{background:var(--bg-hover)}
139
141
  button.primary{background:var(--primary);border-color:var(--primary);color:var(--on-solid);height:42px;padding:0 18px}
140
142
  button.primary:disabled{opacity:.5;cursor:default}
141
143
  button.small{font-size:12px;padding:2px 8px}
142
- .p-hint{font-size:12px;color:var(--text-faint)}
143
144
  .p-ended{max-width:30rem;margin:18vh auto 0;padding:0 16px;text-align:center;display:flex;flex-direction:column;gap:10px}
144
145
  .p-ended h1{font-size:20px;color:var(--text-bright)}
145
146
  .p-ended p{color:var(--text-3)}
@@ -154,8 +155,6 @@ button.small{font-size:12px;padding:2px 8px}
154
155
  }
155
156
  /* Under 16px iOS Safari zooms the page on focus (and a Home Screen app never zooms back). */
156
157
  @media (max-width:600px),(pointer:coarse){#composer textarea{font-size:16px}}
157
- /* A phone's grip (composer.css: 26 px tall, the pill at 17 px): the pill on the dock's top border. */
158
- @media (max-width:600px){.p-dock #composeGrip{margin:-29px auto 3px}}
159
158
  </style>
160
159
  </head>
161
160
  <body>
@@ -184,25 +183,27 @@ button.small{font-size:12px;padding:2px 8px}
184
183
  <div class="p-thread" id="thread"></div>
185
184
  </main>
186
185
  <footer class="p-dock" id="dock" hidden>
187
- <div id="composeGrip" class="edge-grip" tabindex="0" aria-label="Comment box" title="Drag to make the comment box taller (double-click resets)"></div>
188
186
  <div class="p-dock-in">
189
187
  <div class="p-queue" id="queue"></div>
190
188
  <div class="p-error" id="error" role="alert" hidden></div>
191
- <div id="composer">
192
- <div class="compose-col">
193
- <div id="chips" hidden></div>
194
- <textarea id="comment" rows="1" placeholder="Comment or ask" aria-label="Comment or ask"></textarea>
189
+ <div class="p-card composer-card">
190
+ <div id="composeGrip" class="edge-grip" tabindex="0" aria-label="Comment box" title="Drag to make the comment box taller (double-click resets)"></div>
191
+ <div id="composer">
192
+ <div class="p-hint composer-line" id="hint">⏎ sends, ⇧⏎ a new line, ↑ an earlier comment. The model answers in a read-only turn; the owner sees everything.</div>
193
+ <div class="compose-col">
194
+ <div id="chips" hidden></div>
195
+ <textarea id="comment" rows="1" placeholder="Comment or ask" aria-label="Comment or ask"></textarea>
196
+ </div>
197
+ <div class="actions-col">
198
+ <button type="button" id="attachBtn" class="attach-btn" title="Add images" aria-label="Add images" hidden></button>
199
+ <input type="file" id="attachInput" accept="image/*" multiple hidden>
200
+ <div class="split"><button type="button" class="primary" id="send">Send</button></div>
201
+ </div>
195
202
  </div>
196
- <div class="actions-col">
197
- <button type="button" id="attachBtn" class="attach-btn" title="Add images" aria-label="Add images" hidden></button>
198
- <input type="file" id="attachInput" accept="image/*" multiple hidden>
199
- <div class="split"><button type="button" class="primary" id="send">Send</button></div>
203
+ <div class="p-foot composer-card-foot">
204
+ <div class="p-usage" id="usage" aria-label="Your usage" hidden></div>
200
205
  </div>
201
206
  </div>
202
- <div class="p-foot">
203
- <div class="p-usage" id="usage" aria-label="Your usage" hidden></div>
204
- <div class="p-hint" id="hint">⏎ sends, ⇧⏎ a new line, ↑ an earlier comment. The model answers in a read-only turn; the owner sees everything.</div>
205
- </div>
206
207
  </div>
207
208
  </footer>
208
209
  </div>