@1agh/maude 2.0.0-rc.1 → 2.0.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 (108) hide show
  1. package/apps/studio/acp/index.ts +35 -2
  2. package/apps/studio/acp/login-state.ts +3 -2
  3. package/apps/studio/actions/defs/chat.ts +4 -1
  4. package/apps/studio/actions.manifest.json +1 -1
  5. package/apps/studio/agent-runs.ts +3 -0
  6. package/apps/studio/ai/lease-home.ts +11 -1
  7. package/apps/studio/ai/run-lifecycle.ts +17 -0
  8. package/apps/studio/ai/runs.ts +64 -12
  9. package/apps/studio/api.ts +31 -5
  10. package/apps/studio/bridge/dgn-protocol.ts +13 -0
  11. package/apps/studio/canvas-imports.ts +23 -4
  12. package/apps/studio/canvas-lib.tsx +7 -0
  13. package/apps/studio/client/app.jsx +4 -0
  14. package/apps/studio/client/export-lane.js +4 -2
  15. package/apps/studio/client/fonts/LICENSE-Inter-Tight.txt +93 -0
  16. package/apps/studio/client/fonts/LICENSE-Inter.txt +93 -0
  17. package/apps/studio/client/fonts/LICENSE-JetBrains-Mono.txt +93 -0
  18. package/apps/studio/client/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
  19. package/apps/studio/client/fonts/inter-latin-wght-normal.woff2 +0 -0
  20. package/apps/studio/client/fonts/inter-tight-latin-ext-wght-normal.woff2 +0 -0
  21. package/apps/studio/client/fonts/inter-tight-latin-wght-normal.woff2 +0 -0
  22. package/apps/studio/client/fonts/jetbrains-mono-latin-ext-wght-normal.woff2 +0 -0
  23. package/apps/studio/client/fonts/jetbrains-mono-latin-wght-normal.woff2 +0 -0
  24. package/apps/studio/client/hooks/use-canvas-bridge.jsx +6 -0
  25. package/apps/studio/client/index.html +0 -3
  26. package/apps/studio/client/panels/ChatPanel.jsx +10 -2
  27. package/apps/studio/client/panels/acp-runtime.js +14 -0
  28. package/apps/studio/client/styles/_index.css +2 -0
  29. package/apps/studio/client/styles/fonts.css +63 -0
  30. package/apps/studio/client/system/system-view.jsx +6 -2
  31. package/apps/studio/client/tree-row-menu.jsx +4 -0
  32. package/apps/studio/client/v2/ai/Advanced.jsx +23 -7
  33. package/apps/studio/client/v2/ai/AttachMenu.jsx +4 -0
  34. package/apps/studio/client/v2/ai/ChatList.jsx +7 -1
  35. package/apps/studio/client/v2/ai/ConnectSheet.jsx +75 -4
  36. package/apps/studio/client/v2/ai/NeedsYouSlot.jsx +42 -8
  37. package/apps/studio/client/v2/ai/NotReady.jsx +24 -3
  38. package/apps/studio/client/v2/ai/RunList.jsx +4 -0
  39. package/apps/studio/client/v2/ai/RunSurface.jsx +14 -4
  40. package/apps/studio/client/v2/ai/ScopeChip.jsx +4 -0
  41. package/apps/studio/client/v2/ai/Working.jsx +13 -1
  42. package/apps/studio/client/v2/ai/activity-line.js +390 -0
  43. package/apps/studio/client/v2/ai/activity-store.js +45 -0
  44. package/apps/studio/client/v2/ai/advanced-model.js +62 -12
  45. package/apps/studio/client/v2/ai/ai-list-advanced.css +7 -0
  46. package/apps/studio/client/v2/ai/ai-run.css +19 -0
  47. package/apps/studio/client/v2/ai/ai-send.js +6 -2
  48. package/apps/studio/client/v2/ai/connect-flow.js +29 -8
  49. package/apps/studio/client/v2/ai/needs-you.css +18 -0
  50. package/apps/studio/client/v2/ai/needs-you.js +10 -0
  51. package/apps/studio/client/v2/ai/ring-relay.js +11 -1
  52. package/apps/studio/client/v2/ai/use-activity-line.js +81 -0
  53. package/apps/studio/client/v2/annotations/templates-panel.jsx +4 -0
  54. package/apps/studio/client/v2/assets/kinds-chip.jsx +1 -1
  55. package/apps/studio/client/v2/assets/place-asset.js +20 -1
  56. package/apps/studio/client/v2/assets/tile-menu.jsx +1 -1
  57. package/apps/studio/client/v2/canvases/canvases-panel.jsx +5 -1
  58. package/apps/studio/client/v2/canvases/row-menu.jsx +4 -2
  59. package/apps/studio/client/v2/ds/review.css +2 -0
  60. package/apps/studio/client/v2/empty/ai-drafting.jsx +78 -0
  61. package/apps/studio/client/v2/empty/empty-host.jsx +17 -0
  62. package/apps/studio/client/v2/empty/empty.css +98 -0
  63. package/apps/studio/client/v2/export/advanced/render.jsx +5 -2
  64. package/apps/studio/client/v2/export/export-copy.js +11 -4
  65. package/apps/studio/client/v2/export/export-sheet.jsx +6 -2
  66. package/apps/studio/client/v2/export/exports-model.js +13 -0
  67. package/apps/studio/client/v2/export/exports-panel.jsx +4 -2
  68. package/apps/studio/client/v2/export/job-row.jsx +4 -0
  69. package/apps/studio/client/v2/export/other-formats.jsx +7 -1
  70. package/apps/studio/client/v2/export/sections/batch-model.js +3 -2
  71. package/apps/studio/client/v2/export/sections/batch.jsx +20 -4
  72. package/apps/studio/client/v2/inspector/sections/colour-popover.jsx +4 -0
  73. package/apps/studio/client/v2/inspector/token-chip.jsx +4 -0
  74. package/apps/studio/client/v2/kinds/SizePicker.jsx +4 -0
  75. package/apps/studio/client/v2/presence/faces.jsx +4 -0
  76. package/apps/studio/client/v2/share/role-menu.jsx +7 -1
  77. package/apps/studio/client/v2/share/share-model.js +20 -1
  78. package/apps/studio/client/v2/share/share-sheet.jsx +6 -4
  79. package/apps/studio/client/v2/shell/account-card.jsx +7 -1
  80. package/apps/studio/client/v2/shell/canvas-pointer.js +21 -0
  81. package/apps/studio/client/v2/shell/mode-switch.jsx +4 -0
  82. package/apps/studio/client/v2/shell/project-pill.jsx +4 -0
  83. package/apps/studio/client/v2/shell/save-status.js +10 -1
  84. package/apps/studio/client/v2/shell/share-cluster-host.jsx +2 -0
  85. package/apps/studio/client/v2/shell/share-cluster.jsx +6 -1
  86. package/apps/studio/client/v2/shell/use-dismiss-outside.js +14 -6
  87. package/apps/studio/client/v2/timeline/joins/transition-picker.jsx +7 -1
  88. package/apps/studio/client/v2/undo/undo-history.jsx +7 -1
  89. package/apps/studio/cloud/endpoints.ts +31 -1
  90. package/apps/studio/dist/client.bundle.js +921 -921
  91. package/apps/studio/dist/comment-mount.js +1 -1
  92. package/apps/studio/dist/styles.css +1 -1
  93. package/apps/studio/editing/canvas-pointer.ts +29 -0
  94. package/apps/studio/routes/cloud-move.ts +7 -4
  95. package/apps/studio/sync/ctl-provider.ts +4 -1
  96. package/apps/studio/sync/file-ledger.ts +12 -0
  97. package/apps/studio/sync/file-membership.ts +28 -0
  98. package/apps/studio/sync/file-plane.ts +119 -5
  99. package/apps/studio/sync/index.ts +55 -1
  100. package/apps/studio/sync/journal-client.ts +12 -0
  101. package/apps/studio/sync/poke.ts +30 -0
  102. package/apps/studio/sync/presentation.ts +6 -1
  103. package/apps/studio/sync/projection.ts +7 -0
  104. package/apps/studio/sync/retry-after.ts +27 -0
  105. package/apps/studio/sync/status.ts +9 -1
  106. package/apps/studio/video-play-overlay.tsx +67 -12
  107. package/apps/studio/whats-new.json +78 -6
  108. package/package.json +8 -8
@@ -18,6 +18,9 @@ import { menuRunner } from '../shell/menu-runner.js';
18
18
  import { insetsNow } from '../shell/insets-now.js';
19
19
  import { shellMode } from '../shell/use-canvas-mode-lane.js';
20
20
  import { freeCentre } from './free-centre.js';
21
+ import { useActivityTarget } from '../ai/activity-store.js';
22
+ import { useAiRuns } from '../ai/runs-store.js';
23
+ import { AiDrafting, draftingPresence } from './ai-drafting.jsx';
21
24
  import { AllTrashed } from './all-trashed.jsx';
22
25
  import { ArtboardHint, HINT_SIZE } from './artboard-hint.jsx';
23
26
  import { EmptyCanvas } from './empty-canvas.jsx';
@@ -59,6 +62,18 @@ export function EmptyHost() {
59
62
  const model = canvasOpen
60
63
  ? emptyCanvasModel({ count, mode, canEdit, online, claude, canAsk })
61
64
  : null;
65
+ // rc3-h (#182): a run of yours on this empty canvas — the ghost where the first artboard lands, not the invitation
66
+ const { view: runsView } = useAiRuns();
67
+ const target = useActivityTarget();
68
+ const drafting = canvasOpen
69
+ ? draftingPresence({
70
+ view: runsView,
71
+ activePath,
72
+ designRel: cfg?.designRel || '.design',
73
+ count,
74
+ target,
75
+ })
76
+ : null;
62
77
 
63
78
  // P8 C5 (05 es-all-trashed): a canvas whose every artboard is in the Trash says that, not "Your canvas is
64
79
  // ready." — the card (S11.5) reads the shared Trash itself and tells us when it is on screen.
@@ -132,6 +147,8 @@ export function EmptyHost() {
132
147
  );
133
148
 
134
149
  const showHint = !!hint && !!placement && canEdit && mode === 'edit' && !model;
150
+ if (drafting)
151
+ return <AiDrafting label={drafting.label} centre={centre} waiting={drafting.waiting} />;
135
152
  if (!model && !showHint && !trashWatch) return null;
136
153
  return (
137
154
  <>
@@ -437,4 +437,102 @@
437
437
  line-height: var(--lh-xs);
438
438
  color: var(--fg-2);
439
439
  }
440
+
441
+ /* ─── rc3-h (issue 182): an empty canvas while AI drafts on it (01 cf-ai-drafting's ghost + the _kit AI cursor) ─── */
442
+ .es-aid {
443
+ position: absolute;
444
+ left: var(--es-cx, 50%);
445
+ top: 45%;
446
+ translate: -50% -50%;
447
+ width: min(400px, calc(100% - var(--space-8)));
448
+ aspect-ratio: 16 / 10;
449
+ }
450
+ .es-aid-ghost {
451
+ position: absolute;
452
+ inset: 0;
453
+ border: 1.5px dashed var(--spark);
454
+ border-radius: var(--radius-xs);
455
+ background: var(--spark-muted);
456
+ }
457
+ /* the page lines are faint: the wrapper holds the opacity, the pulse animates the lines inside it */
458
+ .es-aid-page {
459
+ position: absolute;
460
+ inset: 0;
461
+ opacity: 0.2;
462
+ }
463
+ .es-aid-ghost i {
464
+ position: absolute;
465
+ left: 10%;
466
+ display: block;
467
+ height: 7%;
468
+ border-radius: var(--radius-xs);
469
+ background: var(--spark);
470
+ }
471
+ .es-aid-ghost i:nth-child(1) {
472
+ top: 14%;
473
+ width: 46%;
474
+ }
475
+ .es-aid-ghost i:nth-child(2) {
476
+ top: 28%;
477
+ width: 30%;
478
+ height: 5%;
479
+ }
480
+ .es-aid-ghost i:nth-child(3) {
481
+ top: 46%;
482
+ right: 10%;
483
+ height: 38%;
484
+ }
485
+ .es-aid-l {
486
+ position: absolute;
487
+ left: 0;
488
+ bottom: calc(100% + var(--space-1));
489
+ display: inline-flex;
490
+ align-items: center;
491
+ gap: var(--space-1);
492
+ max-width: 100%;
493
+ overflow: hidden;
494
+ font-size: var(--type-xs);
495
+ font-weight: var(--w-medium);
496
+ color: var(--spark-text);
497
+ white-space: nowrap;
498
+ text-overflow: ellipsis;
499
+ }
500
+ .es-aid-cur {
501
+ position: absolute;
502
+ left: 74%;
503
+ top: 62%;
504
+ display: inline-flex;
505
+ align-items: flex-start;
506
+ color: var(--spark);
507
+ }
508
+ .es-aid-cur-l {
509
+ margin: 12px 0 0 -2px;
510
+ padding: 0 var(--space-1);
511
+ border-radius: var(--radius-xs);
512
+ background: var(--spark);
513
+ color: var(--bg-0);
514
+ font-size: var(--type-xs);
515
+ font-weight: var(--w-semibold, 600);
516
+ line-height: var(--lh-xs);
517
+ }
518
+ @media (prefers-reduced-motion: no-preference) {
519
+ .es-aid:not([data-waiting]) .es-aid-ghost i {
520
+ animation: v2-empty-pulse calc(var(--dur-panel) * 6) var(--ease-in-out) infinite alternate;
521
+ }
522
+ .es-aid:not([data-waiting]) .es-aid-cur {
523
+ animation: es-aid-drift calc(var(--dur-panel) * 8) var(--ease-in-out) infinite alternate;
524
+ }
525
+ }
526
+ [data-reduced-motion="true"] .es-aid-ghost i,
527
+ [data-reduced-motion="true"] .es-aid-cur {
528
+ animation: none;
529
+ }
530
+ @keyframes es-aid-drift {
531
+ from {
532
+ translate: 0 0;
533
+ }
534
+ to {
535
+ translate: -56px -26px;
536
+ }
537
+ }
440
538
  }
@@ -21,9 +21,12 @@ import { LANES, renderStatus } from './model.js';
21
21
 
22
22
  export function RenderPart({ spec, exportLane, video, setAdv }) {
23
23
  const status = renderStatus(exportLane);
24
+ // rc3-i — "Suggest each time · always the cloud · always this Mac" and "always export on this Mac" are the
25
+ // desktop's: a cloud tab renders where its workspace does, so it is told only the service and its state
26
+ const workspace = exportLane !== 'local';
24
27
  return (
25
28
  <section className="ex-advp" data-testid="export-adv-render" aria-label={RENDER_TITLE}>
26
- {video ? (
29
+ {video && !workspace ? (
27
30
  <>
28
31
  <Row k={RENDER_VIDEO}>
29
32
  <Select
@@ -41,7 +44,7 @@ export function RenderPart({ spec, exportLane, video, setAdv }) {
41
44
  <Note>{RENDER_NOTE_VIDEO}</Note>
42
45
  </>
43
46
  ) : null}
44
- <Note>{RENDER_NOTE_IMAGES}</Note>
47
+ {workspace ? null : <Note>{RENDER_NOTE_IMAGES}</Note>}
45
48
  <span className="ex-kv">
46
49
  <span>{RENDER_SERVICE}</span>
47
50
  <span className="ex-mono" data-testid="export-adv-render-service">
@@ -143,16 +143,23 @@ function secondsWords(seconds) {
143
143
  return `about ${Math.round(seconds / 60)} min`;
144
144
  }
145
145
 
146
- /** "21 files · about 140 MB · about 20 seconds on this Mac". */
147
- export function estimateWords({ files, bytes, seconds, lane }, { pdfPages = null } = {}) {
148
- const where = lane === 'cloud' ? 'in the cloud' : 'on this Mac';
146
+ /**
147
+ * "21 files · about 140 MB · about 20 seconds on this Mac".
148
+ * `workspace` = a cloud tab (a browser on a cell): nothing runs on a Mac there, so the time names the cloud or no
149
+ * place at all (rc3-i — the callouts' rule: same words, minus the part that is false there).
150
+ */
151
+ export function estimateWords(
152
+ { files, bytes, seconds, lane },
153
+ { pdfPages = null, workspace = false } = {}
154
+ ) {
155
+ const where = lane === 'cloud' ? ' in the cloud' : workspace ? '' : ' on this Mac';
149
156
  return [
150
157
  // 09 ex-print: one print PDF says its pages — "1 PDF · 2 pages", not "1 file"
151
158
  pdfPages && files === 1
152
159
  ? `1 PDF · ${pdfPages} ${pdfPages === 1 ? 'page' : 'pages'}`
153
160
  : `${files} ${files === 1 ? 'file' : 'files'}`,
154
161
  `about ${bytesWords(bytes)}`,
155
- `${secondsWords(seconds)} ${where}`,
162
+ `${secondsWords(seconds)}${where}`,
156
163
  ].join(' · ');
157
164
  }
158
165
 
@@ -219,6 +219,8 @@ export function ExportSheet({
219
219
  // S8.5 — a video's Render row: cloud or this Mac (Suggest each time / always, export-lane.js)
220
220
  const online = useOnline();
221
221
  const [pickedLane, setPickedLane] = useState(null);
222
+ // rc3-i — a cloud tab (any lane but the desktop's own): nothing runs on a Mac, so the words never say it does
223
+ const workspace = exportLane !== 'local';
222
224
  const lanePref = state.adv?.lane ?? readLanePref();
223
225
  const render = useMemo(
224
226
  () =>
@@ -228,8 +230,9 @@ export function ExportSheet({
228
230
  online,
229
231
  picked: pickedLane,
230
232
  seconds: est?.seconds ?? null,
233
+ workspace,
231
234
  }),
232
- [lanePref, est, online, pickedLane]
235
+ [lanePref, est, online, pickedLane, workspace]
233
236
  );
234
237
  // 09 — one artboard exported (a post, a web page, a video, a print page): its picture + its size line beside the rows
235
238
  const videoRow = section === 'video' ? (video.rows?.[0] ?? null) : null;
@@ -342,7 +345,7 @@ export function ExportSheet({
342
345
  ? summaryWords(
343
346
  // 09 ex-video / 07 ve-export: the words follow the Render card that is ticked, not the estimate's lane
344
347
  estimateForLane(est, render),
345
- printChoice.printPdf ? { pdfPages: printChoice.withBack ? 2 : 1 } : undefined
348
+ { workspace, ...(printChoice.printPdf ? { pdfPages: printChoice.withBack ? 2 : 1 } : {}) }
346
349
  )
347
350
  : null;
348
351
  const button =
@@ -564,6 +567,7 @@ export function ExportSheet({
564
567
  const sectionProps = {
565
568
  state,
566
569
  set,
570
+ workspace,
567
571
  setFormat: (f) => {
568
572
  setFormat(f);
569
573
  setStatus(null);
@@ -14,6 +14,19 @@ export const PANEL_FOOT = 'The last 20 exports stay here. Also in Search: “Exp
14
14
  /** 09 ex-progress: while something runs the foot says what survives a sleeping Mac. */
15
15
  export const RUNNING_FOOT =
16
16
  'Cloud renders keep going if this Mac sleeps or the window closes. Exports on this Mac need the window open — images and PDFs take seconds.';
17
+ /**
18
+ * rc3-i — a browser tab (a cloud tab) has no Mac to sleep: when everything running there runs in the cloud, the
19
+ * foot says only the part that is true. The desktop keeps RUNNING_FOOT whatever runs.
20
+ */
21
+ export const RUNNING_FOOT_CLOUD = 'Cloud renders keep going if the window closes.';
22
+ export function runningFoot(jobs, { native = true } = {}) {
23
+ const active = (Array.isArray(jobs) ? jobs : []).filter(
24
+ (j) => j?.status === 'queued' || j?.status === 'running'
25
+ );
26
+ if (!native && active.length > 0 && active.every((j) => j.runsOn === 'cloud'))
27
+ return RUNNING_FOOT_CLOUD;
28
+ return RUNNING_FOOT;
29
+ }
17
30
  export const OPEN_FOLDER = 'Open the Downloads folder';
18
31
  export const SHOW_IN_FINDER = 'Show in Finder';
19
32
  export const DOWNLOAD = 'Download';
@@ -24,7 +24,7 @@ import {
24
24
  PANEL_FOOT,
25
25
  PANEL_TITLE,
26
26
  panelGroups,
27
- RUNNING_FOOT,
27
+ runningFoot,
28
28
  } from './exports-model.js';
29
29
 
30
30
  const EMPTY_ID = 'es-panels-make.exports-none';
@@ -157,7 +157,9 @@ export function ExportsPanel({
157
157
  )}
158
158
  </div>
159
159
  {groups.length > 0 ? (
160
- <p className="ex-panel-foot">{running ? RUNNING_FOOT : PANEL_FOOT}</p>
160
+ <p className="ex-panel-foot">
161
+ {running ? runningFoot(center.jobs, { native }) : PANEL_FOOT}
162
+ </p>
161
163
  ) : null}
162
164
  </div>
163
165
  );
@@ -24,6 +24,7 @@ import {
24
24
  whereOf,
25
25
  } from './exports-model.js';
26
26
  import { isQueuedCloud, RENDER_HERE } from './cloud-queue.js';
27
+ import { onCanvasPointer } from '../shell/canvas-pointer.js';
27
28
 
28
29
  // Per-job anchor for the ETA: the FIRST progress sample the client sees. For a video export that is
29
30
  // the first frame-step frame — after the (progress-less) renderMediaOnWeb attempt — so the rate is
@@ -138,9 +139,12 @@ function RowMenu({ job, native, on, anchorRef, onClose }) {
138
139
  };
139
140
  document.addEventListener('pointerdown', onPointer, true);
140
141
  document.addEventListener('keydown', onKey, true);
142
+ // rc3 r4-12 — a press in the canvas closes it too (told over the dgn bridge; it never reaches this document)
143
+ const offCanvas = onCanvasPointer(() => onClose());
141
144
  return () => {
142
145
  document.removeEventListener('pointerdown', onPointer, true);
143
146
  document.removeEventListener('keydown', onKey, true);
147
+ offCanvas();
144
148
  };
145
149
  }, [anchorRef, onClose]);
146
150
  const run = (id) => {
@@ -7,6 +7,7 @@
7
7
 
8
8
  import { useEffect, useLayoutEffect, useRef, useState } from 'react';
9
9
  import { matchOther, OTHER_LABEL, OTHER_NONE, OTHER_SEARCH } from './export-copy.js';
10
+ import { onCanvasPointer } from '../shell/canvas-pointer.js';
10
11
 
11
12
  const GAP = 4;
12
13
  const EDGE = 16;
@@ -84,7 +85,12 @@ export function OtherFormats({ groups, format, onPick, open, setOpen }) {
84
85
  if (!root.current?.contains(e.target)) setOpen(false);
85
86
  };
86
87
  document.addEventListener('mousedown', away);
87
- return () => document.removeEventListener('mousedown', away);
88
+ // rc3 r4-12 — a press in the canvas closes it too (told over the dgn bridge; it never reaches this document)
89
+ const offCanvas = onCanvasPointer(() => setOpen(false));
90
+ return () => {
91
+ document.removeEventListener('mousedown', away);
92
+ offCanvas();
93
+ };
88
94
  }, [open, setOpen]);
89
95
 
90
96
  const rows = () => [
@@ -193,10 +193,11 @@ export const isBig = (est) =>
193
193
  * the cloud — that the window can close once this Mac's part is done. `summary` is the sheet's own
194
194
  * estimate sentence (counts, size, time), so the two never disagree.
195
195
  */
196
- export function bigWords(est, { summary, hasVideo }) {
196
+ export function bigWords(est, { summary, hasVideo, workspace = false }) {
197
197
  if (!isBig(est)) return null;
198
198
  const head = `This is a big export — ${summary ?? `${countWord(est.files)} files`}.`;
199
- if (hasVideo && est.lane === 'cloud')
199
+ // rc3-i — a cloud tab has no "this Mac's part": the sheet's own browser captures stay with the window
200
+ if (hasVideo && est.lane === 'cloud' && !workspace)
200
201
  return `${head} Once this Mac’s part is done you can close the window — the cloud finishes the videos.`;
201
202
  return `${head} Keep this window open until it is done.`;
202
203
  }
@@ -53,7 +53,17 @@ export function stillsOf(pictures, kind, max = 3) {
53
53
  .map((i) => ({ url: i.picture.url, label: i.label }));
54
54
  }
55
55
 
56
- function Group({ kind, row, pick, cloud, onPick, boards = [], canvases = 0, stills = [] }) {
56
+ function Group({
57
+ kind,
58
+ row,
59
+ pick,
60
+ cloud,
61
+ workspace = false,
62
+ onPick,
63
+ boards = [],
64
+ canvases = 0,
65
+ stills = [],
66
+ }) {
57
67
  const Icon = KIND_ICON[kind] ?? DigitalIcon;
58
68
  const choice = choiceFor(kind, { [kind]: pick });
59
69
  // 09: the small note under the value — what the format adds (print: "Bleed + crop marks"), or that a video renders in
@@ -70,7 +80,8 @@ function Group({ kind, row, pick, cloud, onPick, boards = [], canvases = 0, stil
70
80
  </strong>
71
81
  <span className="ex-group-s" data-testid={`export-group-${kind}-names`}>
72
82
  {canvases > 1 ? `from ${canvases} canvases — ` : ''}
73
- {namesLine(boards) || (kind === 'video' && cloud ? WHERE_CLOUD : WHERE_THIS_MAC)}
83
+ {namesLine(boards) ||
84
+ (kind === 'video' && cloud ? WHERE_CLOUD : workspace ? '' : WHERE_THIS_MAC)}
74
85
  </span>
75
86
  </div>
76
87
  {stills.length ? (
@@ -142,7 +153,7 @@ function IncludeRow({ state, set, counts }) {
142
153
  * @param est the server's estimate (`byKind`, `skipped`, `counts`, numbers)
143
154
  * @param setFormat the sheet's format setter (Project ZIP instead)
144
155
  */
145
- export function BatchSection({ state, set, est, setFormat, pictures }) {
156
+ export function BatchSection({ state, set, est, setFormat, pictures, workspace = false }) {
146
157
  const byKind = est?.byKind ?? {};
147
158
  const boards = est?.boards ?? [];
148
159
  const kinds = orderKinds(Object.keys(byKind));
@@ -150,7 +161,11 @@ export function BatchSection({ state, set, est, setFormat, pictures }) {
150
161
  const cloud = est?.lane === 'cloud';
151
162
  const shared = sharedPartsLine(est?.skipped);
152
163
  const unit = formatSkipLine(est?.skipped);
153
- const big = bigWords(est, { summary: summaryWords(est), hasVideo: kinds.includes('video') });
164
+ const big = bigWords(est, {
165
+ summary: summaryWords(est, { workspace }),
166
+ hasVideo: kinds.includes('video'),
167
+ workspace,
168
+ });
154
169
  return (
155
170
  <>
156
171
  {/* biome-ignore lint/a11y/useSemanticElements: a labelled run of format groups, not a form fieldset */}
@@ -167,6 +182,7 @@ export function BatchSection({ state, set, est, setFormat, pictures }) {
167
182
  row={byKind[kind]}
168
183
  pick={picks[kind]}
169
184
  cloud={cloud}
185
+ workspace={workspace}
170
186
  boards={boards.filter((b) => (b.kind ?? 'digital') === kind)}
171
187
  canvases={
172
188
  new Set(boards.filter((b) => (b.kind ?? 'digital') === kind).map((b) => b.canvas))
@@ -26,6 +26,7 @@ import { deltaE } from '../../../../ds/nearest.ts';
26
26
  import { requestDsMake } from '../../ds/default-write.js';
27
27
  import { addColourNow } from '../../ds/edge-write.js';
28
28
  import { OffSystemQuestion } from '../../ds/off-system.jsx';
29
+ import { onCanvasPointer } from '../../shell/canvas-pointer.js';
29
30
  import { colourGroups, groupOf, swatchOf } from '../colour-groups.js';
30
31
  import {
31
32
  GradientEditor,
@@ -302,9 +303,12 @@ export function ColourPopover({
302
303
  const away = () => closeRef.current();
303
304
  document.addEventListener('pointerdown', down, true);
304
305
  window.addEventListener('blur', away);
306
+ // rc3 r4-12 — a press in the canvas, told over the dgn bridge (WebKit gives this window no blur for it)
307
+ const offCanvas = onCanvasPointer(away);
305
308
  return () => {
306
309
  document.removeEventListener('pointerdown', down, true);
307
310
  window.removeEventListener('blur', away);
311
+ offCanvas();
308
312
  };
309
313
  }, [anchorRef]);
310
314
 
@@ -12,6 +12,7 @@ import { lengthPx, nearestSpace, tokenLabel } from '../../../edit-ops/words-css.
12
12
  import { ScrubLabelContext, makeScrubHandler } from '../../inspector-controls.jsx';
13
13
  import { StIcon } from '../../shell/icons.jsx';
14
14
  import { activeDsNameFor, useAllDsTokens } from '../../inspector/ds-tokens.js';
15
+ import { onCanvasPointer } from '../shell/canvas-pointer.js';
15
16
 
16
17
  const pxOf = (value) => {
17
18
  const m = /^(-?\d*\.?\d+)(px|rem)?$/i.exec(String(value ?? '').trim());
@@ -73,9 +74,12 @@ export function useDismiss(open, onClose, ref) {
73
74
  };
74
75
  document.addEventListener('pointerdown', down, true);
75
76
  document.addEventListener('keydown', key, true);
77
+ // rc3 r4-12 — a press in the canvas closes it too (told over the dgn bridge; it never reaches this document)
78
+ const offCanvas = onCanvasPointer(() => onClose());
76
79
  return () => {
77
80
  document.removeEventListener('pointerdown', down, true);
78
81
  document.removeEventListener('keydown', key, true);
82
+ offCanvas();
79
83
  };
80
84
  }, [open, onClose, ref]);
81
85
  }
@@ -17,6 +17,7 @@
17
17
  // overlay. Tokens only (size-picker.css).
18
18
 
19
19
  import { useEffect, useMemo, useRef, useState } from 'react';
20
+ import { onCanvasPointer } from '../shell/canvas-pointer.js';
20
21
  import {
21
22
  DigitalIcon,
22
23
  ImageIcon,
@@ -328,10 +329,13 @@ export default function SizePicker({
328
329
  window.addEventListener('keydown', onKey, true);
329
330
  document.addEventListener('pointerdown', onDown, true);
330
331
  window.addEventListener('blur', onBlur);
332
+ // rc3 r4-12 — a press in the canvas, told over the dgn bridge (WebKit gives this window no blur for it)
333
+ const offCanvas = onCanvasPointer(onBlur);
331
334
  return () => {
332
335
  window.removeEventListener('keydown', onKey, true);
333
336
  document.removeEventListener('pointerdown', onDown, true);
334
337
  window.removeEventListener('blur', onBlur);
338
+ offCanvas();
335
339
  };
336
340
  }, []);
337
341
 
@@ -21,6 +21,7 @@ import {
21
21
  } from '../../../presence/model.ts';
22
22
  import { toneFor, toneVar, YOU_TONE } from '../../../presence/tones.ts';
23
23
  import { Glyph, SparkGlyph } from '../share/glyphs.jsx';
24
+ import { onCanvasPointer } from '../shell/canvas-pointer.js';
24
25
 
25
26
  const isPeer = (f) => !f.you && !f.agent && typeof f.clientID === 'number';
26
27
 
@@ -40,9 +41,12 @@ function useDismiss(open, onClose, ref, restore) {
40
41
  };
41
42
  document.addEventListener('mousedown', onDown);
42
43
  document.addEventListener('keydown', onKey, true);
44
+ // rc3 r4-12 — a press in the canvas closes it too (told over the dgn bridge; it never reaches this document)
45
+ const offCanvas = onCanvasPointer(() => onClose());
43
46
  return () => {
44
47
  document.removeEventListener('mousedown', onDown);
45
48
  document.removeEventListener('keydown', onKey, true);
49
+ offCanvas();
46
50
  };
47
51
  }, [open, onClose, ref, restore]);
48
52
  }
@@ -20,6 +20,7 @@ import { useEffect, useLayoutEffect, useState } from 'react';
20
20
  import { useModalFocus } from '../shell/modal-focus.js';
21
21
  import { Glyph } from './glyphs.jsx';
22
22
  import { ROLE_WORDS } from './share-model.js';
23
+ import { onCanvasPointer } from '../shell/canvas-pointer.js';
23
24
 
24
25
  /** Where a menu of `size` hangs from `anchor`: right-aligned, below, or above when it would not fit. */
25
26
  export function menuPlace(anchorRect, size, view, gap = 4) {
@@ -59,7 +60,12 @@ export function RoleMenu({ row, roles, makeOwner, scopeName, anchor, onPick, onC
59
60
  if (ref.current && !ref.current.contains(e.target)) onClose();
60
61
  };
61
62
  document.addEventListener('mousedown', onDown, true);
62
- return () => document.removeEventListener('mousedown', onDown, true);
63
+ // rc3 r4-12 — a press in the canvas closes it too (told over the dgn bridge; it never reaches this document)
64
+ const offCanvas = onCanvasPointer(() => onClose());
65
+ return () => {
66
+ document.removeEventListener('mousedown', onDown, true);
67
+ offCanvas();
68
+ };
63
69
  }, [onClose, ref]);
64
70
 
65
71
  const onKeyDown = (e) => {
@@ -368,7 +368,9 @@ export function advancedView({ view, shell, hubUrl } = {}) {
368
368
  }
369
369
  : null,
370
370
  hint: !linked
371
- ? 'Addresses that open on this Mac'
371
+ ? shell === 'cloud'
372
+ ? 'Other ways in'
373
+ : 'Addresses that open on this Mac'
372
374
  : selfHosted
373
375
  ? 'Other ways in, sync, roles'
374
376
  : 'Links, link rules, sync',
@@ -467,3 +469,20 @@ export function shareApi(fetchImpl = (...a) => fetch(...a)) {
467
469
  confirmLink: () => go('POST', '/_api/sync/link/confirm', {}),
468
470
  };
469
471
  }
472
+
473
+ /**
474
+ * The sentence under a queued invite when the studio gave none (the desktop's route always does), and under
475
+ * Share while offline. rc3-i — a cloud tab (shell `cloud`) has no Mac in it.
476
+ */
477
+ export const INVITES_WAIT_CLOUD = 'Invites send when you are back online.';
478
+ export const queuedInviteWords = (shell) =>
479
+ shell === 'cloud' ? INVITES_WAIT_CLOUD : 'Invites send when this Mac is online.';
480
+
481
+ /**
482
+ * The line under a linked project the hub cannot be asked about. The desktop queues an invite on this Mac
483
+ * until it reaches the project; a cloud tab queues nothing — it just cannot reach its workspace.
484
+ */
485
+ export const unreachableWords = (shell) =>
486
+ shell === 'cloud'
487
+ ? 'Sharing is not available right now. Try again in a moment.'
488
+ : 'Sharing is not available right now. Invites you send wait here and go out once this Mac reaches the project.';
@@ -37,12 +37,14 @@ import {
37
37
  LINK_CONFIRMED_EVENT,
38
38
  lastSyncedAt,
39
39
  peopleRows,
40
+ queuedInviteWords,
40
41
  readJoinAs,
41
42
  roleWord,
42
43
  shareApi,
43
44
  sheetView,
44
45
  takeShareFocus,
45
46
  teamRow,
47
+ unreachableWords,
46
48
  writeJoinAs,
47
49
  } from './share-model.js';
48
50
 
@@ -267,7 +269,7 @@ export function ShareSheet({
267
269
  if (r.status === 202 && r.body?.queued) {
268
270
  setNotice({
269
271
  kind: 'queued',
270
- text: r.body.words ?? 'Invites send when this Mac is online.',
272
+ text: r.body.words ?? queuedInviteWords(shell),
271
273
  });
272
274
  return true;
273
275
  }
@@ -444,7 +446,8 @@ export function ShareSheet({
444
446
  </button>
445
447
  </div>
446
448
  )}
447
- {posture && !view.linked && !offerMove && !moving && !pendingLink && (
449
+ {/* a cloud tab is never a "local project": it IS the workspace, so this line has no true form there (rc3-i) */}
450
+ {posture && !view.linked && !offerMove && !moving && !pendingLink && shell !== 'cloud' && (
448
451
  <div className="v2sh-arow v2sh-arow--stack">
449
452
  <p className="v2sh-hint" data-testid="share-local-note">
450
453
  Local project — kept on this Mac. To invite people, move it to Maude Cloud in the
@@ -455,8 +458,7 @@ export function ShareSheet({
455
458
  )}
456
459
  {posture && view.linked && !view.reachable && (
457
460
  <p className="v2sh-hint" data-testid="share-unreachable">
458
- Sharing is not available right now. Invites you send wait here and go out once this Mac
459
- reaches the project.
461
+ {unreachableWords(shell)}
460
462
  </p>
461
463
  )}
462
464
 
@@ -13,6 +13,7 @@
13
13
 
14
14
  import { useCallback, useEffect, useId, useRef, useState } from 'react';
15
15
  import { StIcon } from '../../shell/icons.jsx';
16
+ import { onCanvasPointer } from './canvas-pointer.js';
16
17
 
17
18
  function Face({ initial, tone, size = 'md' }) {
18
19
  return (
@@ -48,7 +49,12 @@ export function AccountChip({ chip, card, onSwitch, onSignOut }) {
48
49
  if (wrap.current && !wrap.current.contains(e.target)) close(false);
49
50
  };
50
51
  document.addEventListener('pointerdown', onDown, true);
51
- return () => document.removeEventListener('pointerdown', onDown, true);
52
+ // rc3 r4-12 — a press in the canvas closes it too (told over the dgn bridge; it never reaches this document)
53
+ const offCanvas = onCanvasPointer(() => close(false));
54
+ return () => {
55
+ document.removeEventListener('pointerdown', onDown, true);
56
+ offCanvas();
57
+ };
52
58
  }, [open, close]);
53
59
 
54
60
  if (!chip || !card) return null;
@@ -0,0 +1,21 @@
1
+ // client/v2/shell/canvas-pointer.js — rc3 r4-12: "a press landed in the canvas", as a shell-window event.
2
+ //
3
+ // The canvas iframe (another origin, DDR-054) posts `{dgn:'canvas-pointerdown'}` on every press
4
+ // (editing/canvas-pointer.ts); the shell's canvas bridge accepts it from the active canvas only (the dgn table's
5
+ // `active` gate) and calls `announceCanvasPointer()`. Anything in the shell that closes on "a click anywhere
6
+ // else" listens with `onCanvasPointer` — use-dismiss-outside.js does, so every menu built on it closes on a
7
+ // click into the canvas even where the shell window gets no blur for it (WebKit, the packaged app).
8
+
9
+ export const CANVAS_POINTER_EVENT = 'maude:canvas-pointerdown';
10
+
11
+ /** Tell the shell's listeners that a press landed in the canvas. */
12
+ export function announceCanvasPointer(win = typeof window === 'undefined' ? null : window) {
13
+ win?.dispatchEvent(new Event(CANVAS_POINTER_EVENT));
14
+ }
15
+
16
+ /** Run `fn` on each press in the canvas. Returns the unsubscribe. */
17
+ export function onCanvasPointer(fn, win = typeof window === 'undefined' ? null : window) {
18
+ if (!win) return () => {};
19
+ win.addEventListener(CANVAS_POINTER_EVENT, fn);
20
+ return () => win.removeEventListener(CANVAS_POINTER_EVENT, fn);
21
+ }
@@ -23,6 +23,7 @@ import { formatChord } from '../../../actions/keys.ts';
23
23
  import { StIcon } from '../../shell/icons.jsx';
24
24
  import { MODE_WORD, modeSegments } from './canvas-mode.js';
25
25
  import { reasonProps } from '../access/disabled-reason.js';
26
+ import { onCanvasPointer } from './canvas-pointer.js';
26
27
 
27
28
  const GLYPH = {
28
29
  edit: (
@@ -253,9 +254,12 @@ export function ModeSwitch({
253
254
  };
254
255
  document.addEventListener('pointerdown', onDown, true);
255
256
  document.addEventListener('keydown', onKey, true);
257
+ // rc3 r4-12 — a press in the canvas closes it too (told over the dgn bridge; it never reaches this document)
258
+ const offCanvas = onCanvasPointer(() => setMenu(false));
256
259
  return () => {
257
260
  document.removeEventListener('pointerdown', onDown, true);
258
261
  document.removeEventListener('keydown', onKey, true);
262
+ offCanvas();
259
263
  };
260
264
  }, [menu]);
261
265