@clagentic/console 1.6.0-beta.1 → 1.6.0-beta.3

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 (46) hide show
  1. package/README.md +18 -0
  2. package/lib/daemon.js +94 -0
  3. package/lib/history-visibility.js +113 -0
  4. package/lib/project-sessions.js +51 -2
  5. package/lib/public/css/base.css +18 -0
  6. package/lib/public/css/diagnostics.css +99 -11
  7. package/lib/public/css/icon-strip.css +201 -0
  8. package/lib/public/css/menus.css +2 -2
  9. package/lib/public/css/mobile-nav.css +24 -0
  10. package/lib/public/css/server-settings.css +100 -0
  11. package/lib/public/index.html +17 -1
  12. package/lib/public/modules/app-header.js +72 -17
  13. package/lib/public/modules/app-home-hub.js +31 -7
  14. package/lib/public/modules/app-messages.js +5 -0
  15. package/lib/public/modules/app-notifications.js +5 -1
  16. package/lib/public/modules/app-projects.js +10 -5
  17. package/lib/public/modules/command-palette.js +16 -5
  18. package/lib/public/modules/custom-icons-settings.js +399 -0
  19. package/lib/public/modules/custom-icons.js +114 -0
  20. package/lib/public/modules/diagnostic-format.js +18 -2
  21. package/lib/public/modules/diagnostics.js +159 -8
  22. package/lib/public/modules/emoji-picker.js +274 -6
  23. package/lib/public/modules/history-visibility.js +98 -0
  24. package/lib/public/modules/popover-position.js +192 -0
  25. package/lib/public/modules/project-icon.js +113 -0
  26. package/lib/public/modules/project-settings.js +2 -2
  27. package/lib/public/modules/project-switcher.js +2 -1
  28. package/lib/public/modules/scheduler-config.js +5 -8
  29. package/lib/public/modules/scheduler.js +5 -6
  30. package/lib/public/modules/server-settings.js +6 -0
  31. package/lib/public/modules/sidebar-mobile.js +4 -6
  32. package/lib/public/modules/sidebar-projects.js +35 -90
  33. package/lib/public/modules/sidebar-sessions.js +6 -20
  34. package/lib/public/modules/sticky-notes.js +4 -4
  35. package/lib/public/modules/terminal.js +5 -12
  36. package/lib/sdk-bridge.js +59 -19
  37. package/lib/sdk-message-processor.js +58 -3
  38. package/lib/sdk-permission-ownership.js +85 -0
  39. package/lib/server-settings.js +221 -1
  40. package/lib/server.js +2 -0
  41. package/lib/sessions.js +77 -10
  42. package/lib/settings-preflight.js +52 -16
  43. package/lib/utils.js +23 -0
  44. package/lib/ws-schema.js +2 -0
  45. package/lib/yoke/adapters/diagnostic-patterns.js +25 -0
  46. package/package.json +2 -1
package/README.md CHANGED
@@ -172,6 +172,24 @@ The test suite covers 12 areas across 26 test files:
172
172
 
173
173
  Run the suite: `npm test`
174
174
 
175
+ ### Local install for manual testing (developers only)
176
+
177
+ > **Warning:** This is a manual, developer-only convenience. Do not call it from CI, automated scripts, systemd units, or any other tooling. It is not a release or deploy mechanism.
178
+
179
+ To install the current working-tree build globally and test it as a real end-user install would behave:
180
+
181
+ ```bash
182
+ npm run install:local-test
183
+ ```
184
+
185
+ This runs `npm pack` (which respects the `files` list in `package.json`, so you get exactly what would ship to npm), installs the resulting tarball globally with `npm install -g`, and removes the tarball. The result is indistinguishable from `npm install -g @clagentic/console` — no symlinks, no `node_modules` shortcuts.
186
+
187
+ When done testing, uninstall with:
188
+
189
+ ```bash
190
+ npm uninstall -g @clagentic/console
191
+ ```
192
+
175
193
  ## FAQ
176
194
 
177
195
  **"Is this a Claude Code wrapper?"**
package/lib/daemon.js CHANGED
@@ -36,6 +36,7 @@ var { startMemoryHighWatcher } = require("./memory-limits");
36
36
  var { createDrain } = require("./drain");
37
37
  var liteDetect = require("./lite-detect");
38
38
  var { execFile: liteExecFile } = require("child_process");
39
+ var { SLUG_RE: CUSTOM_ICON_SLUG_RE, CUSTOM_EMOJI_CT } = require("./server-settings");
39
40
 
40
41
  var daemonVersion = require("../package.json").version;
41
42
  var configFile = process.env.CLAGENTIC_CONFIG || process.env.CLAY_CONFIG || require("./config").configPath();
@@ -753,6 +754,99 @@ var relay = createServer({
753
754
  });
754
755
  return { ok: true };
755
756
  },
757
+ // Rename a custom-icon upload: oldSlug -> newSlug. Rewrites every
758
+ // config.projects[].icon and config.folderMeta[].icon reference that
759
+ // pointed at the old ":oldSlug:" sentinel, renames the file on disk, and
760
+ // broadcasts the updated project/folder list — all as one atomic op
761
+ // (lr-d1d9, LOCKED DECISION: rewrite references, not block-on-in-use).
762
+ // Doing this as a WS op (rather than a bare HTTP route) is what makes the
763
+ // file-rename + reference-rewrite + broadcast atomic: the daemon holds both
764
+ // the on-disk custom-emoji file and the in-memory config.projects/folderMeta
765
+ // that reference it, so there's no window where they can observably diverge.
766
+ onRenameCustomIcon: function (oldSlug, newSlug) {
767
+ if (typeof oldSlug !== "string" || typeof newSlug !== "string") {
768
+ return { ok: false, error: "Missing oldSlug or newSlug" };
769
+ }
770
+ if (!CUSTOM_ICON_SLUG_RE.test(oldSlug) || !CUSTOM_ICON_SLUG_RE.test(newSlug)) {
771
+ return { ok: false, error: "Invalid slug" };
772
+ }
773
+ if (oldSlug === newSlug) {
774
+ return { ok: false, error: "New slug must differ from the current slug" };
775
+ }
776
+
777
+ var customEmojiDir = path.join(CONFIG_DIR, "custom-emoji");
778
+ var oldFile = null;
779
+ var oldExt = null;
780
+ var newSlugExists = false;
781
+ try {
782
+ // Scan the FULL directory (no early break) — the newSlug collision
783
+ // check must run even when oldSlug's file happens to sort before
784
+ // newSlug's file in readdirSync order (e.g. alphabetically).
785
+ var existingFiles = fs.readdirSync(customEmojiDir);
786
+ for (var efi = 0; efi < existingFiles.length; efi++) {
787
+ var ef = existingFiles[efi];
788
+ var efExt = path.extname(ef).slice(1);
789
+ if (!CUSTOM_EMOJI_CT[efExt]) continue;
790
+ var efBasename = path.basename(ef, "." + efExt);
791
+ if (efBasename === oldSlug) { oldFile = ef; oldExt = efExt; }
792
+ // A 409 on newSlug must catch a collision regardless of extension.
793
+ if (efBasename === newSlug) { newSlugExists = true; }
794
+ }
795
+ } catch (e) {
796
+ return { ok: false, error: "Custom icon storage unavailable" };
797
+ }
798
+ if (newSlugExists) {
799
+ return { ok: false, error: "A custom icon named \"" + newSlug + "\" already exists" };
800
+ }
801
+ if (!oldFile) {
802
+ return { ok: false, error: "Custom icon \"" + oldSlug + "\" not found" };
803
+ }
804
+
805
+ // Defense-in-depth: resolve both paths and confirm they stay within
806
+ // customEmojiDir, mirroring the safePath/resolve-prefix guard used by the
807
+ // existing POST/GET/DELETE routes in server-settings.js.
808
+ var oldPath = path.join(customEmojiDir, oldFile);
809
+ var newFile = newSlug + "." + oldExt;
810
+ var newPath = path.join(customEmojiDir, newFile);
811
+ var resolvedOld = path.resolve(customEmojiDir, oldFile);
812
+ var resolvedNew = path.resolve(customEmojiDir, newFile);
813
+ if (!resolvedOld.startsWith(customEmojiDir + path.sep) || !resolvedNew.startsWith(customEmojiDir + path.sep)) {
814
+ return { ok: false, error: "Invalid path" };
815
+ }
816
+
817
+ try {
818
+ fs.renameSync(oldPath, newPath);
819
+ } catch (e) {
820
+ return { ok: false, error: "Rename failed: " + e.message };
821
+ }
822
+
823
+ // Rewrite every reference to the old sentinel across projects + folders.
824
+ var oldSentinel = ":" + oldSlug + ":";
825
+ var newSentinel = ":" + newSlug + ":";
826
+ for (var pi = 0; pi < config.projects.length; pi++) {
827
+ if (config.projects[pi].icon === oldSentinel) {
828
+ config.projects[pi].icon = newSentinel;
829
+ }
830
+ }
831
+ if (config.folderMeta) {
832
+ var folderNames = Object.keys(config.folderMeta);
833
+ for (var fni = 0; fni < folderNames.length; fni++) {
834
+ var fMeta = config.folderMeta[folderNames[fni]];
835
+ if (fMeta && fMeta.icon === oldSentinel) {
836
+ fMeta.icon = newSentinel;
837
+ }
838
+ }
839
+ }
840
+ saveConfig(config);
841
+ try { syncClayrc(config.projects); } catch (e) {}
842
+ relay.broadcastAll({
843
+ type: "projects_updated",
844
+ projects: relay.getProjects(),
845
+ projectCount: config.projects.length,
846
+ folderMeta: config.folderMeta || {},
847
+ });
848
+ return { ok: true, slug: newSlug, url: "/api/custom-emoji/" + newSlug };
849
+ },
756
850
  onProjectOwnerChanged: function (slug, ownerId) {
757
851
  console.log("[daemon] onProjectOwnerChanged:", slug, "→", ownerId);
758
852
  var oldOwnerId = null;
@@ -0,0 +1,113 @@
1
+ /**
2
+ * history-visibility.js — shared source of truth for classifying a recorded
3
+ * history event as "renders a visible message" vs. an invisible-yield event.
4
+ * (lr-c24b)
5
+ *
6
+ * This is the CJS backend copy, used by the load_more_history page-window
7
+ * extension in lib/sessions.js / lib/project-sessions.js. The ES module
8
+ * (browser) copy lives at lib/public/modules/history-visibility.js and must
9
+ * be kept in sync with the render dispatch in lib/public/modules/app-messages.js
10
+ * (the switch(msg.type) cases starting around line 67). A test
11
+ * (test/history-visibility-parity.test.js) asserts both copies produce
12
+ * identical classifications so they cannot silently drift.
13
+ *
14
+ * Background: pagination pages by RAW history-event count
15
+ * (sessions.js HISTORY_PAGE_SIZE), but the user perceives rendered message
16
+ * bubbles. Long agentic turns are dominated by invisible-yield events (todo/
17
+ * task-list bookkeeping, hidden plan tools, state-only events, thinking
18
+ * deltas) — a page made entirely of these renders zero visible bubbles.
19
+ * isVisibleHistoryEvent() lets callers extend a page window until it
20
+ * contains at least one event that will actually render something.
21
+ *
22
+ * Keep this module dependency-light: no project imports, no Node built-ins.
23
+ * That constraint is what lets it stay close to the browser copy.
24
+ */
25
+
26
+ // Tool names that render as hidden bookkeeping widgets (todo/task list state,
27
+ // plan-mode banners, the ask-user-questions card is rendered by its own
28
+ // dedicated tool_executing branch, not the generic tool item) — mirrors
29
+ // TODO_TOOLS / PLAN_MODE_TOOLS in lib/public/modules/tools.js and the
30
+ // tool_start branch in lib/public/modules/app-messages.js.
31
+ var HIDDEN_TOOL_NAMES = {
32
+ TodoWrite: 1,
33
+ TaskCreate: 1,
34
+ TaskUpdate: 1,
35
+ TaskList: 1,
36
+ TaskGet: 1,
37
+ EnterPlanMode: 1,
38
+ ExitPlanMode: 1,
39
+ ask_user_questions: 1,
40
+ };
41
+
42
+ // Event types that never render a new visible message/bubble on their own —
43
+ // they update existing UI state (status text, badges, panels) or are pure
44
+ // internal bookkeeping. Matches the case branches in app-messages.js that
45
+ // call a state setter / no-op rather than a DOM-inserting render helper.
46
+ var INVISIBLE_TYPES = {
47
+ message_uuid: 1,
48
+ session_id: 1,
49
+ status: 1,
50
+ compacting: 1,
51
+ thinking_start: 1,
52
+ thinking_delta: 1,
53
+ thinking_stop: 1,
54
+ ask_user_answered: 1,
55
+ permission_request: 1,
56
+ permission_request_pending: 1,
57
+ permission_cancel: 1,
58
+ permission_resolved: 1,
59
+ elicitation_request: 1,
60
+ elicitation_resolved: 1,
61
+ context_usage: 1,
62
+ fast_mode_state: 1,
63
+ rate_limit: 1,
64
+ rate_limit_usage: 1,
65
+ subagent_activity: 1,
66
+ subagent_tool: 1,
67
+ subagent_done: 1,
68
+ task_started: 1,
69
+ task_progress: 1,
70
+ task_updated: 1,
71
+ done: 1,
72
+ digest_checkpoint: 1,
73
+ };
74
+
75
+ // Event types whose visibility depends on the tool name carried in the event.
76
+ var TOOL_NAME_TYPES = {
77
+ tool_start: 1,
78
+ tool_executing: 1,
79
+ };
80
+
81
+ /**
82
+ * Returns true when `entry` (a single session.history[] item / WS message)
83
+ * causes app-messages.js's processMessage() to insert a new visible element
84
+ * into the message list. Returns false for state-only or hidden-bookkeeping
85
+ * events — the invisible-yield set that can dominate a raw-event-count page.
86
+ *
87
+ * entry is intentionally treated defensively: unknown/missing type defaults
88
+ * to visible (safe default — never under-counts and can't create a new
89
+ * zero-visible page shape that this module wasn't already guarding against).
90
+ */
91
+ function isVisibleHistoryEvent(entry) {
92
+ if (!entry || typeof entry.type !== "string") return true;
93
+ var type = entry.type;
94
+
95
+ if (INVISIBLE_TYPES[type]) return false;
96
+
97
+ if (TOOL_NAME_TYPES[type]) {
98
+ return !HIDDEN_TOOL_NAMES[entry.name];
99
+ }
100
+
101
+ // tool_result carries only an id (no name) — it updates an existing tool
102
+ // card rather than inserting a new one, so it is never itself the reason
103
+ // a page becomes visible.
104
+ if (type === "tool_result") return false;
105
+
106
+ return true;
107
+ }
108
+
109
+ module.exports = {
110
+ HIDDEN_TOOL_NAMES: HIDDEN_TOOL_NAMES,
111
+ INVISIBLE_TYPES: INVISIBLE_TYPES,
112
+ isVisibleHistoryEvent: isVisibleHistoryEvent,
113
+ };
@@ -1,5 +1,6 @@
1
1
  var fs = require("fs");
2
2
  var path = require("path");
3
+ var utils = require("./utils");
3
4
  var { execFileSync, execFile } = require("child_process");
4
5
  var { CODEX_DEFAULTS, getCodexConfig } = require("./codex-defaults");
5
6
  var liteDetect = require("./lite-detect");
@@ -120,6 +121,13 @@ function attachSessions(ctx) {
120
121
  var before = msg.before;
121
122
  var targetFrom = typeof msg.target === "number" ? msg.target : before - sm.HISTORY_PAGE_SIZE;
122
123
  var from = sm.findTurnBoundary(session.history, Math.max(0, targetFrom));
124
+ // Extend backward turn-boundary by turn-boundary (bounded — see
125
+ // extendWindowForVisibility) until the page contains at least one
126
+ // visibly-rendering event. Otherwise a page landing entirely on
127
+ // invisible-yield events (todo/task bookkeeping, hidden plan tools,
128
+ // state events, thinking deltas) advances historyFrom but renders
129
+ // nothing — "Load earlier" appears to do nothing (lr-c24b).
130
+ from = sm.extendWindowForVisibility(session.history, from, before);
123
131
  var to = before;
124
132
  var items = session.history.slice(from, to).map(hydrateImageRefs);
125
133
  sendTo(ws, {
@@ -368,7 +376,11 @@ function attachSessions(ctx) {
368
376
  // If Clay already has a persisted meta file for this cliSessionId, read
369
377
  // its vendor so resumeSession doesn't silently default to the project's
370
378
  // primary vendor (which would break codex sessions after server restart).
379
+ // Also read allowedTools (lr-8b2e) so a previously-granted "allow for
380
+ // session" decision survives this rehydration path instead of
381
+ // re-prompting — resumeSession() itself defaults to {} when absent.
371
382
  var persistedVendor = null;
383
+ var persistedAllowedTools = null;
372
384
  try {
373
385
  var _fsResume = require("fs");
374
386
  var _pathResume = require("path");
@@ -378,6 +390,12 @@ function attachSessions(ctx) {
378
390
  try {
379
391
  var metaObj = JSON.parse(firstLine);
380
392
  if (metaObj && metaObj.type === "meta" && metaObj.vendor) persistedVendor = metaObj.vendor;
393
+ // Sanitize before it ever reaches resumeSession() (lr-8b2e
394
+ // hardening) — a crafted meta record must not be able to
395
+ // auto-approve a tool with no operator click.
396
+ if (metaObj && metaObj.type === "meta" && metaObj.allowedTools) {
397
+ persistedAllowedTools = utils.sanitizeAllowedTools(metaObj.allowedTools);
398
+ }
381
399
  } catch (e) {}
382
400
  }
383
401
  } catch (e) {}
@@ -402,10 +420,10 @@ function attachSessions(ctx) {
402
420
  }
403
421
  }
404
422
  }
405
- var resumed = sm.resumeSession(msg.cliSessionId, { history: history, title: title, vendor: persistedVendor || undefined }, ws);
423
+ var resumed = sm.resumeSession(msg.cliSessionId, { history: history, title: title, vendor: persistedVendor || undefined, allowedTools: persistedAllowedTools || undefined }, ws);
406
424
  if (resumed) ws._clayActiveSession = resumed.localId;
407
425
  }).catch(function() {
408
- var resumed = sm.resumeSession(msg.cliSessionId, persistedVendor ? { vendor: persistedVendor } : undefined, ws);
426
+ var resumed = sm.resumeSession(msg.cliSessionId, (persistedVendor || persistedAllowedTools) ? { vendor: persistedVendor, allowedTools: persistedAllowedTools } : undefined, ws);
409
427
  if (resumed) ws._clayActiveSession = resumed.localId;
410
428
  });
411
429
  return true;
@@ -1241,6 +1259,11 @@ function attachSessions(ctx) {
1241
1259
  if (decision === "allow_always") {
1242
1260
  if (!session.allowedTools) session.allowedTools = {};
1243
1261
  session.allowedTools[pending.toolName] = true;
1262
+ // Flush immediately (lr-8b2e) so the grant survives daemon restart /
1263
+ // resume-by-cliSessionId rehydration even without a later save
1264
+ // trigger — previously this lived only in the in-memory session
1265
+ // object and was lost on rebuild, causing a spurious re-prompt.
1266
+ sm.saveSessionFile(session);
1244
1267
  }
1245
1268
  pending.resolve({ behavior: "allow", updatedInput: pending.toolInput });
1246
1269
  } else {
@@ -1585,6 +1608,32 @@ function attachSessions(ctx) {
1585
1608
  return true;
1586
1609
  }
1587
1610
 
1611
+ // --- Rename a custom-icon upload (lr-d1d9) ---
1612
+ // Auth parity with the picker's POST/DELETE /api/custom-emoji HTTP routes:
1613
+ // no admin gate, no ownership model. Every WS connection reaching this
1614
+ // handler already passed the upgrade-time isRequestAuthed() check in
1615
+ // server.js, so no additional per-message auth check is needed here —
1616
+ // same posture as the neighboring set_project_icon / set_folder_icon ops.
1617
+ if (msg.type === "rename_custom_icon") {
1618
+ if (!msg.oldSlug || !msg.newSlug) {
1619
+ sendTo(ws, { type: "rename_custom_icon_result", ok: false, error: "Missing oldSlug or newSlug" });
1620
+ return true;
1621
+ }
1622
+ if (typeof opts.onRenameCustomIcon === "function") {
1623
+ var renameIconResult = opts.onRenameCustomIcon(msg.oldSlug, msg.newSlug);
1624
+ sendTo(ws, {
1625
+ type: "rename_custom_icon_result",
1626
+ ok: renameIconResult.ok,
1627
+ oldSlug: msg.oldSlug,
1628
+ newSlug: renameIconResult.slug || msg.newSlug,
1629
+ error: renameIconResult.error,
1630
+ });
1631
+ } else {
1632
+ sendTo(ws, { type: "rename_custom_icon_result", ok: false, error: "Not supported" });
1633
+ }
1634
+ return true;
1635
+ }
1636
+
1588
1637
  // --- Daemon config / server management (admin-only in multi-user mode) ---
1589
1638
  if (msg.type === "get_daemon_config" || msg.type === "set_pin" || msg.type === "set_keep_awake" ||
1590
1639
  msg.type === "set_auto_continue" || msg.type === "set_image_retention" || msg.type === "set_mem_available_threshold" ||
@@ -285,3 +285,21 @@ html, body {
285
285
  color: var(--text);
286
286
  }
287
287
 
288
+ /* Mobile (lr-2fdd): bottom:80px occludes the bottom-nav / input box / content
289
+ on narrow viewports (iOS screenshot showed the toast covering content just
290
+ above the Projects/Chat/Team/More nav). Top-anchor instead — per Andy's
291
+ steer ("should top align more than bottom align") — clearing the notch /
292
+ status bar via the safe-area inset. Desktop placement is unchanged. */
293
+ @media (max-width: 768px) {
294
+ .toast,
295
+ .sw-update-banner {
296
+ top: calc(var(--safe-top) + 12px);
297
+ bottom: auto;
298
+ transform: translateX(-50%) translateY(-8px);
299
+ }
300
+ .toast.visible,
301
+ .sw-update-banner.visible {
302
+ transform: translateX(-50%) translateY(0);
303
+ }
304
+ }
305
+
@@ -56,6 +56,38 @@
56
56
  min-height: 0;
57
57
  }
58
58
 
59
+ /* Header actions group: Clear all + Close, side by side (parity with the
60
+ Notifications panel's .notif-banner-clear-all placement). */
61
+ .diagnostics-panel-header-actions {
62
+ display: flex;
63
+ align-items: center;
64
+ gap: 6px;
65
+ }
66
+
67
+ .diagnostics-panel-clear-all {
68
+ display: inline-flex;
69
+ align-items: center;
70
+ padding: 3px 8px;
71
+ background: none;
72
+ border: 1px solid var(--border);
73
+ border-radius: 999px;
74
+ font-family: var(--font-mono, monospace);
75
+ font-size: 9.5px;
76
+ font-weight: 400;
77
+ letter-spacing: 0.06em;
78
+ color: var(--text-muted);
79
+ cursor: pointer;
80
+ transition: color 0.15s, border-color 0.15s;
81
+ }
82
+ .diagnostics-panel-clear-all:hover {
83
+ color: var(--text);
84
+ border-color: var(--border-bright, var(--border));
85
+ }
86
+ .diagnostics-panel-clear-all:focus-visible {
87
+ outline: 2px solid var(--accent);
88
+ outline-offset: 1px;
89
+ }
90
+
59
91
  /* --------------------------------------------------------
60
92
  Diagnostic items
61
93
  -------------------------------------------------------- */
@@ -114,6 +146,31 @@
114
146
  letter-spacing: 0.08em;
115
147
  }
116
148
 
149
+ /* Per-entry dismiss (x) control, pushed to the end of the meta row. */
150
+ .diagnostics-item-dismiss {
151
+ margin-left: auto;
152
+ background: none;
153
+ border: none;
154
+ color: var(--text-muted);
155
+ cursor: pointer;
156
+ padding: 2px;
157
+ display: flex;
158
+ align-items: center;
159
+ justify-content: center;
160
+ border-radius: 4px;
161
+ flex-shrink: 0;
162
+ transition: color 0.15s, background 0.15s;
163
+ }
164
+ .diagnostics-item-dismiss:hover {
165
+ color: var(--text);
166
+ background: rgba(var(--overlay-rgb), 0.06);
167
+ }
168
+ .diagnostics-item-dismiss:focus-visible {
169
+ outline: 2px solid var(--accent);
170
+ outline-offset: 1px;
171
+ }
172
+ .diagnostics-item-dismiss .lucide { width: 12px; height: 12px; }
173
+
117
174
  /* Message text */
118
175
  .diagnostics-message {
119
176
  font-size: 12px;
@@ -154,17 +211,38 @@
154
211
  }
155
212
 
156
213
  /* --------------------------------------------------------
157
- Diagnostic Toast
158
- Extends the base .toast with richer layout.
159
- Sits above the regular toast z-index.
214
+ Diagnostic Toast container (lr-e901)
215
+ Fixed top-right corner stack, off the composer/input box.
216
+ The base .toast family (base.css) is center-bottom over the
217
+ input — fine for a single transient message, but diagnostic
218
+ toasts can arrive concurrently (lr-e901 doubling defect) and
219
+ that spot has no stacking room. Follows the existing corner-
220
+ anchored, flex-column-stacked container precedent already
221
+ used by .notif-banner-container (notifications-center.css)
222
+ rather than introducing a third pattern: normal flow + gap
223
+ handles stacking with no per-toast JS offset math needed.
160
224
  -------------------------------------------------------- */
161
- .toast-diagnostic {
225
+ #diagnostic-toast-container {
162
226
  position: fixed;
163
- bottom: 80px;
164
- left: 50%;
165
- transform: translateX(-50%) translateY(8px);
227
+ top: 48px;
228
+ right: 8px;
166
229
  z-index: 450;
230
+ display: flex;
231
+ flex-direction: column;
232
+ gap: 8px;
233
+ pointer-events: none;
234
+ }
235
+
236
+ /* --------------------------------------------------------
237
+ Diagnostic Toast
238
+ Extends the base .toast with richer layout; positioning now
239
+ comes from the parent #diagnostic-toast-container (lr-e901),
240
+ not from the element itself.
241
+ -------------------------------------------------------- */
242
+ .toast-diagnostic {
243
+ position: relative;
167
244
  opacity: 0;
245
+ transform: translateY(-8px);
168
246
  pointer-events: auto;
169
247
  transition: opacity 0.2s, transform 0.2s;
170
248
 
@@ -181,7 +259,7 @@
181
259
  }
182
260
  .toast-diagnostic.visible {
183
261
  opacity: 1;
184
- transform: translateX(-50%) translateY(0);
262
+ transform: translateY(0);
185
263
  }
186
264
 
187
265
  /* Severity border accent */
@@ -259,11 +337,21 @@
259
337
  Mobile
260
338
  -------------------------------------------------------- */
261
339
  @media (max-width: 768px) {
262
- .toast-diagnostic {
263
- left: 16px;
340
+ /* lr-2fdd: bottom:80px occluded the bottom-nav / input box / content on
341
+ mobile (iOS screenshot showed the PREFLIGHT WARNING toast covering the
342
+ UPCOMING card just above the Projects/Chat/Team/More nav). Top-anchor
343
+ instead, matching the base .toast / .sw-update-banner mobile fix so the
344
+ whole toast family lands the same way. lr-e901 keeps this top-anchor
345
+ intact — only widens the container to full-width since the desktop
346
+ top-right corner box is too narrow/cramped on small viewports. */
347
+ #diagnostic-toast-container {
348
+ top: calc(var(--safe-top) + 12px);
264
349
  right: 16px;
265
- transform: translateY(8px);
350
+ left: 16px;
351
+ }
352
+ .toast-diagnostic {
266
353
  max-width: none;
354
+ transform: translateY(-8px);
267
355
  }
268
356
  .toast-diagnostic.visible {
269
357
  transform: translateY(0);