@1agh/maude 2.0.4 → 2.0.6

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 (129) hide show
  1. package/apps/hub/src/project-transactions/kernel.mjs +10 -1
  2. package/apps/studio/access/filters.ts +12 -5
  3. package/apps/studio/access/known-canvases.ts +24 -1
  4. package/apps/studio/access/refused-inputs.ts +89 -0
  5. package/apps/studio/actions/agents.ts +5 -0
  6. package/apps/studio/actions/defs/app.ts +12 -0
  7. package/apps/studio/actions.manifest.json +13 -1
  8. package/apps/studio/actions.parity.json +7 -1
  9. package/apps/studio/annotations/ui/element-node.tsx +139 -54
  10. package/apps/studio/annotations/ui/lod.tsx +1 -1
  11. package/apps/studio/annotations/ui/text-style.ts +1 -1
  12. package/apps/studio/annotations-layer.tsx +0 -12
  13. package/apps/studio/api.ts +42 -0
  14. package/apps/studio/artboard-live-gate.tsx +267 -0
  15. package/apps/studio/artboard-live.ts +336 -0
  16. package/apps/studio/artboard-webgl.ts +668 -0
  17. package/apps/studio/bin/_agent-browser-bin.mjs +8 -0
  18. package/apps/studio/bin/_agent-browser-safe.mjs +2 -1
  19. package/apps/studio/bin/_canvas-reasons.mjs +34 -0
  20. package/apps/studio/bin/_ds-check-live.mjs +37 -0
  21. package/apps/studio/bin/_ds-check.mjs +4 -1
  22. package/apps/studio/bin/_ds-prove-judge.mjs +167 -0
  23. package/apps/studio/bin/_ds-prove-playwright.mjs +183 -105
  24. package/apps/studio/bin/_import-asset.mjs +2 -1
  25. package/apps/studio/bin/_perf-probe.mjs +2 -1
  26. package/apps/studio/bin/_studio-verb.mjs +24 -3
  27. package/apps/studio/bin/_thumb-blank.mjs +70 -0
  28. package/apps/studio/bin/_thumb-cover.mjs +35 -0
  29. package/apps/studio/bin/_thumbs-playwright.mjs +89 -12
  30. package/apps/studio/bin/ds-check.sh +5 -1
  31. package/apps/studio/bin/perf.sh +11 -1
  32. package/apps/studio/bin/server-up.sh +7 -2
  33. package/apps/studio/bin/smoke.sh +19 -0
  34. package/apps/studio/canvas-lib.tsx +131 -12
  35. package/apps/studio/client/canvas-url.js +13 -0
  36. package/apps/studio/client/home/HomeAccounts.jsx +262 -0
  37. package/apps/studio/client/home/Shelves.jsx +4 -3
  38. package/apps/studio/client/home/home-accounts-model.js +121 -0
  39. package/apps/studio/client/home/home-api.js +6 -0
  40. package/apps/studio/client/home/home-app.jsx +141 -40
  41. package/apps/studio/client/home/home-model.js +172 -6
  42. package/apps/studio/client/home/home.css +169 -5
  43. package/apps/studio/client/home/shell-mode.js +8 -1
  44. package/apps/studio/client/hooks/use-project-data.jsx +2 -0
  45. package/apps/studio/client/panels/ChatPanel.jsx +27 -20
  46. package/apps/studio/client/panels/CreateProject.jsx +19 -5
  47. package/apps/studio/client/panels/caps-cache.js +46 -0
  48. package/apps/studio/client/shell/viewport.jsx +36 -8
  49. package/apps/studio/client/v2/access/access-client.js +2 -0
  50. package/apps/studio/client/v2/access/access-host.jsx +12 -1
  51. package/apps/studio/client/v2/access/trashed-banner.jsx +6 -3
  52. package/apps/studio/client/v2/ai/Advanced.jsx +12 -0
  53. package/apps/studio/client/v2/ai/Composer.jsx +27 -10
  54. package/apps/studio/client/v2/code/canvas-imports-card.jsx +15 -14
  55. package/apps/studio/client/v2/code/canvas-imports-words.js +44 -0
  56. package/apps/studio/client/v2/code/code-bus.js +5 -0
  57. package/apps/studio/client/v2/ds/advanced-host.jsx +11 -26
  58. package/apps/studio/client/v2/ds/ds-refresh.js +161 -0
  59. package/apps/studio/client/v2/ds/library-host.jsx +45 -45
  60. package/apps/studio/client/v2/ds/make-host.jsx +13 -15
  61. package/apps/studio/client/v2/ds/off-system-host.jsx +18 -19
  62. package/apps/studio/client/v2/ds/review-host.jsx +7 -1
  63. package/apps/studio/client/v2/ds/truth-host.jsx +15 -17
  64. package/apps/studio/client/v2/ds/upgrade-host.jsx +26 -10
  65. package/apps/studio/client/v2/history/branch-actions.js +13 -9
  66. package/apps/studio/client/v2/history/git-advanced.jsx +8 -1
  67. package/apps/studio/client/v2/history/git-model.js +3 -1
  68. package/apps/studio/client/v2/history/git-parts.jsx +16 -1
  69. package/apps/studio/client/v2/presence/faces.jsx +42 -14
  70. package/apps/studio/client/v2/shell/account-card.jsx +10 -4
  71. package/apps/studio/client/v2/shell/canvas-crash-guard.js +137 -0
  72. package/apps/studio/client/v2/shell/github-signin-host.jsx +42 -0
  73. package/apps/studio/client/v2/shell/menu-runner.js +11 -0
  74. package/apps/studio/client/v2/shell/project-account-card.jsx +203 -0
  75. package/apps/studio/client/v2/shell/project-account-model.js +182 -0
  76. package/apps/studio/client/v2/shell/share-cluster-host.jsx +137 -10
  77. package/apps/studio/client/v2/shell/share-cluster.css +58 -0
  78. package/apps/studio/client/v2/shell/share-cluster.jsx +26 -7
  79. package/apps/studio/client/v2/shell/team-switch.js +94 -0
  80. package/apps/studio/client/v2/shell/too-heavy-card.jsx +38 -0
  81. package/apps/studio/client/v2/shell/use-account.js +8 -1
  82. package/apps/studio/collab/persistence.ts +9 -1
  83. package/apps/studio/collab/registry.ts +32 -0
  84. package/apps/studio/collab/room.ts +8 -0
  85. package/apps/studio/config-reload-wire.ts +53 -0
  86. package/apps/studio/dist/client.bundle.js +1232 -1232
  87. package/apps/studio/dist/styles.css +1 -1
  88. package/apps/studio/ds/board/specimen.tsx +12 -1
  89. package/apps/studio/ds/canvas-cli.ts +58 -2
  90. package/apps/studio/ds/check.ts +26 -1
  91. package/apps/studio/ds/cli.ts +7 -3
  92. package/apps/studio/ds/convert.ts +34 -6
  93. package/apps/studio/ds/ds-verb.ts +13 -0
  94. package/apps/studio/ds/post-build.ts +38 -0
  95. package/apps/studio/ds/upgrade-apply.ts +27 -5
  96. package/apps/studio/ds/upgrade-cli.ts +22 -2
  97. package/apps/studio/ds/upgrade-prove.ts +198 -15
  98. package/apps/studio/ds/upgrade-stage.ts +4 -1
  99. package/apps/studio/history/trash.ts +6 -0
  100. package/apps/studio/home/accounts.ts +87 -0
  101. package/apps/studio/home/index-reader.ts +24 -2
  102. package/apps/studio/home/routes.ts +19 -0
  103. package/apps/studio/http.ts +14 -2
  104. package/apps/studio/routes/ds-convert.ts +18 -0
  105. package/apps/studio/routes/trash.ts +16 -1
  106. package/apps/studio/server.ts +8 -10
  107. package/apps/studio/sync/accepted-cold-start.ts +28 -13
  108. package/apps/studio/sync/asset-push.ts +146 -23
  109. package/apps/studio/sync/asset-state.ts +3 -2
  110. package/apps/studio/sync/file-membership.ts +28 -3
  111. package/apps/studio/sync/file-plane.ts +40 -9
  112. package/apps/studio/sync/file-pull.ts +304 -33
  113. package/apps/studio/sync/hub-link.ts +1 -2
  114. package/apps/studio/sync/index.ts +308 -150
  115. package/apps/studio/sync/journal-client.ts +94 -5
  116. package/apps/studio/sync/pending-deletes.ts +100 -0
  117. package/apps/studio/sync/projection.ts +77 -12
  118. package/apps/studio/sync/seed-progress.ts +12 -1
  119. package/apps/studio/sync/status.ts +3 -1
  120. package/apps/studio/thumbs/service.ts +12 -2
  121. package/apps/studio/thumbs/validate.ts +7 -0
  122. package/apps/studio/ui-prefs-migrate.ts +4 -0
  123. package/apps/studio/video-comp.tsx +23 -0
  124. package/apps/studio/whats-new.json +72 -0
  125. package/cli/lib/bash-guard.mjs +13 -1
  126. package/cli/lib/design-help.gen.mjs +1 -1
  127. package/cli/lib/design-hook.mjs +20 -0
  128. package/cli/lib/studio-locate.mjs +35 -10
  129. package/package.json +8 -8
@@ -115,6 +115,12 @@ import {
115
115
  type GuideDefinitions,
116
116
  type OverlayVisibility,
117
117
  } from './artboard-guides-overlay.tsx';
118
+ import {
119
+ ARTBOARD_LIVE_CSS,
120
+ ArtboardLiveFeed,
121
+ ArtboardLiveGate,
122
+ holdAllLive,
123
+ } from './artboard-live-gate.tsx';
118
124
  import { ArtboardNewSection, useNewSection } from './artboard-new-section.tsx';
119
125
  import {
120
126
  ArtboardWarnMark,
@@ -215,6 +221,9 @@ import { UndoStackProvider, useUndoSinks, useUndoStackOptional } from './use-und
215
221
  import { VideoComp } from './video-comp.tsx';
216
222
  import { VideoPlayLayer } from './video-play-overlay.tsx';
217
223
 
224
+ // 2.0.5 — is this artboard running live (near the viewport, not zoomed out to the overview)? Gate a render
225
+ // loop, a simulation or an expensive first mount on it. Always true in captures and exports.
226
+ export { useArtboardActive, useArtboardSeen } from './artboard-live-gate.tsx';
218
227
  export type { CompSnapshot, VideoCompMeta, VideoCompProps } from './video-comp.tsx';
219
228
  // S7.5 — the comp vocabulary (V2-1.10 §5.3): literal-prop components; the build injects their
220
229
  // derived data (`__words`, `__speech`, video/inject.ts). A 1.x build lacks these exports, so a
@@ -343,6 +352,8 @@ type DcPerfCounters = {
343
352
  annotationRenders: number;
344
353
  /** Annotation element nodes (re-)rendered — a drag should touch only what moves. */
345
354
  annotationNodeRenders?: number;
355
+ /** Section title chips (re-)rendered — a pan/zoom gesture should render none (2.0.5 W2). */
356
+ sectionChipRenders?: number;
346
357
  instrumented?: boolean;
347
358
  };
348
359
 
@@ -522,6 +533,7 @@ const ENGINE_CSS = `
522
533
  /* S3.14 - Present draws the work only (04 md-present-*): the editor chrome list is present/present-stage.tsx
523
534
  PRESENT_HIDES, keyed on the root attribute the stage sets while any Present is on. */
524
535
  ${presentHidesCss()}
536
+ ${ARTBOARD_LIVE_CSS}
525
537
  .dc-canvas .dc-artboard-label {
526
538
  flex-shrink: 0;
527
539
  background: var(--maude-chrome-bg-2, #e8e3d8);
@@ -638,7 +650,8 @@ input.dc-artboard-rename {
638
650
  /* V2-8.8 (WebKit M7) - on the WebKit scale path (transform, see writeTransform) the name and the video badge get
639
651
  their OWN compositor layer. They are re-sized every zoom frame by the counter-scale above and paint outside the
640
652
  frame, so inside the board's layer (will-change, the per-board raster freeze) they moved its bounds every frame
641
- and WebKit re-rastered every board on every zoom frame. Blink (CSS zoom) relayouts the world anyway; untouched. */
653
+ and WebKit re-rastered every board on every zoom frame. Settled Blink (CSS zoom) relayouts the world anyway;
654
+ during a Blink zoom gesture the world is on the transform path too (2.0.5 W2, writeTransform flips the flag). */
642
655
  .dc-world[data-dc-scale='transform'] .dc-artboard.dc-positioned > .dc-artboard-label,
643
656
  .dc-world[data-dc-scale='transform'] .dc-artboard.dc-positioned > .dc-artboard-video-badge {
644
657
  will-change: transform;
@@ -1243,6 +1256,35 @@ export function getLiveViewport(): ViewportState | null {
1243
1256
  return liveViewport ? { ...liveViewport } : null;
1244
1257
  }
1245
1258
 
1259
+ /**
1260
+ * 2.0.5 W2 — counter-scaled chrome that sits BELOW a `--dc-zoom` reset. The annotation scene stops the
1261
+ * world's `--dc-zoom` (a custom property inherits, so a zoom frame would otherwise restyle every element
1262
+ * of the board), but a section's title chip still has to hold its screen size, and drawing it from
1263
+ * `useLiveViewport()` re-rendered every chip at ~20 Hz through a gesture. A node given this ref gets
1264
+ * `--dc-zoom` written straight onto it with every camera write (writeTransform), so its CSS
1265
+ * (`scale(calc(1 / var(--dc-zoom, 1)))`) tracks the live zoom with no React work and no inheritance
1266
+ * through the scene. Node → the world it sits in (only that world's writes feed it).
1267
+ */
1268
+ const screenSizedNodes = new Map<HTMLElement, HTMLElement | null>();
1269
+ /**
1270
+ * True on Blink, where CSS-counter-scaled chrome (`screenSizedRef`) is used. WebKit (Safari + the WKWebView
1271
+ * desktop app) keeps sizing that chrome from `useLiveViewport()`: the per-frame transform was not shown to be
1272
+ * free there, and the desktop app must not regress (2.0.5 W2).
1273
+ */
1274
+ export function cssCounterScaledChrome(): boolean {
1275
+ return !IS_WEBKIT;
1276
+ }
1277
+ export function screenSizedRef(node: HTMLElement | null): (() => void) | undefined {
1278
+ if (!node) return undefined;
1279
+ const world = node.closest<HTMLElement>('.dc-world');
1280
+ screenSizedNodes.set(node, world);
1281
+ const z = world?.style.getPropertyValue('--dc-zoom');
1282
+ if (z) node.style.setProperty('--dc-zoom', z);
1283
+ return () => {
1284
+ screenSizedNodes.delete(node);
1285
+ };
1286
+ }
1287
+
1246
1288
  /**
1247
1289
  * Viewport for the few consumers that must track a gesture AS IT HAPPENS —
1248
1290
  * the minimap indicator and the zoom % readout. Everything else reads the
@@ -1400,6 +1442,18 @@ export function useViewportController(opts: ViewportControllerOptions): Viewport
1400
1442
  const el = worldRef.current;
1401
1443
  if (!el) return;
1402
1444
  const z = v.zoom || 1;
1445
+ // 2.0.5 W2 — a Blink ZOOM gesture scales the already-promoted world layer with `transform` instead:
1446
+ // CSS `zoom` re-laid-out the whole world on every zoom frame (~2.4k layout objects on a 714-element
1447
+ // board, zoom p95 33 ms). The CSS `zoom` the gesture started at is HELD and only the residual scale
1448
+ // (z / held) goes on the transform, so the gesture's first scaling frame lays out nothing either —
1449
+ // dropping `zoom` to '' there re-laid-out the whole world at 1x (and again when a symmetric gesture
1450
+ // came back to its start scale): two full-layout frames inside every zoom, which is the zoom p95.
1451
+ // Only while a burst is changing scale and the write is not the settle one — the settle (`crisp`,
1452
+ // from markInteracting's quiet timer) writes the final CSS `zoom`, so text re-rasters crisp and every
1453
+ // reader of a settled camera (export shims, screenshot, canvas-rects) sees CSS `zoom` exactly as
1454
+ // before. A pure pan (scale unchanged) never leaves CSS `zoom`. WebKit is untouched.
1455
+ const blinkGestureScale =
1456
+ !IS_WEBKIT && !opts?.crisp && interactingRef.current && z !== zoomAtInteractStartRef.current;
1403
1457
  if (IS_WEBKIT) {
1404
1458
  el.style.zoom = '';
1405
1459
  el.style.transformOrigin = '0 0';
@@ -1408,10 +1462,20 @@ export function useViewportController(opts: ViewportControllerOptions): Viewport
1408
1462
  // WebKit re-paints text crisp at the new scale instead of upscaling the
1409
1463
  // cached bitmap.
1410
1464
  el.style.willChange = opts?.crisp ? 'auto' : 'transform';
1465
+ } else if (blinkGestureScale) {
1466
+ // under `zoom: held` the transform is in pre-zoom px: screen = held·(t + s·world) = x + z·world
1467
+ const held = Number.parseFloat(el.style.zoom) || 1;
1468
+ el.style.transformOrigin = '0 0';
1469
+ el.style.transform = `translate(${v.x / held}px, ${v.y / held}px) scale(${z / held})`;
1411
1470
  } else {
1471
+ el.style.transformOrigin = '';
1412
1472
  el.style.transform = `translate(${v.x / z}px, ${v.y / z}px)`;
1413
1473
  el.style.zoom = String(z);
1414
1474
  }
1475
+ // The scale path the world is on RIGHT NOW (CSS keys off it — `[data-dc-scale='transform']`). The JSX
1476
+ // seeds the engine default; on Blink it flips for the length of a zoom gesture.
1477
+ const scaleMode = IS_WEBKIT || blinkGestureScale ? 'transform' : 'zoom';
1478
+ if (el.dataset.dcScale !== scaleMode) el.dataset.dcScale = scaleMode;
1415
1479
  // Live zoom for counter-scaled chrome (section labels, connector dots,
1416
1480
  // selection bboxes — anything that must stay a constant number of SCREEN px
1417
1481
  // while the world scales). It has to be written per frame, right here: the
@@ -1419,7 +1483,11 @@ export function useViewportController(opts: ViewportControllerOptions): Viewport
1419
1483
  // would scale with the world through a pinch and snap back at the end —
1420
1484
  // reintroducing exactly the fidelity-pop that was removed once already
1421
1485
  // (RCA addendum: the LOD toggle was reverted for visible flicker).
1422
- el.style.setProperty('--dc-zoom', String(z));
1486
+ const zs = String(z);
1487
+ el.style.setProperty('--dc-zoom', zs);
1488
+ for (const [node, world] of screenSizedNodes) {
1489
+ if (world === el) node.style.setProperty('--dc-zoom', zs);
1490
+ }
1423
1491
  el.style.visibility = 'visible';
1424
1492
  runtimeWorldStyle.set(el, worldStyleKey(el));
1425
1493
  }, []);
@@ -1734,18 +1802,44 @@ export function useViewportController(opts: ViewportControllerOptions): Viewport
1734
1802
  // pinch doesn't double-apply (WebKit may emit both event streams).
1735
1803
  const gesture = { active: false, lastScale: 1 };
1736
1804
 
1805
+ // 2.0.5 W2 — the host's box, cached. A wheel event right after a camera write used to read
1806
+ // `getBoundingClientRect()` + `clientWidth`/`clientHeight` here, forcing a synchronous style + layout
1807
+ // of the whole world inside the input handler, every event. Measured at mount and from a
1808
+ // ResizeObserver (delivered after layout, so its read is free); a window resize or scroll can move the
1809
+ // host without resizing it, so those only mark the box stale and the next wheel measures once.
1810
+ const hostBox = { left: 0, top: 0, width: 0, height: 0, fresh: false };
1811
+ const measureHost = () => {
1812
+ const r = host.getBoundingClientRect();
1813
+ hostBox.left = r.left;
1814
+ hostBox.top = r.top;
1815
+ hostBox.width = host.clientWidth;
1816
+ hostBox.height = host.clientHeight;
1817
+ // no observer = nothing tells us it changed: keep the old read-per-event behaviour
1818
+ hostBox.fresh = typeof ResizeObserver !== 'undefined';
1819
+ };
1820
+ const hostGeom = () => {
1821
+ if (!hostBox.fresh) measureHost();
1822
+ return hostBox;
1823
+ };
1824
+ const markHostStale = () => {
1825
+ hostBox.fresh = false;
1826
+ };
1827
+ measureHost();
1828
+ const hostRo = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(measureHost) : null;
1829
+ hostRo?.observe(host);
1830
+
1737
1831
  const onWheel = (e: WheelEvent) => {
1738
1832
  e.preventDefault();
1739
- const rect = host.getBoundingClientRect();
1740
- const cx = e.clientX - rect.left;
1741
- const cy = e.clientY - rect.top;
1833
+ const box = hostGeom();
1834
+ const cx = e.clientX - box.left;
1835
+ const cy = e.clientY - box.top;
1742
1836
  // Normalize line/page-mode deltas to pixels before anything below
1743
1837
  // reads them — see `wheelDeltaToPixels` (issue #94). Zoom's own
1744
1838
  // [-50, 50] clamp already absorbed this for the pinch/ctrl+wheel path,
1745
1839
  // but pan had no such clamp so a line-mode mouse wheel panned at only
1746
1840
  // a few px per notch.
1747
- const dx = wheelDeltaToPixels(e.deltaX, e.deltaMode, host.clientWidth);
1748
- const dy = wheelDeltaToPixels(e.deltaY, e.deltaMode, host.clientHeight);
1841
+ const dx = wheelDeltaToPixels(e.deltaX, e.deltaMode, box.width);
1842
+ const dy = wheelDeltaToPixels(e.deltaY, e.deltaMode, box.height);
1749
1843
  // Mac trackpad pinch fires wheel with ctrlKey:true automatically, even
1750
1844
  // without a physical Ctrl press — so the same branch covers both
1751
1845
  // Ctrl+wheel (mouse) and pinch-zoom (trackpad).
@@ -1794,9 +1888,9 @@ export function useViewportController(opts: ViewportControllerOptions): Viewport
1794
1888
  ev.preventDefault();
1795
1889
  if (!gesture.active) return;
1796
1890
  const e = ev as SafariGestureEvent;
1797
- const rect = host.getBoundingClientRect();
1798
- const cx = e.clientX - rect.left;
1799
- const cy = e.clientY - rect.top;
1891
+ const box = hostGeom();
1892
+ const cx = e.clientX - box.left;
1893
+ const cy = e.clientY - box.top;
1800
1894
  const s = e.scale || 1;
1801
1895
  const factor = gesture.lastScale > 0 ? s / gesture.lastScale : 1;
1802
1896
  gesture.lastScale = s;
@@ -1939,8 +2033,14 @@ export function useViewportController(opts: ViewportControllerOptions): Viewport
1939
2033
  host.addEventListener('gesturestart', onGestureStart, { passive: false });
1940
2034
  host.addEventListener('gesturechange', onGestureChange, { passive: false });
1941
2035
  host.addEventListener('gestureend', onGestureEnd, { passive: false });
2036
+ const win = doc.defaultView;
2037
+ win?.addEventListener('resize', markHostStale);
2038
+ win?.addEventListener('scroll', markHostStale, { capture: true, passive: true });
1942
2039
 
1943
2040
  return () => {
2041
+ hostRo?.disconnect();
2042
+ win?.removeEventListener('resize', markHostStale);
2043
+ win?.removeEventListener('scroll', markHostStale, { capture: true } as EventListenerOptions);
1944
2044
  doc.removeEventListener('wheel', captureWheel, { capture: true } as EventListenerOptions);
1945
2045
  doc.removeEventListener('keydown', captureKeyDown, { capture: true } as EventListenerOptions);
1946
2046
  doc.removeEventListener('keyup', captureKeyUp, { capture: true } as EventListenerOptions);
@@ -2200,6 +2300,8 @@ function useExportCaptureBridge() {
2200
2300
  ? m.artboardIds.filter((s): s is string => typeof s === 'string')
2201
2301
  : null;
2202
2302
  void (async () => {
2303
+ // 2.0.5 — a capture renders every artboard live: wake the sleeping ones for the whole batch.
2304
+ const releaseLive = await holdAllLive();
2203
2305
  const savedWorld = resetWorldPlane();
2204
2306
  // Hold the chrome suppression across the WHOLE batch. `svgForElement`
2205
2307
  // applies it per target too (ref-counted), but a 10-artboard deck would
@@ -2252,6 +2354,7 @@ function useExportCaptureBridge() {
2252
2354
  });
2253
2355
  } finally {
2254
2356
  releaseChrome();
2357
+ releaseLive();
2255
2358
  restoreWorldPlane(savedWorld);
2256
2359
  busy = false;
2257
2360
  }
@@ -2728,6 +2831,7 @@ function DesignCanvasInner({ children, controls }: DesignCanvasProps) {
2728
2831
  MORE than the mock — fit + actual-size — so no capability is lost. */}
2729
2832
  {showZoom ? <DCZoomToolbar /> : null}
2730
2833
  <ViewportZoomReporter />
2834
+ <ArtboardLiveFeed zoom={controller.viewport.zoom} interacting={!!controller.isInteracting} />
2731
2835
  {/* ── S8.19 (L1) placeholder frames ── "Waiting for Jonas's Mac" / Missing over a picture
2732
2836
  that failed to load; driven only by the shell's dgn `asset-state` (asset-placeholder.tsx). */}
2733
2837
  <AssetPlaceholderLayer />
@@ -3110,7 +3214,14 @@ function DCArtboardBody({
3110
3214
  >
3111
3215
  <header className="dc-artboard-label sku">{label}</header>
3112
3216
  <div className="dc-artboard-body" ref={bodyRef} style={bodyStyle}>
3113
- {children}
3217
+ <ArtboardLiveGate
3218
+ id={id}
3219
+ articleRef={articleRef}
3220
+ bodyRef={bodyRef}
3221
+ heightFloor={heightFloor}
3222
+ >
3223
+ {children}
3224
+ </ArtboardLiveGate>
3114
3225
  </div>
3115
3226
  </article>
3116
3227
  );
@@ -3284,7 +3395,15 @@ function DCArtboardBody({
3284
3395
  containIntrinsicSize: `${rect.w}px ${rect.h}px`,
3285
3396
  }}
3286
3397
  >
3287
- {children}
3398
+ {/* 2.0.5 — offscreen / zoomed-out artboards sleep (artboard-live.ts); captures run everything live */}
3399
+ <ArtboardLiveGate
3400
+ id={id}
3401
+ articleRef={articleRef}
3402
+ bodyRef={bodyRef}
3403
+ heightFloor={heightFloor}
3404
+ >
3405
+ {children}
3406
+ </ArtboardLiveGate>
3288
3407
  </div>
3289
3408
  </article>
3290
3409
  {showActivity ? (
@@ -255,6 +255,16 @@ export function canvasImportsOf(cfg, p) {
255
255
  return Array.isArray(list) ? list.filter((x) => typeof x === 'string' && x) : null;
256
256
  }
257
257
 
258
+ /**
259
+ * 2.0.5 (#205) — the design-root files `p`'s BUILT module was refused for (it inlined a file another canvas
260
+ * owns), from the index's `canvasRefusedInputs`, or `null` when none is on record.
261
+ */
262
+ export function canvasRefusedOf(cfg, p) {
263
+ const list = cfg?.canvasRefusedInputs?.[p];
264
+ const names = Array.isArray(list) ? list.filter((x) => typeof x === 'string' && x) : [];
265
+ return names.length ? names : null;
266
+ }
267
+
258
268
  export function canvasUrl(p, cfg, opts) {
259
269
  if (!p.endsWith('.tsx')) return urlOf(p);
260
270
  const designRel = (cfg?.designRel || '.design').replace(/^\/+|\/+$/g, '');
@@ -286,6 +296,9 @@ export function canvasUrl(p, cfg, opts) {
286
296
  // Phase 27 (E2) — DiffView renders a CLEAN canvas (no editor chrome: toolbar,
287
297
  // world minimap, devtools) so the before/after is just the design.
288
298
  if (opts?.hideChrome) params.set('hide-chrome', '1');
299
+ // 2.0.5 — the too-heavy card's "Show visible artboards only": the canvas mounts only the artboards near the
300
+ // viewport (artboard-live.ts `light`). A capture (`hide-chrome`) ignores it and renders everything.
301
+ if (opts?.light) params.set('artboard-live', 'light');
289
302
  // Cloud Phase 25 C2 — the linked hub vouched a viewer role at sign-in
290
303
  // (`/_config.readOnly`), so the canvas boots read-only: edit tools and
291
304
  // mutating interactions are ABSENT from the iframe chrome (read-only-mode.ts
@@ -0,0 +1,262 @@
1
+ // client/home/HomeAccounts.jsx — 2.0.5 W4b: Home's avatar and the card it opens.
2
+ //
3
+ // Every profile on this Mac by its label, with the accounts it is signed in with (Maude Cloud,
4
+ // team servers, GitHub): Sign out per account where Home has a path (asks first), Sign in with
5
+ // GitHub for a profile without it, and add / switch at the foot. What each row means and why a
6
+ // row has no button: home-accounts-model.js. The card fetches the team-server sign-ins when it
7
+ // opens (`GET /_home/accounts`) and after every sign-out.
8
+
9
+ import { useCallback, useEffect, useRef, useState } from 'react';
10
+
11
+ import { cloudSignOut, getAccounts, hubSignOut, shellInvoke, shellListen } from './home-api.js';
12
+ import { homeAccounts } from './home-accounts-model.js';
13
+ import { githubSignIn } from '../v2/onboarding/github-home.js';
14
+
15
+ const KIND_TITLE = { cloud: 'Maude Cloud', team: 'Team server', github: 'GitHub' };
16
+
17
+ /** The team-server sign-ins of `ids`, re-read when `open` turns on or `gen` moves. */
18
+ function useHubProfiles(ids, open, gen) {
19
+ const [hubProfiles, setHubProfiles] = useState([]);
20
+ const key = ids.join(',');
21
+ // biome-ignore lint/correctness/useExhaustiveDependencies: `key` stands for `ids`; `gen` re-reads
22
+ useEffect(() => {
23
+ if (!open || !key) return undefined;
24
+ let live = true;
25
+ getAccounts(key.split(',')).then((r) => {
26
+ if (live && r.ok && Array.isArray(r.json?.profiles)) setHubProfiles(r.json.profiles);
27
+ });
28
+ return () => {
29
+ live = false;
30
+ };
31
+ }, [open, key, gen]);
32
+ return hubProfiles;
33
+ }
34
+
35
+ /**
36
+ * @param shell / clouds / native — Home's data
37
+ * @param onAddCloud () => void Home's Maude Cloud sign-in (a fresh profile when one is signed in)
38
+ * @param onAddTeam () => void the Advanced › team server sheet
39
+ * @param onChanged () => Promise reload Home's data after a sign-out / sign-in
40
+ */
41
+ export function HomeAccounts({ shell, clouds, native, onAddCloud, onAddTeam, onChanged }) {
42
+ const [open, setOpen] = useState(false);
43
+ const [gen, setGen] = useState(0);
44
+ const [asking, setAsking] = useState(null);
45
+ const [busy, setBusy] = useState(false);
46
+ const [error, setError] = useState(null);
47
+ const [ghCode, setGhCode] = useState(null);
48
+ const wrap = useRef(null);
49
+ const ids = (shell?.profiles ?? []).map((p) => p?.id).filter((id) => typeof id === 'string');
50
+ const hubProfiles = useHubProfiles(ids, open, gen);
51
+ const model = homeAccounts({ native, shell, clouds, hubProfiles });
52
+
53
+ const close = useCallback(() => {
54
+ setOpen(false);
55
+ setAsking(null);
56
+ setError(null);
57
+ }, []);
58
+ useEffect(() => {
59
+ if (!open) return undefined;
60
+ const onKey = (e) => e.key === 'Escape' && close();
61
+ const onDown = (e) => wrap.current && !wrap.current.contains(e.target) && close();
62
+ window.addEventListener('keydown', onKey);
63
+ window.addEventListener('pointerdown', onDown);
64
+ return () => {
65
+ window.removeEventListener('keydown', onKey);
66
+ window.removeEventListener('pointerdown', onDown);
67
+ };
68
+ }, [open, close]);
69
+ // the GitHub device code arrives as a shell message while a sign-in from this card runs
70
+ useEffect(() => {
71
+ if (!open || !native) return undefined;
72
+ let off = () => {};
73
+ shellListen('github://device-code', (p) => setGhCode(p?.user_code ?? null)).then((u) => {
74
+ off = u;
75
+ });
76
+ return () => off();
77
+ }, [open, native]);
78
+
79
+ if (!model.face) return null;
80
+
81
+ const signOut = async () => {
82
+ const spec = asking;
83
+ setBusy(true);
84
+ setError(null);
85
+ const r =
86
+ spec.path === 'cloud-signout'
87
+ ? await cloudSignOut(spec.profile)
88
+ : await hubSignOut(spec.profile, spec.url);
89
+ setBusy(false);
90
+ setAsking(null);
91
+ if (!r.ok || !r.json?.ok) {
92
+ setError(r.json?.error || 'Couldn’t sign out. Nothing changed — try again.');
93
+ return;
94
+ }
95
+ setGen((g) => g + 1);
96
+ await onChanged?.();
97
+ };
98
+ const ghSignIn = async (profile) => {
99
+ setError(null);
100
+ setBusy(true);
101
+ try {
102
+ await githubSignIn(profile, shellInvoke);
103
+ await onChanged?.();
104
+ } catch (e) {
105
+ setError(typeof e === 'string' ? e : 'GitHub sign-in didn’t finish. Try again.');
106
+ } finally {
107
+ setGhCode(null);
108
+ setBusy(false);
109
+ }
110
+ };
111
+
112
+ return (
113
+ <span className="home-top-acct" ref={wrap}>
114
+ <button
115
+ type="button"
116
+ className="home-top-acct-btn"
117
+ data-testid="home-top-face"
118
+ aria-label={model.face.title}
119
+ title={model.face.title}
120
+ aria-haspopup="dialog"
121
+ aria-expanded={open}
122
+ onClick={() => (open ? close() : setOpen(true))}
123
+ >
124
+ <span
125
+ className={`home-face home-face--md home-face--${model.face.tone}`}
126
+ aria-hidden="true"
127
+ >
128
+ {model.face.initial}
129
+ </span>
130
+ </button>
131
+ {open ? (
132
+ <div
133
+ className="home-accts"
134
+ role="dialog"
135
+ aria-label="Accounts on this Mac"
136
+ data-testid="home-accounts"
137
+ >
138
+ <p className="home-accts-h">Accounts on this Mac</p>
139
+ {model.profiles.map((p) => (
140
+ <section
141
+ key={p.id}
142
+ className="home-accts-p"
143
+ data-testid={`home-accounts-profile-${p.id}`}
144
+ >
145
+ <h3 className="home-accts-ph">
146
+ <span className={`home-acctf home-acctf--${p.face.tone}`} aria-hidden="true">
147
+ {p.face.initial}
148
+ </span>
149
+ {p.label}
150
+ </h3>
151
+ {p.accounts.length ? (
152
+ <ul className="home-accts-list">
153
+ {p.accounts.map((a) => (
154
+ <li
155
+ key={a.key}
156
+ className="home-accts-row"
157
+ data-testid={`home-account-${p.id}-${a.kind}`}
158
+ >
159
+ <span className="home-accts-t">
160
+ <strong>
161
+ {a.kind === 'team'
162
+ ? `${KIND_TITLE.team} · ${a.host}`
163
+ : KIND_TITLE[a.kind]}
164
+ </strong>
165
+ {a.who ? <span>{a.who}</span> : null}
166
+ </span>
167
+ {a.signOut ? (
168
+ <button
169
+ type="button"
170
+ className="btn btn--ghost btn--sm"
171
+ data-testid={`home-account-signout-${p.id}-${a.kind}`}
172
+ onClick={() => setAsking(a.signOut)}
173
+ disabled={busy}
174
+ >
175
+ Sign out…
176
+ </button>
177
+ ) : null}
178
+ </li>
179
+ ))}
180
+ </ul>
181
+ ) : (
182
+ <p className="home-accts-none">Not signed in to anything yet.</p>
183
+ )}
184
+ {p.githubSignIn ? (
185
+ <button
186
+ type="button"
187
+ className="home-accts-act"
188
+ data-testid={`home-account-github-signin-${p.id}`}
189
+ onClick={() => ghSignIn(p.id)}
190
+ disabled={busy}
191
+ >
192
+ Sign in with GitHub…
193
+ </button>
194
+ ) : null}
195
+ </section>
196
+ ))}
197
+ {ghCode ? (
198
+ <p className="home-accts-note" data-testid="home-accounts-github-code">
199
+ Enter <strong>{ghCode}</strong> on the GitHub page that opened.
200
+ </p>
201
+ ) : null}
202
+ {error ? (
203
+ <p className="home-accts-note" role="alert" data-testid="home-accounts-error">
204
+ {error}
205
+ </p>
206
+ ) : null}
207
+ {asking ? (
208
+ <div className="home-accts-ask" role="alertdialog" data-testid="home-accounts-confirm">
209
+ <strong>{asking.confirm.title}</strong>
210
+ <span>{asking.confirm.body}</span>
211
+ <span className="home-accts-btns">
212
+ <button
213
+ type="button"
214
+ className="btn btn--sm"
215
+ data-testid="home-accounts-signout-cancel"
216
+ onClick={() => setAsking(null)}
217
+ >
218
+ {asking.confirm.cancel}
219
+ </button>
220
+ <button
221
+ type="button"
222
+ className="btn btn--sm btn--danger"
223
+ data-testid="home-accounts-signout-confirm"
224
+ disabled={busy}
225
+ onClick={signOut}
226
+ >
227
+ {asking.confirm.primary}
228
+ </button>
229
+ </span>
230
+ </div>
231
+ ) : null}
232
+ {model.add ? (
233
+ <div className="home-accts-foot">
234
+ <button
235
+ type="button"
236
+ className="home-accts-act"
237
+ data-testid="home-accounts-add-cloud"
238
+ onClick={() => {
239
+ close();
240
+ onAddCloud?.();
241
+ }}
242
+ >
243
+ {model.add.cloud}
244
+ </button>
245
+ <button
246
+ type="button"
247
+ className="home-accts-act"
248
+ data-testid="home-accounts-add-team"
249
+ onClick={() => {
250
+ close();
251
+ onAddTeam?.();
252
+ }}
253
+ >
254
+ {model.add.team}
255
+ </button>
256
+ </div>
257
+ ) : null}
258
+ </div>
259
+ ) : null}
260
+ </span>
261
+ );
262
+ }
@@ -10,7 +10,8 @@ import { accountFace, rowSlug, sharedAside } from './home-model.js';
10
10
  import { HIcon, ProjectSquare } from './home-icons.jsx';
11
11
  import { reasonProps } from '../v2/access/disabled-reason.js';
12
12
 
13
- /** Three ghost cards: the shelf's shape before there is anything on it. */
13
+ /** Three ghost cards: the shelf's shape before there is anything on it. Flat and dashed on purpose —
14
+ * they must never read as thumbnails that failed to load (no tilt, no fill). */
14
15
  export function GhostCards({ n = 3 }) {
15
16
  return (
16
17
  <span className="home-ghosts" aria-hidden="true">
@@ -202,10 +203,10 @@ export function SharedWithYou({
202
203
  ))}
203
204
  </div>
204
205
  ) : (
205
- <div className="home-shelf-row" data-testid="home-shared-empty">
206
- <GhostCards n={3} />
206
+ <div className="home-shelf-row home-shelf-row--lone" data-testid="home-shared-empty">
207
207
  <Empty
208
208
  align="left"
209
+ glyph="people"
209
210
  copyId="es-home-shared.shared-none"
210
211
  next="When someone shares a project with you, it shows up here."
211
212
  />