@1agh/maude 2.0.3 → 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 (242) hide show
  1. package/README.md +6 -5
  2. package/apps/hub/src/project-transactions/kernel.mjs +10 -1
  3. package/apps/studio/access/filters.ts +12 -5
  4. package/apps/studio/access/known-canvases.ts +24 -1
  5. package/apps/studio/access/refused-inputs.ts +89 -0
  6. package/apps/studio/access/request.ts +0 -1
  7. package/apps/studio/acp/adapter-stderr.ts +43 -13
  8. package/apps/studio/acp/background-tasks.ts +155 -0
  9. package/apps/studio/acp/bridge.ts +44 -5
  10. package/apps/studio/acp/connected-fact.ts +15 -4
  11. package/apps/studio/acp/index.ts +14 -5
  12. package/apps/studio/actions/agents.ts +10 -0
  13. package/apps/studio/actions/defs/app.ts +12 -0
  14. package/apps/studio/actions/defs/view.ts +12 -0
  15. package/apps/studio/actions.manifest.json +25 -1
  16. package/apps/studio/actions.parity.json +13 -1
  17. package/apps/studio/annotations/ui/element-node.tsx +139 -54
  18. package/apps/studio/annotations/ui/lod.tsx +1 -1
  19. package/apps/studio/annotations/ui/text-style.ts +1 -1
  20. package/apps/studio/annotations-layer.tsx +0 -12
  21. package/apps/studio/api.ts +73 -24
  22. package/apps/studio/artboard-live-gate.tsx +267 -0
  23. package/apps/studio/artboard-live.ts +336 -0
  24. package/apps/studio/artboard-webgl.ts +668 -0
  25. package/apps/studio/bin/_agent-browser-bin.mjs +8 -0
  26. package/apps/studio/bin/_agent-browser-safe.mjs +2 -1
  27. package/apps/studio/bin/_canvas-reasons.mjs +34 -0
  28. package/apps/studio/bin/_ds-check-live.mjs +37 -0
  29. package/apps/studio/bin/_ds-check.mjs +4 -1
  30. package/apps/studio/bin/_ds-prove-judge.mjs +167 -0
  31. package/apps/studio/bin/_ds-prove-playwright.mjs +183 -105
  32. package/apps/studio/bin/_import-asset.mjs +2 -1
  33. package/apps/studio/bin/_perf-probe.mjs +2 -1
  34. package/apps/studio/bin/_png-playwright.mjs +10 -1
  35. package/apps/studio/bin/_pw-launch.mjs +14 -0
  36. package/apps/studio/bin/_studio-verb.mjs +24 -3
  37. package/apps/studio/bin/_thumb-blank.mjs +70 -0
  38. package/apps/studio/bin/_thumb-cover.mjs +35 -0
  39. package/apps/studio/bin/_thumbs-playwright.mjs +93 -13
  40. package/apps/studio/bin/ds-check.sh +5 -1
  41. package/apps/studio/bin/perf.sh +11 -1
  42. package/apps/studio/bin/server-up.sh +7 -2
  43. package/apps/studio/bin/smoke.sh +19 -0
  44. package/apps/studio/boot-progress.ts +31 -0
  45. package/apps/studio/canvas-build-sandbox.ts +275 -42
  46. package/apps/studio/canvas-build-worker.ts +10 -0
  47. package/apps/studio/canvas-create.ts +24 -0
  48. package/apps/studio/canvas-lib.tsx +131 -12
  49. package/apps/studio/canvas-module-cache.ts +93 -0
  50. package/apps/studio/canvas-source/errors.ts +39 -0
  51. package/apps/studio/canvas-source/waiting.ts +290 -0
  52. package/apps/studio/client/actions/shell-key-handlers.js +5 -0
  53. package/apps/studio/client/app.jsx +19 -9
  54. package/apps/studio/client/canvas-url.js +13 -0
  55. package/apps/studio/client/github.js +23 -3
  56. package/apps/studio/client/home/HomeAccounts.jsx +262 -0
  57. package/apps/studio/client/home/Shelves.jsx +4 -3
  58. package/apps/studio/client/home/home-accounts-model.js +121 -0
  59. package/apps/studio/client/home/home-api.js +36 -19
  60. package/apps/studio/client/home/home-app.jsx +141 -40
  61. package/apps/studio/client/home/home-model.js +172 -6
  62. package/apps/studio/client/home/home.css +169 -5
  63. package/apps/studio/client/home/shell-mode.js +8 -1
  64. package/apps/studio/client/hooks/use-git-actions.jsx +2 -1
  65. package/apps/studio/client/hooks/use-project-data.jsx +2 -0
  66. package/apps/studio/client/hooks/use-shell-core.jsx +3 -0
  67. package/apps/studio/client/hooks/use-tabs.jsx +64 -35
  68. package/apps/studio/client/index-loader.ts +23 -3
  69. package/apps/studio/client/panels/ChatPanel.jsx +49 -57
  70. package/apps/studio/client/panels/CreateProject.jsx +19 -5
  71. package/apps/studio/client/panels/DiffView.jsx +314 -248
  72. package/apps/studio/client/panels/TeamProjects.jsx +119 -69
  73. package/apps/studio/client/panels/acp-runtime.js +25 -0
  74. package/apps/studio/client/panels/caps-cache.js +46 -0
  75. package/apps/studio/client/panels/chat-finish.js +66 -0
  76. package/apps/studio/client/shell/frame-cap.js +53 -0
  77. package/apps/studio/client/shell/viewport.jsx +45 -8
  78. package/apps/studio/client/styles/_index.css +2 -0
  79. package/apps/studio/client/tree/tree.jsx +48 -21
  80. package/apps/studio/client/v2/access/access-client.js +2 -0
  81. package/apps/studio/client/v2/access/access-host.jsx +12 -1
  82. package/apps/studio/client/v2/access/trashed-banner.jsx +6 -3
  83. package/apps/studio/client/v2/ai/Advanced.jsx +12 -0
  84. package/apps/studio/client/v2/ai/BackgroundStrip.jsx +120 -0
  85. package/apps/studio/client/v2/ai/Composer.jsx +27 -10
  86. package/apps/studio/client/v2/ai/StoppedDivider.jsx +2 -1
  87. package/apps/studio/client/v2/ai/ai-run.css +87 -3
  88. package/apps/studio/client/v2/ai/background-model.js +113 -0
  89. package/apps/studio/client/v2/ai/needs-you-store.js +2 -1
  90. package/apps/studio/client/v2/ai/run-api.js +7 -3
  91. package/apps/studio/client/v2/ai/runs-store.js +2 -1
  92. package/apps/studio/client/v2/annotations/vote-store.js +11 -5
  93. package/apps/studio/client/v2/assets/asset-state-lane.js +6 -3
  94. package/apps/studio/client/v2/assets/assets-bus.js +10 -8
  95. package/apps/studio/client/v2/assets/browse-view.jsx +2 -0
  96. package/apps/studio/client/v2/assets/ds-library-view.jsx +47 -0
  97. package/apps/studio/client/v2/assets/spotlight-model.js +75 -0
  98. package/apps/studio/client/v2/assets/spotlight.css +153 -0
  99. package/apps/studio/client/v2/assets/spotlight.jsx +199 -0
  100. package/apps/studio/client/v2/assets/tile-menu.jsx +3 -1
  101. package/apps/studio/client/v2/assets/tile.jsx +3 -0
  102. package/apps/studio/client/v2/assets/use-assets.js +2 -1
  103. package/apps/studio/client/v2/canvases/canvases-panel.jsx +13 -2
  104. package/apps/studio/client/v2/canvases/covers.js +11 -5
  105. package/apps/studio/client/v2/canvases/folder-ask.js +139 -0
  106. package/apps/studio/client/v2/canvases/folder-dialogs.jsx +150 -0
  107. package/apps/studio/client/v2/canvases/trash-canvas.js +10 -2
  108. package/apps/studio/client/v2/canvases/trash-queue.js +152 -0
  109. package/apps/studio/client/v2/canvases/use-canvas-index.js +42 -18
  110. package/apps/studio/client/v2/canvases/use-pins.js +2 -1
  111. package/apps/studio/client/v2/code/canvas-error-card.jsx +70 -5
  112. package/apps/studio/client/v2/code/canvas-imports-card.jsx +15 -14
  113. package/apps/studio/client/v2/code/canvas-imports-words.js +44 -0
  114. package/apps/studio/client/v2/code/canvas-waiting-card.jsx +128 -0
  115. package/apps/studio/client/v2/code/canvas-waiting.js +164 -0
  116. package/apps/studio/client/v2/code/code-bus.js +5 -0
  117. package/apps/studio/client/v2/code/code.css +67 -0
  118. package/apps/studio/client/v2/code/use-canvas-source.js +19 -4
  119. package/apps/studio/client/v2/create/NameDialog.jsx +4 -2
  120. package/apps/studio/client/v2/create/name-dialog.css +10 -0
  121. package/apps/studio/client/v2/ds/advanced-host.jsx +11 -23
  122. package/apps/studio/client/v2/ds/ds-refresh.js +161 -0
  123. package/apps/studio/client/v2/ds/library-host.jsx +45 -45
  124. package/apps/studio/client/v2/ds/make-host.jsx +13 -12
  125. package/apps/studio/client/v2/ds/off-system-host.jsx +18 -16
  126. package/apps/studio/client/v2/ds/review-host.jsx +7 -1
  127. package/apps/studio/client/v2/ds/truth-host.jsx +15 -14
  128. package/apps/studio/client/v2/ds/upgrade-host.jsx +26 -10
  129. package/apps/studio/client/v2/empty/arriving.jsx +29 -12
  130. package/apps/studio/client/v2/empty/empty-host.jsx +8 -2
  131. package/apps/studio/client/v2/empty/not-local.jsx +31 -1
  132. package/apps/studio/client/v2/empty/use-empty-canvas.js +10 -1
  133. package/apps/studio/client/v2/export/last-finished.js +2 -1
  134. package/apps/studio/client/v2/history/branch-actions.js +13 -9
  135. package/apps/studio/client/v2/history/git-advanced.jsx +8 -1
  136. package/apps/studio/client/v2/history/git-model.js +21 -5
  137. package/apps/studio/client/v2/history/git-parts.jsx +76 -43
  138. package/apps/studio/client/v2/history/history.css +6 -0
  139. package/apps/studio/client/v2/left-panel/assets-panel.jsx +87 -10
  140. package/apps/studio/client/v2/left-panel/use-trash.js +2 -1
  141. package/apps/studio/client/v2/onboarding/AdvancedSheets.jsx +100 -33
  142. package/apps/studio/client/v2/onboarding/HubSheet.jsx +51 -83
  143. package/apps/studio/client/v2/onboarding/onboarding-model.js +10 -6
  144. package/apps/studio/client/v2/presence/faces.jsx +42 -14
  145. package/apps/studio/client/v2/present/order-notes-artboards.js +2 -1
  146. package/apps/studio/client/v2/search/search-recent.js +3 -1
  147. package/apps/studio/client/v2/search/search-remote.js +6 -4
  148. package/apps/studio/client/v2/settings/connections-model.js +1 -1
  149. package/apps/studio/client/v2/shell/account-card.jsx +10 -4
  150. package/apps/studio/client/v2/shell/canvas-crash-guard.js +137 -0
  151. package/apps/studio/client/v2/shell/github-signin-host.jsx +42 -0
  152. package/apps/studio/client/v2/shell/menu-runner.js +12 -0
  153. package/apps/studio/client/v2/shell/occlusion-insets.js +14 -2
  154. package/apps/studio/client/v2/shell/project-account-card.jsx +203 -0
  155. package/apps/studio/client/v2/shell/project-account-model.js +182 -0
  156. package/apps/studio/client/v2/shell/recovery-store.js +2 -1
  157. package/apps/studio/client/v2/shell/served-routes.js +120 -0
  158. package/apps/studio/client/v2/shell/share-cluster-host.jsx +139 -11
  159. package/apps/studio/client/v2/shell/share-cluster.css +58 -0
  160. package/apps/studio/client/v2/shell/share-cluster.jsx +26 -7
  161. package/apps/studio/client/v2/shell/shell-activity.js +19 -0
  162. package/apps/studio/client/v2/shell/team-switch.js +94 -0
  163. package/apps/studio/client/v2/shell/too-heavy-card.jsx +38 -0
  164. package/apps/studio/client/v2/shell/use-account.js +8 -1
  165. package/apps/studio/client/v2/shell/use-occluded-insets.js +3 -0
  166. package/apps/studio/client/v2/sync-states/conflict-card.jsx +7 -2
  167. package/apps/studio/client/v2/undo/use-undo-projection.jsx +3 -1
  168. package/apps/studio/cloud/endpoints.ts +23 -1
  169. package/apps/studio/collab/persistence.ts +9 -1
  170. package/apps/studio/collab/registry.ts +32 -0
  171. package/apps/studio/collab/room.ts +8 -0
  172. package/apps/studio/config-reload-wire.ts +53 -0
  173. package/apps/studio/dist/client.bundle.js +1098 -1102
  174. package/apps/studio/dist/styles.css +1 -1
  175. package/apps/studio/ds/board/specimen.tsx +12 -1
  176. package/apps/studio/ds/canvas-cli.ts +58 -2
  177. package/apps/studio/ds/check.ts +26 -1
  178. package/apps/studio/ds/cli.ts +7 -3
  179. package/apps/studio/ds/convert.ts +34 -6
  180. package/apps/studio/ds/ds-verb.ts +13 -0
  181. package/apps/studio/ds/post-build.ts +38 -0
  182. package/apps/studio/ds/upgrade-apply.ts +27 -5
  183. package/apps/studio/ds/upgrade-cli.ts +22 -2
  184. package/apps/studio/ds/upgrade-prove.ts +198 -15
  185. package/apps/studio/ds/upgrade-stage.ts +4 -1
  186. package/apps/studio/editing/minimap-context.tsx +3 -3
  187. package/apps/studio/editing/page-activity.ts +251 -0
  188. package/apps/studio/editing/rotate-handle.tsx +9 -5
  189. package/apps/studio/editing/sticky-name.tsx +4 -4
  190. package/apps/studio/history/restore-artboard-action.ts +40 -0
  191. package/apps/studio/history/trash.ts +6 -0
  192. package/apps/studio/home/accounts.ts +87 -0
  193. package/apps/studio/home/hub.ts +77 -175
  194. package/apps/studio/home/index-reader.ts +24 -2
  195. package/apps/studio/home/routes.ts +66 -8
  196. package/apps/studio/http.ts +131 -68
  197. package/apps/studio/index-flight.ts +40 -0
  198. package/apps/studio/managed-projects.ts +52 -24
  199. package/apps/studio/migrate/hub.ts +7 -1
  200. package/apps/studio/routes/canvas-source.ts +44 -2
  201. package/apps/studio/routes/ds-convert.ts +18 -0
  202. package/apps/studio/routes/history.ts +28 -5
  203. package/apps/studio/routes/hub-signin.ts +115 -0
  204. package/apps/studio/routes/index.ts +4 -0
  205. package/apps/studio/routes/table.ts +7 -0
  206. package/apps/studio/routes/trash.ts +19 -1
  207. package/apps/studio/server.ts +19 -10
  208. package/apps/studio/sync/accepted-cold-start.ts +54 -16
  209. package/apps/studio/sync/accepted-link.ts +9 -4
  210. package/apps/studio/sync/asset-push.ts +146 -23
  211. package/apps/studio/sync/asset-state.ts +3 -2
  212. package/apps/studio/sync/code-module-consent.ts +74 -0
  213. package/apps/studio/sync/file-ledger.ts +35 -0
  214. package/apps/studio/sync/file-membership.ts +28 -3
  215. package/apps/studio/sync/file-plane.ts +483 -86
  216. package/apps/studio/sync/file-pull.ts +304 -33
  217. package/apps/studio/sync/hub-browser-signin.ts +377 -0
  218. package/apps/studio/sync/hub-link.ts +1 -2
  219. package/apps/studio/sync/hub-text-undo.ts +30 -10
  220. package/apps/studio/sync/index.ts +381 -161
  221. package/apps/studio/sync/journal-client.ts +94 -5
  222. package/apps/studio/sync/pending-deletes.ts +100 -0
  223. package/apps/studio/sync/projection.ts +121 -14
  224. package/apps/studio/sync/pull-pacer.ts +160 -0
  225. package/apps/studio/sync/pull-priority.ts +119 -0
  226. package/apps/studio/sync/seed-progress.ts +58 -3
  227. package/apps/studio/sync/status.ts +3 -1
  228. package/apps/studio/sync/transaction-client.ts +71 -6
  229. package/apps/studio/sync/workspace-signin.ts +6 -256
  230. package/apps/studio/sync/writer-registry.ts +5 -1
  231. package/apps/studio/thumbs/service.ts +12 -2
  232. package/apps/studio/thumbs/validate.ts +7 -0
  233. package/apps/studio/ui-prefs-migrate.ts +4 -0
  234. package/apps/studio/video-comp.tsx +23 -0
  235. package/apps/studio/video-links-overlay.tsx +3 -2
  236. package/apps/studio/whats-new.json +126 -0
  237. package/cli/lib/bash-guard.mjs +13 -1
  238. package/cli/lib/design-help.gen.mjs +1 -1
  239. package/cli/lib/design-hook.mjs +20 -0
  240. package/cli/lib/studio-locate.mjs +35 -10
  241. package/cli/lib/workspace-plan.mjs +14 -0
  242. package/package.json +8 -8
@@ -265,6 +265,130 @@
265
265
  .home-top-acct .home-face {
266
266
  box-shadow: 0 0 0 2px var(--bg-1);
267
267
  }
268
+ /* 2.0.5 W4b — the face is a button that opens every account on this Mac */
269
+ .home-top-acct {
270
+ position: relative;
271
+ }
272
+ .home-top-acct-btn {
273
+ display: inline-flex;
274
+ padding: 0;
275
+ border: 0;
276
+ background: none;
277
+ border-radius: var(--radius-pill);
278
+ cursor: pointer;
279
+ }
280
+ .home-top-acct-btn:focus-visible {
281
+ outline: 2px solid var(--accent);
282
+ outline-offset: 2px;
283
+ }
284
+ .home-accts {
285
+ position: absolute;
286
+ top: calc(100% + var(--space-2));
287
+ right: 0;
288
+ z-index: 50;
289
+ width: 320px;
290
+ max-height: 70vh;
291
+ overflow: auto;
292
+ display: flex;
293
+ flex-direction: column;
294
+ gap: var(--space-2);
295
+ padding: var(--space-3);
296
+ background: var(--bg-1);
297
+ border: 1px solid var(--line-1, var(--bg-3));
298
+ border-radius: var(--radius-lg, 12px);
299
+ box-shadow: var(--shadow-3, 0 8px 24px rgb(0 0 0 / 0.18));
300
+ text-align: left;
301
+ }
302
+ .home-accts-h {
303
+ margin: 0;
304
+ font-size: var(--type-xs);
305
+ font-weight: var(--w-semibold);
306
+ color: var(--fg-2);
307
+ }
308
+ .home-accts-p {
309
+ display: flex;
310
+ flex-direction: column;
311
+ gap: var(--space-1);
312
+ }
313
+ .home-accts-ph {
314
+ display: flex;
315
+ align-items: center;
316
+ gap: var(--space-2);
317
+ margin: 0;
318
+ font-size: var(--type-sm);
319
+ font-weight: var(--w-semibold);
320
+ color: var(--fg-0);
321
+ }
322
+ .home-accts-list {
323
+ display: flex;
324
+ flex-direction: column;
325
+ gap: 2px;
326
+ margin: 0;
327
+ padding: 0;
328
+ list-style: none;
329
+ }
330
+ .home-accts-row {
331
+ display: flex;
332
+ align-items: center;
333
+ gap: var(--space-2);
334
+ padding-left: calc(16px + var(--space-2));
335
+ }
336
+ .home-accts-t {
337
+ flex: 1;
338
+ min-width: 0;
339
+ display: flex;
340
+ flex-direction: column;
341
+ font-size: var(--type-xs);
342
+ color: var(--fg-2);
343
+ }
344
+ .home-accts-t strong {
345
+ font-weight: var(--w-medium, 500);
346
+ color: var(--fg-1);
347
+ overflow: hidden;
348
+ text-overflow: ellipsis;
349
+ white-space: nowrap;
350
+ }
351
+ .home-accts-none,
352
+ .home-accts-note {
353
+ margin: 0;
354
+ padding-left: calc(16px + var(--space-2));
355
+ font-size: var(--type-xs);
356
+ color: var(--fg-2);
357
+ }
358
+ .home-accts-act {
359
+ align-self: flex-start;
360
+ padding: 2px 0 2px calc(16px + var(--space-2));
361
+ border: 0;
362
+ background: none;
363
+ font: inherit;
364
+ font-size: var(--type-xs);
365
+ color: var(--accent);
366
+ cursor: pointer;
367
+ }
368
+ .home-accts-foot {
369
+ display: flex;
370
+ flex-direction: column;
371
+ gap: 2px;
372
+ padding-top: var(--space-2);
373
+ border-top: 1px solid var(--line-1, var(--bg-3));
374
+ }
375
+ .home-accts-foot .home-accts-act {
376
+ padding-left: 0;
377
+ }
378
+ .home-accts-ask {
379
+ display: flex;
380
+ flex-direction: column;
381
+ gap: var(--space-1);
382
+ padding: var(--space-2);
383
+ border-radius: var(--radius-md, 8px);
384
+ background: var(--bg-2);
385
+ font-size: var(--type-xs);
386
+ }
387
+ .home-accts-btns {
388
+ display: flex;
389
+ justify-content: flex-end;
390
+ gap: var(--space-1);
391
+ }
268
392
 
269
393
  /* the Search palette (k-pal.pn-pal): a centred 620 card over a veil, field at --type-md with an esc key */
270
394
  .home-pal-veil {
@@ -861,6 +985,25 @@
861
985
  align-items: center;
862
986
  gap: var(--space-1);
863
987
  }
988
+ /* 2.0.5 W4b — how a project is connected, and the folders folded into its row */
989
+ .home-prow-conn {
990
+ display: inline-flex;
991
+ align-items: center;
992
+ gap: var(--space-1);
993
+ min-width: 0;
994
+ overflow: hidden;
995
+ text-overflow: ellipsis;
996
+ }
997
+ .home-prow-copies {
998
+ display: flex;
999
+ flex-wrap: wrap;
1000
+ gap: var(--space-1);
1001
+ /* under the name: past the 44px cover and the row's gap */
1002
+ padding: 0 var(--space-2) var(--space-1) calc(44px + var(--space-3) + var(--space-2));
1003
+ }
1004
+ .home-root .chip.home-prow-copy {
1005
+ font-size: var(--type-xs);
1006
+ }
864
1007
  /* live state on a project row (V2-3.3): AI working · Needs you · Resting (canvas 11 pn-bmore-st) */
865
1008
  .home-root .chip.home-prow-ai {
866
1009
  flex: none;
@@ -1569,15 +1712,36 @@
1569
1712
  .home-ghosts > i {
1570
1713
  display: block;
1571
1714
  height: 84px;
1715
+ min-width: 0;
1572
1716
  border-radius: var(--radius-md);
1573
- background: var(--bg-2);
1717
+ background: transparent;
1574
1718
  box-shadow: inset 0 0 0 1px var(--border-default);
1719
+ opacity: 0.6;
1720
+ }
1721
+ /* a shelf with nothing to draw: one quiet glyph beside the words, no ghost cards (the card stays as
1722
+ short as Recent canvases and Projects) */
1723
+ .home-shelf-row--lone {
1724
+ padding: var(--space-3) var(--space-4);
1725
+ overflow: hidden;
1726
+ }
1727
+ .home-shelf-row--lone .es-e {
1728
+ display: grid;
1729
+ grid-template-columns: auto minmax(0, 1fr);
1730
+ align-items: center;
1731
+ column-gap: var(--space-3);
1732
+ row-gap: 2px;
1575
1733
  }
1576
- .home-ghosts > i:nth-child(1) {
1577
- rotate: -2deg;
1734
+ .home-shelf-row--lone .es-e > .es-glyph {
1735
+ grid-row: 1 / span 2;
1578
1736
  }
1579
- .home-ghosts > i:nth-child(3) {
1580
- rotate: 2deg;
1737
+ .home-shelf-row--lone .es-e > :not(.es-glyph) {
1738
+ grid-column: 2;
1739
+ min-width: 0;
1740
+ }
1741
+ @media (max-width: 720px) {
1742
+ .home-two {
1743
+ grid-template-columns: minmax(0, 1fr);
1744
+ }
1581
1745
  }
1582
1746
  .island.home-shared {
1583
1747
  display: flex;
@@ -30,6 +30,10 @@ export function shellModeHint(win = typeof window !== 'undefined' ? window : und
30
30
  return null;
31
31
  }
32
32
 
33
+ /** The Home server's `/_config` answer the boot already read (null until then, or for a project). */
34
+ let bootConfig = null;
35
+ export const homeBootConfig = () => bootConfig;
36
+
33
37
  /**
34
38
  * Calls `render(mode, config)` once. Synchronously for a project the hint already names, so the
35
39
  * project shell's first paint is unchanged; after one `/_config` request otherwise.
@@ -41,7 +45,10 @@ export function bootShellMode(render, win) {
41
45
  return;
42
46
  }
43
47
  getConfig().then((r) => {
44
- if (r.ok && r.json?.mode === 'home') render('home', r.json);
48
+ if (r.ok && r.json?.mode === 'home') {
49
+ bootConfig = r.json;
50
+ render('home', r.json);
51
+ }
45
52
  // the Home window keeps Home even when its server is not answering yet: the page says so
46
53
  else if (hint === 'home') render('home', null);
47
54
  else render('project', null);
@@ -219,7 +219,8 @@ export function useGitActions({
219
219
  setProjectHistoryRefresh((version) => version + 1);
220
220
  return result;
221
221
  }
222
- return { ok: false, error: result?.error };
222
+ // F14 — a refused restore's own line ("…a change on this Mac that isn't saved…") is the words
223
+ return { ok: false, error: result?.line || result?.error };
223
224
  }, []);
224
225
 
225
226
  // Repo-relative path → M/A/D/U badge for the tree (paths match: both the tree
@@ -63,6 +63,8 @@ export function useProjectData({
63
63
  dsRevGaps: data.dsRevGaps ?? {},
64
64
  // gate-b-c4j — canvases that import another canvas do not render; the stage says why (viewport.jsx).
65
65
  canvasImportsCanvases: data.canvasImportsCanvases ?? {},
66
+ // 2.0.5 (#205) — canvases whose built module was refused for a file another canvas owns.
67
+ canvasRefusedInputs: data.canvasRefusedInputs ?? {},
66
68
  }));
67
69
  },
68
70
  onError: (error) => {
@@ -59,6 +59,7 @@ import {
59
59
  import { useThemeAuto } from '../v2/settings/theme-auto.js';
60
60
  import { canvasTargetOrigin } from '../v2/kinds/kind-dim-relay.js';
61
61
  import { viewerModeOn } from '../v2/access/access-client.js';
62
+ import { setServedFrom } from '../v2/shell/served-routes.js';
62
63
 
63
64
  export function useShellCore({}) {
64
65
  const [groups, setGroups] = useState([]);
@@ -507,6 +508,8 @@ export function useShellCore({}) {
507
508
  fetch('/_config')
508
509
  .then((r) => r.json())
509
510
  .then((data) => {
511
+ // #204 — a workspace cell serves no desktop-only route: the pollers stop asking them
512
+ setServedFrom(data);
510
513
  const designRel = (data.designRoot || '.design').replace(/^\/+|\/+$/g, '');
511
514
  // Functional merge — the `/_config` and `/_index-data` fetches race, and
512
515
  // the latter contributes `canvasDesignSystems` (DDR-093). A full-replace
@@ -8,10 +8,17 @@ import { basename, displayName, previewKind, shellToast } from '../shell/util.js
8
8
  import { assembleVideoFlow } from '../v2/timeline/assemble-video.js';
9
9
  import { notify } from '../../notifications.tsx';
10
10
  import { lastOpenedPath } from '../v2/canvases/last-canvas.js';
11
- import { trashCanvas } from '../v2/canvases/trash-canvas.js';
11
+ import { queueTrashCanvas } from '../v2/canvases/trash-queue.js';
12
12
  import { invoke, isNativeApp, listenHere } from '../github.js';
13
13
  import { applyShellNavigate, startShellEvents } from '../shell-events.js';
14
14
  import { threadAuthor } from '../v2/comments/use-comments-shell.jsx';
15
+ import { fetchIfServed } from '../v2/shell/served-routes.js';
16
+
17
+ /** `.design/ui/x.tsx` → `ui/x.tsx` (the designRoot-relative form the Canvases panel's row slots use). */
18
+ function relToDesignRoot(repoPath, cfg) {
19
+ const designRel = (cfg?.designRel || cfg?.designRoot || '.design').replace(/^\/+|\/+$/g, '');
20
+ return repoPath.startsWith(`${designRel}/`) ? repoPath.slice(designRel.length + 1) : repoPath;
21
+ }
15
22
 
16
23
  export function useTabs({
17
24
  groups,
@@ -135,7 +142,7 @@ export function useTabs({
135
142
  // 11 pn-deeplink: the artboard's name as the canvas shows it (the project index), not its id
136
143
  artboardLabel: async (file, id) => {
137
144
  try {
138
- const r = await fetch('/_api/index', { cache: 'no-store' });
145
+ const r = await fetchIfServed('/_api/index', { cache: 'no-store' });
139
146
  const j = r.ok ? await r.json() : null;
140
147
  const root = j?.project?.designRel || cfg.designRel;
141
148
  const c = (j?.canvases ?? []).find((x) => (root ? `${root}/${x.rel}` : x.rel) === file);
@@ -280,7 +287,7 @@ export function useTabs({
280
287
  lastOpened.current = true;
281
288
  (async () => {
282
289
  try {
283
- const r = await fetch('/_api/pins', { cache: 'no-store' });
290
+ const r = await fetchIfServed('/_api/pins', { cache: 'no-store' });
284
291
  if (!r.ok) return;
285
292
  const body = await r.json();
286
293
  const path = lastOpenedPath(body?.opened, groups, cfg.designRel || '.design');
@@ -578,10 +585,13 @@ export function useTabs({
578
585
  // moves the whole sidecar set to .design/_trash/), refresh the tree, and close the tab if that canvas was
579
586
  // open. S1.2 — it asks nothing: "“name” moved to the trash." with Undo, which brings it back (and reopens
580
587
  // it if it was the open one). CONTRACT §4: moved to the trash, never "deleted".
588
+ // #194 (2.0.4) — through the one trash queue (v2/canvases/trash-queue.js): the row says "Moving to trash…"
589
+ // at once, quick moves wait their turn instead of racing, and the server's yes takes the row out.
581
590
  const deleteBoard = useCallback(
582
591
  (filePath, label) =>
583
- trashCanvas({
592
+ queueTrashCanvas({
584
593
  path: filePath,
594
+ rel: relToDesignRoot(filePath, cfg),
585
595
  label,
586
596
  toast: shellToast,
587
597
  reload: loadTree,
@@ -595,7 +605,7 @@ export function useTabs({
595
605
  if (activePath === p) openTab(p);
596
606
  },
597
607
  }),
598
- [loadTree, activePath, openTab]
608
+ [loadTree, activePath, openTab, cfg]
599
609
  );
600
610
 
601
611
  // feature-file-tree-drag-drop-folders (Task 8/10) — drag-drop AND the
@@ -647,12 +657,13 @@ export function useTabs({
647
657
  );
648
658
 
649
659
  // feature-file-tree-drag-drop-folders (Task 4/9/12) — create a folder under
650
- // `parentDir`. Two callers: the sidebar header composer (name from its own
651
- // input state) and the tree-row context menu's "New folder here" (name via
652
- // `window.prompt` — a native, fully keyboard/screen-reader-operable input,
653
- // so that path doesn't need its own inline composer instance).
660
+ // `parentDir`. Two callers: the "+ New canvas" row's in-place folder field and
661
+ // the folder row menu's "New folder here" (#195: the shell's own dialog,
662
+ // v2/canvases/folder-dialogs.jsx — `window.prompt` is a no-op in WKWebView, so
663
+ // on the desktop this did nothing). Answers `{ ok, status?, error?, network? }`;
664
+ // `{ quiet: true }` leaves the words to the dialog that asked.
654
665
  const newFolderReq = useCallback(
655
- async (parentDir, name) => {
666
+ async (parentDir, name, opts = {}) => {
656
667
  try {
657
668
  const r = await fetch('/_api/fs-mkdir', {
658
669
  method: 'POST',
@@ -662,8 +673,8 @@ export function useTabs({
662
673
  const j = await r.json().catch(() => ({}));
663
674
  if (!r.ok || !j.ok) {
664
675
  const error = j.error || `error ${r.status}`;
665
- shellToast(`Could not create folder: ${error}`);
666
- return { ok: false, error };
676
+ if (!opts.quiet) shellToast(`Could not create folder: ${error}`);
677
+ return { ok: false, status: r.status, error };
667
678
  }
668
679
  // #124 — open the parent so the new folder is visible (it starts closed).
669
680
  updateTreeExp((st) => revealPath(st, groups, parentDir, { includeSelf: true }));
@@ -671,8 +682,8 @@ export function useTabs({
671
682
  return { ok: true, dir: j.dir };
672
683
  } catch (e) {
673
684
  const error = e instanceof Error ? e.message : 'network error';
674
- shellToast(`Create folder failed: ${error}`);
675
- return { ok: false, error };
685
+ if (!opts.quiet) shellToast(`Create folder failed: ${error}`);
686
+ return { ok: false, error, network: true };
676
687
  }
677
688
  },
678
689
  [loadTree, groups, updateTreeExp]
@@ -683,25 +694,27 @@ export function useTabs({
683
694
  // route now auto-detects a non-.tsx target as a folder delete); every
684
695
  // canvas inside is trashed the same recoverable way as a single-canvas
685
696
  // delete (`.design/_trash/<stamp>__<slug>/`).
697
+ // #195 — the tree asks first in its own dialog ("Move “x” to the trash?"); `window.confirm` answered "no"
698
+ // at once in WKWebView, so on the desktop this never ran. Answers `{ ok, status?, error?, network? }`.
686
699
  const deleteFolderReq = useCallback(
687
- async (dirPath, label) => {
688
- const ok = window.confirm(
689
- `Delete folder "${label}"?\n\nEvery canvas inside moves to trash (recoverable from .design/_trash/); ` +
690
- `any empty subfolders are removed.`
691
- );
692
- if (!ok) return;
700
+ async (dirPath, label, opts = {}) => {
693
701
  try {
694
702
  const r = await fetch(`/_api/canvas?file=${encodeURIComponent(dirPath)}`, {
695
703
  method: 'DELETE',
696
704
  });
697
705
  const j = await r.json().catch(() => ({}));
698
706
  if (!r.ok || !j.ok) {
699
- shellToast(`Could not delete folder: ${j.error || `error ${r.status}`}`);
700
- return;
707
+ const error = j.error || `error ${r.status}`;
708
+ if (!opts.quiet) shellToast(`Could not move “${label}” to the trash. ${error}`);
709
+ return { ok: false, status: r.status, error };
701
710
  }
702
711
  await loadTree();
712
+ shellToast(`“${label}” moved to the trash.`, true);
713
+ return { ok: true };
703
714
  } catch (e) {
704
- shellToast(`Delete folder failed: ${e instanceof Error ? e.message : 'network error'}`);
715
+ const error = e instanceof Error ? e.message : 'network error';
716
+ if (!opts.quiet) shellToast(`Could not move “${label}” to the trash.`);
717
+ return { ok: false, error, network: true };
705
718
  }
706
719
  },
707
720
  [loadTree]
@@ -710,7 +723,7 @@ export function useTabs({
710
723
  // Plan T17 — rename a folder: a move to a new name in the same parent (one
711
724
  // dir.move action in accepted mode, carrying every canvas inside).
712
725
  const renameFolderReq = useCallback(
713
- async (dirPath, name) => {
726
+ async (dirPath, name, opts = {}) => {
714
727
  const parent = dirPath.split('/').slice(0, -1).join('/');
715
728
  try {
716
729
  const r = await fetch('/_api/fs-move', {
@@ -720,8 +733,9 @@ export function useTabs({
720
733
  });
721
734
  const j = await r.json().catch(() => ({}));
722
735
  if (!r.ok || !j.ok) {
723
- shellToast(`Could not rename folder: ${j.error || `error ${r.status}`}`);
724
- return;
736
+ const error = j.error || `error ${r.status}`;
737
+ if (!opts.quiet) shellToast(`Could not rename folder: ${error}`);
738
+ return { ok: false, status: r.status, error };
725
739
  }
726
740
  // #124 — the renamed folder keeps its open state (and its subfolders').
727
741
  const designRel = (cfg?.designRel || cfg?.designRoot || '.design').replace(
@@ -731,8 +745,19 @@ export function useTabs({
731
745
  const toDir = typeof j.toRel === 'string' ? `${designRel}/${j.toRel}` : `${parent}/${name}`;
732
746
  updateTreeExp((st) => remapDirPrefix(st, dirPath, toDir));
733
747
  await loadTree();
748
+ // an open canvas inside the folder follows it (its tab would otherwise point at the old path)
749
+ const from = `${dirPath}/`;
750
+ const follow = (p) =>
751
+ typeof p === 'string' && p.startsWith(from) ? `${toDir}/${p.slice(from.length)}` : p;
752
+ setTabs((prev) =>
753
+ prev.map((t) => (t.path?.startsWith(from) ? { ...t, path: follow(t.path) } : t))
754
+ );
755
+ setActivePath((prev) => follow(prev));
756
+ return { ok: true };
734
757
  } catch (e) {
735
- shellToast(`Rename failed: ${e instanceof Error ? e.message : 'network error'}`);
758
+ const error = e instanceof Error ? e.message : 'network error';
759
+ if (!opts.quiet) shellToast(`Rename failed: ${error}`);
760
+ return { ok: false, error, network: true };
736
761
  }
737
762
  },
738
763
  [loadTree, cfg, updateTreeExp]
@@ -754,7 +779,7 @@ export function useTabs({
754
779
  if (!r.ok || !j.ok) {
755
780
  const error = j.error || `error ${r.status}`;
756
781
  if (!opts.quiet) shellToast(`Could not rename: ${error}`);
757
- return { ok: false, error };
782
+ return { ok: false, status: r.status, error };
758
783
  }
759
784
  const designRel = (cfg?.designRel || cfg?.designRoot || '.design').replace(
760
785
  /^\/+|\/+$/g,
@@ -769,7 +794,7 @@ export function useTabs({
769
794
  } catch (e) {
770
795
  const error = e instanceof Error ? e.message : 'network error';
771
796
  if (!opts.quiet) shellToast(`Rename failed: ${error}`);
772
- return { ok: false, error };
797
+ return { ok: false, error, network: true };
773
798
  }
774
799
  },
775
800
  [loadTree, cfg]
@@ -802,22 +827,26 @@ export function useTabs({
802
827
  [loadTree]
803
828
  );
804
829
 
830
+ // #195 — asked first in the tree's own dialog (never `window.confirm`, a no-op in WKWebView).
805
831
  const deleteFileReq = useCallback(
806
- async (filePath, name) => {
807
- if (!window.confirm(`Move “${name}” to trash?\n\nYou can restore it from .design/_trash/.`))
808
- return;
832
+ async (filePath, name, opts = {}) => {
809
833
  try {
810
834
  const r = await fetch(`/_api/canvas?file=${encodeURIComponent(filePath)}`, {
811
835
  method: 'DELETE',
812
836
  });
813
837
  const j = await r.json().catch(() => ({}));
814
838
  if (!r.ok || !j.ok) {
815
- shellToast(`Could not delete: ${j.error || `error ${r.status}`}`);
816
- return;
839
+ const error = j.error || `error ${r.status}`;
840
+ if (!opts.quiet) shellToast(`Could not move “${name}” to the trash. ${error}`);
841
+ return { ok: false, status: r.status, error };
817
842
  }
818
843
  await loadTree();
844
+ shellToast(`“${name}” moved to the trash.`, true);
845
+ return { ok: true };
819
846
  } catch (e) {
820
- shellToast(`Delete failed: ${e instanceof Error ? e.message : 'network error'}`);
847
+ const error = e instanceof Error ? e.message : 'network error';
848
+ if (!opts.quiet) shellToast(`Could not move “${name}” to the trash.`);
849
+ return { ok: false, error, network: true };
821
850
  }
822
851
  },
823
852
  [loadTree]
@@ -6,6 +6,7 @@ export function createIndexLoader<T>({
6
6
  retryDelayMs = 500,
7
7
  maxRetryDelayMs = 5000,
8
8
  timeoutMs = 10000,
9
+ maxTimeoutMs = 120000,
9
10
  }: {
10
11
  read: (signal: AbortSignal) => Promise<T>;
11
12
  apply: (value: T) => void;
@@ -13,10 +14,18 @@ export function createIndexLoader<T>({
13
14
  retryDelayMs?: number;
14
15
  maxRetryDelayMs?: number;
15
16
  timeoutMs?: number;
17
+ maxTimeoutMs?: number;
16
18
  }) {
17
19
  let disposed = false;
18
20
  let dirty = false;
19
21
  let failures = 0;
22
+ // #204 — a large index on a small cell answered after the fixed timeout, so it was aborted and
23
+ // asked again forever (each retry another full build on the server). Each timeout in a row
24
+ // doubles the next one's patience, up to `maxTimeoutMs`; any answer resets it.
25
+ let timeoutsInARow = 0;
26
+ // #204 — nothing drawn yet: the first answer is drawn even if a refresh is already queued behind
27
+ // it (a materialising project asks for one per arriving file, so "only the freshest" was never).
28
+ let appliedOnce = false;
20
29
  let pending: Promise<void> | null = null;
21
30
  let retryTimer: ReturnType<typeof setTimeout> | undefined;
22
31
  let controller: AbortController | undefined;
@@ -30,15 +39,26 @@ export function createIndexLoader<T>({
30
39
  cancelRetry();
31
40
  const current = new AbortController();
32
41
  controller = current;
33
- const timeout = setTimeout(() => current.abort(), timeoutMs);
42
+ let timedOut = false;
43
+ const patience = Math.min(maxTimeoutMs, timeoutMs * 2 ** Math.min(timeoutsInARow, 10));
44
+ const timeout = setTimeout(() => {
45
+ timedOut = true;
46
+ current.abort();
47
+ }, patience);
34
48
  try {
35
49
  const value = await read(current.signal);
50
+ timeoutsInARow = 0;
36
51
  // A mutation/refresh requested a newer index during this read. Do not
37
- // briefly restore the older tree; the next request serves all waiters.
38
- if (!disposed && !dirty) apply(value);
52
+ // briefly restore the older tree; the next request serves all waiters —
53
+ // unless there is no tree at all yet (#204): then this one is drawn.
54
+ if (!disposed && (!dirty || !appliedOnce)) {
55
+ apply(value);
56
+ appliedOnce = true;
57
+ }
39
58
  failures = 0;
40
59
  } catch (error) {
41
60
  if (disposed) return;
61
+ if (timedOut) timeoutsInARow++;
42
62
  onError(error);
43
63
  const status = (error as { status?: number } | null)?.status;
44
64
  if (status == null || status === 408 || status === 429 || status >= 500) {