@1agh/maude 2.0.4 → 2.0.8

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 (272) hide show
  1. package/apps/hub/src/project-transactions/kernel.mjs +10 -1
  2. package/apps/studio/access/closure.ts +156 -16
  3. package/apps/studio/access/filters.ts +39 -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/actions/agents.ts +59 -0
  7. package/apps/studio/actions/ctx.ts +3 -0
  8. package/apps/studio/actions/defs/app.ts +12 -0
  9. package/apps/studio/actions/defs/sync.ts +13 -0
  10. package/apps/studio/actions/defs/view.ts +59 -3
  11. package/apps/studio/actions/keymap.gen.ts +35 -0
  12. package/apps/studio/actions/menu.ts +2 -0
  13. package/apps/studio/actions/types.ts +3 -1
  14. package/apps/studio/actions.manifest.json +148 -1
  15. package/apps/studio/actions.parity.json +31 -1
  16. package/apps/studio/annotations/ui/ai-seen.tsx +4 -3
  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/ride.ts +2 -1
  20. package/apps/studio/annotations/ui/text-style.ts +1 -1
  21. package/apps/studio/annotations-context-toolbar.tsx +5 -4
  22. package/apps/studio/annotations-layer.tsx +4 -15
  23. package/apps/studio/api.ts +425 -128
  24. package/apps/studio/artboard-activity-overlay.tsx +4 -4
  25. package/apps/studio/artboard-ai-copies.tsx +4 -4
  26. package/apps/studio/artboard-freeze.ts +108 -0
  27. package/apps/studio/artboard-live-gate.tsx +636 -0
  28. package/apps/studio/artboard-live.ts +831 -0
  29. package/apps/studio/artboard-placeholder.ts +197 -0
  30. package/apps/studio/artboard-still-raster.ts +485 -0
  31. package/apps/studio/artboard-still-warmup.ts +221 -0
  32. package/apps/studio/artboard-still.ts +1188 -0
  33. package/apps/studio/artboard-webgl.ts +669 -0
  34. package/apps/studio/asset-placeholder.tsx +237 -132
  35. package/apps/studio/asset-upload-bars.tsx +4 -4
  36. package/apps/studio/bin/_agent-browser-bin.mjs +8 -0
  37. package/apps/studio/bin/_agent-browser-safe.mjs +2 -1
  38. package/apps/studio/bin/_canvas-reasons.mjs +34 -0
  39. package/apps/studio/bin/_ds-check-live.mjs +37 -0
  40. package/apps/studio/bin/_ds-check.mjs +4 -1
  41. package/apps/studio/bin/_ds-prove-judge.mjs +167 -0
  42. package/apps/studio/bin/_ds-prove-playwright.mjs +183 -105
  43. package/apps/studio/bin/_import-asset.mjs +2 -1
  44. package/apps/studio/bin/_perf-probe-open.mjs +364 -0
  45. package/apps/studio/bin/_perf-probe.mjs +2 -1
  46. package/apps/studio/bin/_perf-shared.mjs +12 -7
  47. package/apps/studio/bin/_pw-launch.mjs +26 -1
  48. package/apps/studio/bin/_studio-verb.mjs +24 -3
  49. package/apps/studio/bin/_thumb-blank.mjs +70 -0
  50. package/apps/studio/bin/_thumb-cover.mjs +35 -0
  51. package/apps/studio/bin/_thumbs-playwright.mjs +89 -12
  52. package/apps/studio/bin/ds-check.sh +5 -1
  53. package/apps/studio/bin/perf.sh +30 -1
  54. package/apps/studio/bin/server-up.sh +7 -2
  55. package/apps/studio/bin/smoke.sh +19 -0
  56. package/apps/studio/bridge/dgn-protocol.ts +35 -0
  57. package/apps/studio/canvas-build-sandbox.ts +69 -13
  58. package/apps/studio/canvas-camera.ts +90 -0
  59. package/apps/studio/canvas-comment-mount.tsx +9 -9
  60. package/apps/studio/canvas-lib.tsx +289 -44
  61. package/apps/studio/canvas-pages-view.tsx +465 -0
  62. package/apps/studio/canvas-pages.ts +305 -0
  63. package/apps/studio/canvas-rows.ts +62 -0
  64. package/apps/studio/canvas-shell.tsx +62 -16
  65. package/apps/studio/canvas-theme-icons.tsx +41 -0
  66. package/apps/studio/canvas-theme-pill.tsx +15 -6
  67. package/apps/studio/canvas-theme.ts +12 -11
  68. package/apps/studio/client/app.jsx +7 -0
  69. package/apps/studio/client/canvas-url.js +36 -1
  70. package/apps/studio/client/home/HomeAccounts.jsx +262 -0
  71. package/apps/studio/client/home/Shelves.jsx +4 -3
  72. package/apps/studio/client/home/home-accounts-model.js +121 -0
  73. package/apps/studio/client/home/home-api.js +6 -0
  74. package/apps/studio/client/home/home-app.jsx +141 -40
  75. package/apps/studio/client/home/home-model.js +172 -6
  76. package/apps/studio/client/home/home.css +169 -5
  77. package/apps/studio/client/home/shell-mode.js +8 -1
  78. package/apps/studio/client/hooks/canvas-origin-probe.js +34 -0
  79. package/apps/studio/client/hooks/use-action-keys.jsx +3 -1
  80. package/apps/studio/client/hooks/use-canvas-bridge.jsx +1 -1
  81. package/apps/studio/client/hooks/use-palette-and-panels.jsx +23 -6
  82. package/apps/studio/client/hooks/use-photo-and-timeline.jsx +16 -8
  83. package/apps/studio/client/hooks/use-project-data.jsx +13 -2
  84. package/apps/studio/client/hooks/use-shell-core.jsx +19 -9
  85. package/apps/studio/client/index-loader.ts +41 -21
  86. package/apps/studio/client/inspector/inspector-panel.jsx +35 -14
  87. package/apps/studio/client/panels/ChatPanel.jsx +27 -20
  88. package/apps/studio/client/panels/CreateProject.jsx +19 -5
  89. package/apps/studio/client/panels/caps-cache.js +46 -0
  90. package/apps/studio/client/shell/viewport.jsx +66 -22
  91. package/apps/studio/client/tree/tree.jsx +17 -0
  92. package/apps/studio/client/v2/access/access-client.js +2 -0
  93. package/apps/studio/client/v2/access/access-host.jsx +12 -1
  94. package/apps/studio/client/v2/access/trashed-banner.jsx +6 -3
  95. package/apps/studio/client/v2/ai/Advanced.jsx +12 -0
  96. package/apps/studio/client/v2/ai/Composer.jsx +27 -10
  97. package/apps/studio/client/v2/canvases/canvases-panel.jsx +24 -0
  98. package/apps/studio/client/v2/canvases/use-canvas-index.js +24 -1
  99. package/apps/studio/client/v2/code/canvas-error-card.jsx +14 -2
  100. package/apps/studio/client/v2/code/canvas-imports-card.jsx +19 -14
  101. package/apps/studio/client/v2/code/canvas-imports-words.js +60 -0
  102. package/apps/studio/client/v2/code/canvas-waiting-card.jsx +59 -5
  103. package/apps/studio/client/v2/code/canvas-waiting.js +18 -1
  104. package/apps/studio/client/v2/code/code-bus.js +5 -0
  105. package/apps/studio/client/v2/code/code-consent-sheet.jsx +87 -0
  106. package/apps/studio/client/v2/code/code-consent.js +67 -0
  107. package/apps/studio/client/v2/diagnostics/sync-details/sync-details-model.js +62 -10
  108. package/apps/studio/client/v2/diagnostics/sync-details/sync-details.jsx +314 -5
  109. package/apps/studio/client/v2/ds/advanced-host.jsx +11 -26
  110. package/apps/studio/client/v2/ds/ds-refresh.js +161 -0
  111. package/apps/studio/client/v2/ds/library-host.jsx +45 -45
  112. package/apps/studio/client/v2/ds/make-host.jsx +13 -15
  113. package/apps/studio/client/v2/ds/off-system-host.jsx +18 -19
  114. package/apps/studio/client/v2/ds/review-host.jsx +7 -1
  115. package/apps/studio/client/v2/ds/truth-host.jsx +15 -17
  116. package/apps/studio/client/v2/ds/upgrade-host.jsx +26 -10
  117. package/apps/studio/client/v2/history/branch-actions.js +13 -9
  118. package/apps/studio/client/v2/history/git-advanced.jsx +8 -1
  119. package/apps/studio/client/v2/history/git-model.js +3 -1
  120. package/apps/studio/client/v2/history/git-parts.jsx +16 -1
  121. package/apps/studio/client/v2/layers/artboard-layers.jsx +24 -5
  122. package/apps/studio/client/v2/layers/layers-request.js +49 -0
  123. package/apps/studio/client/v2/left-panel/canvases-pinned.jsx +93 -3
  124. package/apps/studio/client/v2/left-panel/ds-boards.js +39 -0
  125. package/apps/studio/client/v2/left-panel/left-panel-model.js +13 -0
  126. package/apps/studio/client/v2/left-panel/left-panel.css +24 -0
  127. package/apps/studio/client/v2/presence/faces.jsx +42 -14
  128. package/apps/studio/client/v2/shell/account-card.jsx +10 -4
  129. package/apps/studio/client/v2/shell/canvas-crash-guard.js +172 -0
  130. package/apps/studio/client/v2/shell/canvas-mode.js +17 -1
  131. package/apps/studio/client/v2/shell/floating-panels.css +37 -1
  132. package/apps/studio/client/v2/shell/github-signin-host.jsx +42 -0
  133. package/apps/studio/client/v2/shell/menu-runner.js +11 -0
  134. package/apps/studio/client/v2/shell/mode-switch.jsx +14 -3
  135. package/apps/studio/client/v2/shell/opening-skeleton.js +118 -0
  136. package/apps/studio/client/v2/shell/opening-skeleton.jsx +103 -0
  137. package/apps/studio/client/v2/shell/pages-pick.js +49 -0
  138. package/apps/studio/client/v2/shell/project-account-card.jsx +203 -0
  139. package/apps/studio/client/v2/shell/project-account-model.js +182 -0
  140. package/apps/studio/client/v2/shell/project-menu-model.js +3 -0
  141. package/apps/studio/client/v2/shell/share-cluster-host.jsx +140 -11
  142. package/apps/studio/client/v2/shell/share-cluster.css +58 -0
  143. package/apps/studio/client/v2/shell/share-cluster.jsx +26 -7
  144. package/apps/studio/client/v2/shell/shell-parity.json +8 -0
  145. package/apps/studio/client/v2/shell/team-switch.js +94 -0
  146. package/apps/studio/client/v2/shell/too-heavy-card.jsx +38 -0
  147. package/apps/studio/client/v2/shell/use-account.js +8 -1
  148. package/apps/studio/client/v2/shell/use-canvas-mode-lane.js +30 -0
  149. package/apps/studio/collab/persistence.ts +9 -1
  150. package/apps/studio/collab/registry.ts +32 -0
  151. package/apps/studio/collab/room.ts +8 -0
  152. package/apps/studio/comments-overlay.tsx +12 -11
  153. package/apps/studio/config-reload-wire.ts +56 -0
  154. package/apps/studio/config.schema.json +6 -0
  155. package/apps/studio/context.ts +37 -1
  156. package/apps/studio/dist/client.bundle.js +1198 -1198
  157. package/apps/studio/dist/comment-mount.js +2 -2
  158. package/apps/studio/dist/styles.css +1 -1
  159. package/apps/studio/ds/board/board.css +6 -0
  160. package/apps/studio/ds/board/ds-bar.tsx +21 -3
  161. package/apps/studio/ds/board/specimen.tsx +16 -2
  162. package/apps/studio/ds/board/template.ts +39 -19
  163. package/apps/studio/ds/canvas-cli.ts +58 -2
  164. package/apps/studio/ds/check.ts +26 -1
  165. package/apps/studio/ds/cli.ts +14 -4
  166. package/apps/studio/ds/component-list.ts +2 -1
  167. package/apps/studio/ds/convert.ts +34 -6
  168. package/apps/studio/ds/default.ts +6 -1
  169. package/apps/studio/ds/ds-resolver.ts +58 -8
  170. package/apps/studio/ds/ds-verb.ts +13 -0
  171. package/apps/studio/ds/engine.ts +3 -1
  172. package/apps/studio/ds/folder-systems.ts +199 -0
  173. package/apps/studio/ds/pairing-css.ts +2 -1
  174. package/apps/studio/ds/post-build.ts +38 -0
  175. package/apps/studio/ds/rename.ts +10 -3
  176. package/apps/studio/ds/shell-fallbacks.ts +2 -1
  177. package/apps/studio/ds/upgrade-apply.ts +27 -5
  178. package/apps/studio/ds/upgrade-cli.ts +22 -2
  179. package/apps/studio/ds/upgrade-prove.ts +198 -15
  180. package/apps/studio/ds/upgrade-stage.ts +10 -3
  181. package/apps/studio/editing/ai-point-ring.tsx +4 -4
  182. package/apps/studio/editing/ai-scope-outline.tsx +4 -4
  183. package/apps/studio/editing/align-bar.tsx +4 -4
  184. package/apps/studio/editing/anchor-report.ts +3 -2
  185. package/apps/studio/editing/artboard-handles.tsx +4 -4
  186. package/apps/studio/editing/corner-dots.tsx +4 -4
  187. package/apps/studio/editing/crop-mode.tsx +4 -4
  188. package/apps/studio/editing/drop-chip.tsx +4 -4
  189. package/apps/studio/editing/empty-report.ts +3 -2
  190. package/apps/studio/editing/focus-model.tsx +4 -4
  191. package/apps/studio/editing/gap-bands.tsx +3 -3
  192. package/apps/studio/editing/hold-rings.tsx +4 -4
  193. package/apps/studio/editing/lock-badge.tsx +3 -3
  194. package/apps/studio/editing/long-page.ts +23 -1
  195. package/apps/studio/editing/nudge.tsx +2 -2
  196. package/apps/studio/editing/page-activity.ts +4 -3
  197. package/apps/studio/editing/paste-bar.tsx +4 -4
  198. package/apps/studio/editing/pen/overlay.tsx +4 -3
  199. package/apps/studio/editing/place-freely.tsx +3 -3
  200. package/apps/studio/editing/reorder-slot.tsx +3 -3
  201. package/apps/studio/editing/selection.tsx +4 -4
  202. package/apps/studio/editing/size-ghost.tsx +4 -4
  203. package/apps/studio/editing/tab-order.tsx +4 -4
  204. package/apps/studio/editing/text-in-place.tsx +4 -4
  205. package/apps/studio/editing/undo-preview.tsx +3 -3
  206. package/apps/studio/equal-spacing-handles.tsx +3 -3
  207. package/apps/studio/frame-clock.ts +89 -0
  208. package/apps/studio/history/trash.ts +6 -0
  209. package/apps/studio/home/accounts.ts +87 -0
  210. package/apps/studio/home/index-reader.ts +24 -2
  211. package/apps/studio/home/routes.ts +19 -0
  212. package/apps/studio/http.ts +80 -34
  213. package/apps/studio/index/ds-usage.ts +4 -1
  214. package/apps/studio/index-cache.ts +272 -0
  215. package/apps/studio/inspect-overlay.tsx +4 -3
  216. package/apps/studio/inspect.ts +7 -2
  217. package/apps/studio/link-chip-overlay.tsx +4 -3
  218. package/apps/studio/measure-overlay.tsx +4 -3
  219. package/apps/studio/present/pointer-dot.tsx +3 -2
  220. package/apps/studio/present/present-media.ts +6 -2
  221. package/apps/studio/present/present-stage.tsx +3 -2
  222. package/apps/studio/preview/preview-camera.tsx +3 -2
  223. package/apps/studio/routes/ds-convert.ts +18 -0
  224. package/apps/studio/routes/sync.ts +176 -0
  225. package/apps/studio/routes/trash.ts +16 -1
  226. package/apps/studio/safe-zones-overlay.tsx +3 -2
  227. package/apps/studio/server.ts +8 -10
  228. package/apps/studio/skip-dirs.ts +103 -47
  229. package/apps/studio/studio-page-host.ts +70 -0
  230. package/apps/studio/sync/accepted-cold-start.ts +28 -13
  231. package/apps/studio/sync/asset-push.ts +146 -23
  232. package/apps/studio/sync/asset-state.ts +3 -2
  233. package/apps/studio/sync/code-module-consent.ts +86 -0
  234. package/apps/studio/sync/file-ledger.ts +24 -0
  235. package/apps/studio/sync/file-membership.ts +28 -3
  236. package/apps/studio/sync/file-plane.ts +497 -61
  237. package/apps/studio/sync/file-pull.ts +304 -33
  238. package/apps/studio/sync/held-deletes.ts +230 -0
  239. package/apps/studio/sync/hub-link.ts +1 -2
  240. package/apps/studio/sync/hubs-config.ts +59 -2
  241. package/apps/studio/sync/index.ts +405 -163
  242. package/apps/studio/sync/journal-client.ts +94 -5
  243. package/apps/studio/sync/pending-deletes.ts +100 -0
  244. package/apps/studio/sync/projection.ts +77 -12
  245. package/apps/studio/sync/seed-progress.ts +104 -3
  246. package/apps/studio/sync/settings.ts +36 -1
  247. package/apps/studio/sync/status.ts +17 -1
  248. package/apps/studio/sync/writer-registry.ts +5 -0
  249. package/apps/studio/text-caret.ts +5 -3
  250. package/apps/studio/thumbs/service.ts +12 -2
  251. package/apps/studio/thumbs/validate.ts +7 -0
  252. package/apps/studio/toolbars/toolbar-rect.ts +3 -2
  253. package/apps/studio/ui-prefs-migrate.ts +4 -0
  254. package/apps/studio/use-annotation-resize.tsx +4 -3
  255. package/apps/studio/use-artboard-drag.tsx +3 -2
  256. package/apps/studio/use-element-resize.tsx +7 -6
  257. package/apps/studio/use-grid-track-handles.tsx +5 -4
  258. package/apps/studio/use-selection-set.tsx +64 -4
  259. package/apps/studio/use-spacing-handles.tsx +7 -6
  260. package/apps/studio/video-comp.tsx +75 -39
  261. package/apps/studio/video-play-overlay.tsx +4 -3
  262. package/apps/studio/whats-new.json +99 -0
  263. package/cli/commands/design.mjs +5 -2
  264. package/cli/commands/hub.mjs +10 -1
  265. package/cli/lib/bash-guard.mjs +27 -1
  266. package/cli/lib/design-help.gen.mjs +1 -1
  267. package/cli/lib/design-hook.mjs +20 -0
  268. package/cli/lib/design-link.mjs +42 -17
  269. package/cli/lib/hub-purge.mjs +183 -0
  270. package/cli/lib/studio-locate.mjs +35 -10
  271. package/package.json +8 -8
  272. package/plugins/design/templates/_shell.html +164 -1
@@ -1928,11 +1928,47 @@
1928
1928
 
1929
1929
  /* 180ms appearance delay on the CARD — warm canvases mount in <150ms and never
1930
1930
  * flash it; the backdrop above is immediate so nothing white shows through. */
1931
- .sh-canvas-loading > .sh-skel-card {
1931
+ .sh-canvas-loading .sh-skel-card {
1932
1932
  opacity: 0;
1933
1933
  animation: sh-loading-in var(--dur-soft) var(--ease-out) 180ms forwards;
1934
1934
  }
1935
1935
 
1936
+ /* 2.0.7 (B1) — the opening canvas's artboards as skeletons at their final place and size (05 es-skab), on the
1937
+ same 180 ms beat as the card so a warm canvas never flashes them; the card centres while they are not known */
1938
+ .sh-opening-skel {
1939
+ position: absolute;
1940
+ inset: 0;
1941
+ display: grid;
1942
+ place-items: center;
1943
+ overflow: hidden;
1944
+ }
1945
+ .sh-opening-skel[data-ready="true"] {
1946
+ display: block;
1947
+ opacity: 0;
1948
+ animation: sh-loading-in var(--dur-soft) var(--ease-out) 180ms forwards;
1949
+ }
1950
+ .sh-opening-note {
1951
+ position: absolute;
1952
+ left: 50%;
1953
+ bottom: var(--space-5);
1954
+ translate: -50% 0;
1955
+ z-index: 3;
1956
+ margin: 0;
1957
+ max-width: min(420px, calc(100% - 2 * var(--space-4)));
1958
+ padding: var(--space-2) var(--space-3);
1959
+ border-radius: var(--radius-md);
1960
+ background: var(--island-bg, var(--bg-1));
1961
+ box-shadow: var(--island-shadow, var(--shadow-md));
1962
+ font-size: var(--type-xs);
1963
+ line-height: 1.45;
1964
+ color: var(--fg-1);
1965
+ }
1966
+ @media (prefers-reduced-motion: reduce) {
1967
+ .sh-opening-skel[data-ready="true"] {
1968
+ animation-duration: 1ms;
1969
+ }
1970
+ }
1971
+
1936
1972
  @keyframes sh-loading-in {
1937
1973
  to {
1938
1974
  opacity: 1;
@@ -0,0 +1,42 @@
1
+ // client/v2/shell/github-signin-host.jsx — 2.0.5 W4: where `account.github-signin` runs.
2
+ //
3
+ // The one GitHub sign-in of a project tab: the shell's device flow (`github_sign_in`, oauth.rs — the
4
+ // calling project's profile, bind-on-sign-in for another account on a shared one), through the SAME hook
5
+ // Settings › Connections uses (useGitHubConnection), and the same code sheet (GitHubDeviceDialog). The
6
+ // menu runner hands the action here over MENU_ACTION_EVENT, the way IdentityBar hears project.new, so the
7
+ // avatar's card, ⌘K, the Versions sheet's "Sign in with GitHub to publish" lines and New project… all
8
+ // start this one flow. Mounted by share-cluster-host.jsx, which every project tab draws.
9
+
10
+ import { useEffect, useRef } from 'react';
11
+ import { GitHubDeviceDialog } from '../../panels/IdentityBar.jsx';
12
+ import { shellToast } from '../../shell/util.js';
13
+ import { useGitHubConnection } from '../settings/use-connections.js';
14
+ import { MENU_ACTION_EVENT } from './menu-runner.js';
15
+
16
+ export function useGitHubSignInHost() {
17
+ const gh = useGitHubConnection();
18
+ const ref = useRef(gh);
19
+ ref.current = gh;
20
+ useEffect(() => {
21
+ const on = (e) => {
22
+ if (e.detail?.id !== 'account.github-signin') return;
23
+ const g = ref.current;
24
+ if (!g.native || g.signing) return;
25
+ g.signIn();
26
+ };
27
+ window.addEventListener(MENU_ACTION_EVENT, on);
28
+ return () => window.removeEventListener(MENU_ACTION_EVENT, on);
29
+ }, []);
30
+ // A failed flow says so once (the hook keeps the sentence for Settings' row too).
31
+ const lastErr = useRef('');
32
+ useEffect(() => {
33
+ if (gh.error && gh.error !== lastErr.current) shellToast(gh.error);
34
+ lastErr.current = gh.error;
35
+ }, [gh.error]);
36
+ return gh;
37
+ }
38
+
39
+ /** The device-code sheet while a sign-in started here waits for the browser. */
40
+ export function GitHubSignInSheet({ gh }) {
41
+ return gh?.device ? <GitHubDeviceDialog device={gh.device} onClose={gh.closeDevice} /> : null;
42
+ }
@@ -274,6 +274,17 @@ export function createMenuHandlers(d) {
274
274
  'handoff.open': () => d.setExportDialog({ mode: 'handoff' }),
275
275
  'canvas.close': () => d.onCloseCanvas(),
276
276
  'account.switch': () => d.onSwitchAccount(),
277
+ // 2.0.5 W4 — the GitHub device flow is the mounted host's (github-signin-host.jsx: its code sheet
278
+ // and state); it hears this the way IdentityBar hears project.new. A browser tab has no keychain.
279
+ 'account.github-signin': () => {
280
+ if (!d.native) {
281
+ d.toast('Signing in with GitHub needs the Maude desktop app.');
282
+ return;
283
+ }
284
+ window.dispatchEvent(
285
+ new CustomEvent(MENU_ACTION_EVENT, { detail: { id: 'account.github-signin' } })
286
+ );
287
+ },
277
288
  // ── Edit ── (select / properties ride the canvas lane; artboards the shell's)
278
289
  // S2.20 — Undo / Redo run the ⌘Z projection over the op log (since p8-v1-drop the canvas keeps no
279
290
  // stack to fall back to). Undo history… opens the popover.
@@ -120,6 +120,9 @@ const LABEL = {
120
120
  present: 'Present',
121
121
  };
122
122
 
123
+ /** 2.0.7 B2 — why Preview and Present are off while the canvas shows Pages (one artboard at a time). */
124
+ export const PAGES_REASON = 'Switch to Canvas to preview or present.';
125
+
123
126
  /** Present ⌄'s rows (04 md-present-menu; words CONTRACT §2–§3). */
124
127
  const PRESENT_ROWS = [
125
128
  { group: 'Artboards, one by one' },
@@ -193,6 +196,7 @@ function presentRows(caps, presenterView, copyLink) {
193
196
  * @param presenterView S3.6b — `{ name, on }` when the desktop app has another display (the row is a check
194
197
  * with that display's name); null = the row greyed, "Needs a second display" (04 md-present-menu)
195
198
  * @param onPresenterView () => void — the row toggles presenter view
199
+ * @param pages 2.0.7 B2 — the canvas shows Pages: Preview and Present are greyed with the reason (`PAGES_REASON`)
196
200
  * @param copyLink S3.14 — `{ enabled, note }` (copy-link.js `copyRowState`): Copy presentation link, an editor's
197
201
  * row; greyed with the reason when not enabled. null = no row (the host decides)
198
202
  */
@@ -207,7 +211,11 @@ export function ModeSwitch({
207
211
  presenterView = null,
208
212
  onPresenterView,
209
213
  copyLink = null,
214
+ pages = false,
210
215
  }) {
216
+ // 2.0.7 B2 — Pages holds Preview and Present off (canvas-mode.js `pages`); a click would do nothing, so say why
217
+ const presentOff = !canPresent || pages;
218
+ const presentWhy = pages ? PAGES_REASON : 'noCanvas';
211
219
  const run = (kind) => {
212
220
  if (onPresent) onPresent(kind);
213
221
  else if (kind === 'canvas') onPresentCanvas?.();
@@ -283,7 +291,8 @@ export function ModeSwitch({
283
291
  aria-pressed={mode === 'present'}
284
292
  aria-keyshortcuts={ariaModeKeys('present')}
285
293
  title={modeTitle('present')}
286
- disabled={!canPresent}
294
+ disabled={presentOff}
295
+ {...reasonProps(pages, PAGES_REASON)}
287
296
  onClick={() => onSelect?.('present')}
288
297
  >
289
298
  <ModeGlyph m="present" />
@@ -295,8 +304,8 @@ export function ModeSwitch({
295
304
  aria-label="Present options"
296
305
  aria-haspopup="menu"
297
306
  aria-expanded={menu}
298
- disabled={!canPresent}
299
- {...reasonProps(!canPresent, 'noCanvas')}
307
+ disabled={presentOff}
308
+ {...reasonProps(presentOff, presentWhy)}
300
309
  onClick={() => setMenu((v) => !v)}
301
310
  >
302
311
  <svg width="10" height="10" viewBox="0 0 16 16" fill="none" aria-hidden="true">
@@ -320,6 +329,8 @@ export function ModeSwitch({
320
329
  aria-pressed={mode === id}
321
330
  aria-keyshortcuts={ariaModeKeys(id)}
322
331
  title={modeTitle(id)}
332
+ disabled={id === 'preview' && pages}
333
+ {...reasonProps(id === 'preview' && pages, PAGES_REASON)}
323
334
  onClick={() => onSelect?.(id)}
324
335
  >
325
336
  <ModeGlyph m={id} />
@@ -0,0 +1,118 @@
1
+ // client/v2/shell/opening-skeleton.js — 2.0.7 (B1): while a canvas opens, every artboard shows at once as a
2
+ // skeleton at its final place and size, and the real canvas replaces them all when it reports `canvas-rendered`.
3
+ //
4
+ // PURE. The studio draws the skeletons itself, over the frame, from what it already knows before the canvas
5
+ // module builds: the index row (artboard ids in the canvas's order, their JSX width/height, labels, kinds) and
6
+ // the canvas meta (`layout.artboards[]` positions, the per-person `viewport`). The frame never draws them, so a
7
+ // capture or an export — a frame with no studio around it — can never show one, and the frame's live/sleep
8
+ // rules (artboard-live.ts) and WebGL budget are untouched.
9
+ //
10
+ // Lining up with the frame's camera: the layout and the camera here are canvas-lib's own rules, restated —
11
+ // `initialArtboards()` (JSX size, meta position, meta w/h when present, the default grid for a board the meta
12
+ // does not place) and `getInitial()` (the stored viewport, else `computeFit` with a 24 px pad inside the
13
+ // occluded insets). test/v2-opening-skeleton.test.tsx holds both against canvas-lib's exported functions.
14
+ //
15
+ // When the rules cannot be followed exactly the answer is `null` and the studio keeps its "Opening …" card:
16
+ // an artboard whose size is not a literal, a dynamic canvas (its artboards are made when it runs), no index.
17
+
18
+ import { visibleRect } from '../../../bridge/occlusion.ts';
19
+
20
+ /** canvas-lib's `VP_GRID` (the default grid for artboards the meta does not place) and its fit pad. */
21
+ export const SKELETON_GRID = Object.freeze({ cols: 3, w: 1280, h: 820, gutter: 80 });
22
+ export const FIT_PAD = 24;
23
+ /** Under this many screen px a canvas-lib name collapses to nothing (`.dc-artboard-label` max-width). */
24
+ export const NAME_MIN_PX = 24;
25
+
26
+ const pos = (n) => typeof n === 'number' && Number.isFinite(n) && n > 0;
27
+ const fin = (n) => typeof n === 'number' && Number.isFinite(n);
28
+
29
+ /** The index row of `path` (repo-relative) in an index snapshot, or null. */
30
+ export function indexRowOf(snapshot, path) {
31
+ const rows = Array.isArray(snapshot?.canvases) ? snapshot.canvases : null;
32
+ if (!rows || typeof path !== 'string') return null;
33
+ const root = (snapshot?.project?.designRel || '').replace(/^\/+|\/+$/g, '');
34
+ const rel = root && path.startsWith(`${root}/`) ? path.slice(root.length + 1) : path;
35
+ return rows.find((c) => c && c.rel === rel) || null;
36
+ }
37
+
38
+ /**
39
+ * The artboards as canvas-lib will place them: [{ id, label, kind, x, y, w, h }] in the canvas's order, or null
40
+ * when that cannot be known before the canvas runs.
41
+ */
42
+ export function skeletonBoards({ row, meta }) {
43
+ const list = Array.isArray(row?.artboards) ? row.artboards.filter((a) => a && a.id) : [];
44
+ if (!list.length) return null;
45
+ // a dynamic canvas makes artboards when it runs: the parse has only some of them, and the grid would shift
46
+ if (row.dynamic && row.artboardsFrom !== 'runtime') return null;
47
+ const placed = new Map();
48
+ const metaBoards = meta?.layout?.artboards;
49
+ if (Array.isArray(metaBoards)) for (const m of metaBoards) if (m && m.id) placed.set(m.id, m);
50
+ // the default grid's cell is the largest JSX size (synthDefaultGrid) — needed only for a board the meta leaves out
51
+ const needsGrid = list.some((a) => {
52
+ const m = placed.get(a.id);
53
+ return !(m && fin(m.x) && fin(m.y));
54
+ });
55
+ if (needsGrid && list.some((a) => !pos(a.w) || !pos(a.h))) return null;
56
+ const cellW = needsGrid ? Math.max(...list.map((a) => a.w)) : 0;
57
+ const cellH = needsGrid ? Math.max(...list.map((a) => a.h)) : 0;
58
+ const G = SKELETON_GRID;
59
+ const out = [];
60
+ for (let i = 0; i < list.length; i++) {
61
+ const a = list[i];
62
+ const m = placed.get(a.id);
63
+ const w = m && pos(m.w) ? m.w : a.w;
64
+ const h = m && pos(m.h) ? m.h : a.h;
65
+ if (!pos(w) || !pos(h)) return null;
66
+ const x = m && fin(m.x) ? m.x : (i % G.cols) * (cellW + G.gutter);
67
+ const y = m && fin(m.y) ? m.y : Math.floor(i / G.cols) * (cellH + G.gutter);
68
+ out.push({ id: a.id, label: a.label || a.id, kind: a.kind || 'digital', x, y, w, h });
69
+ }
70
+ return out;
71
+ }
72
+
73
+ /**
74
+ * The camera canvas-lib opens on: the stored viewport when there is one, else the boards fitted (24 px pad) in
75
+ * the part of the canvas the shell's panels leave free. `width`/`height` are the frame's size.
76
+ */
77
+ export function skeletonCamera({ boards, width, height, insets, viewport }) {
78
+ if (viewport && fin(viewport.x) && fin(viewport.y) && fin(viewport.zoom))
79
+ return { x: viewport.x, y: viewport.y, zoom: viewport.zoom };
80
+ if (!boards?.length) return { x: 0, y: 0, zoom: 1 };
81
+ let xMin = Number.POSITIVE_INFINITY;
82
+ let yMin = Number.POSITIVE_INFINITY;
83
+ let xMax = Number.NEGATIVE_INFINITY;
84
+ let yMax = Number.NEGATIVE_INFINITY;
85
+ for (const r of boards) {
86
+ xMin = Math.min(xMin, r.x);
87
+ yMin = Math.min(yMin, r.y);
88
+ xMax = Math.max(xMax, r.x + r.w);
89
+ yMax = Math.max(yMax, r.y + r.h);
90
+ }
91
+ const bw = xMax - xMin;
92
+ const bh = yMax - yMin;
93
+ if (!width || !height || bw <= 0 || bh <= 0) return { x: 0, y: 0, zoom: 1 };
94
+ const v = visibleRect(width, height, insets || { top: 0, right: 0, bottom: 0, left: 0 });
95
+ const zoom = Math.min((v.w - FIT_PAD * 2) / bw, (v.h - FIT_PAD * 2) / bh, 1.0);
96
+ return {
97
+ x: v.x + (v.w - bw * zoom) / 2 - xMin * zoom,
98
+ y: v.y + (v.h - bh * zoom) / 2 - yMin * zoom,
99
+ zoom,
100
+ };
101
+ }
102
+
103
+ /**
104
+ * The boards in screen px under `cam`, only those that show in a `width` x `height` frame (a big canvas
105
+ * zoomed in draws a handful, not hundreds). `named` follows canvas-lib's collapse of a too-narrow name.
106
+ */
107
+ export function screenBoards(boards, cam, width, height) {
108
+ const out = [];
109
+ for (const b of boards || []) {
110
+ const left = cam.x + b.x * cam.zoom;
111
+ const top = cam.y + b.y * cam.zoom;
112
+ const w = b.w * cam.zoom;
113
+ const h = b.h * cam.zoom;
114
+ if (width && height && (left > width || top > height || left + w < 0 || top + h < 0)) continue;
115
+ out.push({ ...b, left, top, sw: w, sh: h, named: w >= NAME_MIN_PX });
116
+ }
117
+ return out;
118
+ }
@@ -0,0 +1,103 @@
1
+ // client/v2/shell/opening-skeleton.jsx — 2.0.7 (B1): the artboards of a canvas that is opening, drawn at once
2
+ // at their final place and size (opening-skeleton.js holds the rules). The studio draws them over the frame and
3
+ // drops them when the canvas reports `canvas-rendered`; the frame itself never draws a skeleton, so captures and
4
+ // exports cannot show one. Until the layout is known — or when it cannot be known before the canvas runs — the
5
+ // caller's card shows instead.
6
+
7
+ import { useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore } from 'react';
8
+ import { SkeletonArtboard } from '../empty/skeleton.jsx';
9
+ import { useIndexSnapshotNow } from '../canvases/use-canvas-index.js';
10
+ import { insetsNow } from './insets-now.js';
11
+ import { indexRowOf, screenBoards, skeletonBoards, skeletonCamera } from './opening-skeleton.js';
12
+
13
+ /** The canvas's meta (layout + the person's viewport), as the frame reads it. undefined while asked, null: none. */
14
+ function useCanvasMeta(path, fetchImpl) {
15
+ const [meta, setMeta] = useState(undefined);
16
+ useEffect(() => {
17
+ let alive = true;
18
+ setMeta(undefined);
19
+ const f = fetchImpl || ((...a) => fetch(...a));
20
+ Promise.resolve()
21
+ .then(() =>
22
+ f(`/_api/canvas-meta?file=${encodeURIComponent(path)}`, {
23
+ headers: { 'Cache-Control': 'no-store' },
24
+ })
25
+ )
26
+ .then((r) => (r?.ok ? r.json() : null))
27
+ .then((j) => alive && setMeta(j && typeof j === 'object' ? j : null))
28
+ .catch(() => alive && setMeta(null));
29
+ return () => {
30
+ alive = false;
31
+ };
32
+ }, [path, fetchImpl]);
33
+ return meta;
34
+ }
35
+
36
+ function useBoxSize(ref) {
37
+ const [size, setSize] = useState({ w: 0, h: 0 });
38
+ useLayoutEffect(() => {
39
+ const el = ref.current;
40
+ if (!el) return undefined;
41
+ const measure = () => setSize({ w: el.clientWidth, h: el.clientHeight });
42
+ measure();
43
+ if (typeof ResizeObserver !== 'function') return undefined;
44
+ const ro = new ResizeObserver(measure);
45
+ ro.observe(el);
46
+ return () => ro.disconnect();
47
+ }, [ref]);
48
+ return size;
49
+ }
50
+
51
+ /**
52
+ * @param {{ path: string, fallback: import('react').ReactNode, note?: string | null, fetchImpl?: typeof fetch }} props
53
+ * path the opening canvas (repo-relative, e.g. `<designRoot>/ui/Home.tsx`)
54
+ * fallback what shows while the layout is not known (the "Opening …" card)
55
+ * note a line over the skeletons once opening is slow (the card's own hint)
56
+ */
57
+ export function OpeningSkeleton({ path, fallback, note = null, fetchImpl }) {
58
+ const ref = useRef(null);
59
+ const snapshot = useIndexSnapshotNow();
60
+ const meta = useCanvasMeta(path, fetchImpl);
61
+ const insets = useSyncExternalStore(insetsNow.subscribe, insetsNow.get, insetsNow.get);
62
+ const size = useBoxSize(ref);
63
+ const boards =
64
+ meta === undefined ? null : skeletonBoards({ row: indexRowOf(snapshot, path), meta });
65
+ const cam =
66
+ boards && size.w && size.h
67
+ ? skeletonCamera({
68
+ boards,
69
+ width: size.w,
70
+ height: size.h,
71
+ insets,
72
+ viewport: meta?.viewport,
73
+ })
74
+ : null;
75
+ const shown = cam ? screenBoards(boards, cam, size.w, size.h) : null;
76
+ return (
77
+ <div
78
+ ref={ref}
79
+ className="sh-opening-skel"
80
+ data-testid="canvas-skeleton"
81
+ data-ready={shown ? 'true' : 'false'}
82
+ >
83
+ {shown && note ? (
84
+ <p className="sh-opening-note" data-testid="canvas-skeleton-note">
85
+ {note}
86
+ </p>
87
+ ) : null}
88
+ {shown
89
+ ? shown.map((b) => (
90
+ <SkeletonArtboard
91
+ key={b.id}
92
+ label={b.named ? b.label : ''}
93
+ kind={b.kind}
94
+ x={b.left}
95
+ y={b.top}
96
+ w={b.sw}
97
+ h={b.sh}
98
+ />
99
+ ))
100
+ : fallback}
101
+ </div>
102
+ );
103
+ }
@@ -0,0 +1,49 @@
1
+ // client/v2/shell/pages-pick.js — 2.0.7 B2: the shell remembers the canvas's Canvas | Pages and Light | Dark picks.
2
+ //
3
+ // The canvas owns the view (canvas-pages.ts) but writes nothing: the canvas origin may PATCH only `layout` and
4
+ // `viewport` of `/_api/canvas-meta` (routes/canvas-origin.ts), and Pages adds no lane there. When a person switches,
5
+ // the active canvas says `pages-pick` and the shell — on the main origin, for the canvas IT has open — writes
6
+ // `canvasView` into the view file (`_canvas-state/<slug>.view.json`, per Mac, DDR-115), never the versioned meta.
7
+
8
+ import { normalizeOpenPath } from '../../share-link.js';
9
+
10
+ /** The `/_api/canvas-meta` body `{ file, patch: { [key]: value } }` for the open canvas, or null when there is none. */
11
+ function pickBody(activePath, designRel, key, value) {
12
+ const root = typeof designRel === 'string' && designRel ? designRel : '.design';
13
+ const rel = normalizeOpenPath(activePath, root);
14
+ if (!rel || !/\.(tsx|jsx)$/.test(rel)) return null;
15
+ return {
16
+ file: `${root.replace(/^\.\//, '').replace(/\/$/, '')}/${rel}`,
17
+ patch: { [key]: value },
18
+ };
19
+ }
20
+
21
+ /** Canvas | Pages: `{ canvasView }`, or null. */
22
+ export function pagesPickBody(activePath, designRel, view) {
23
+ if (view !== 'canvas' && view !== 'pages') return null;
24
+ return pickBody(activePath, designRel, 'canvasView', view);
25
+ }
26
+
27
+ /** Light | Dark (canvas-theme.ts): `{ canvasTheme }`, or null. */
28
+ export function themePickBody(activePath, designRel, theme) {
29
+ if (theme !== 'light' && theme !== 'dark') return null;
30
+ return pickBody(activePath, designRel, 'canvasTheme', theme);
31
+ }
32
+
33
+ /** Write a pick (best-effort, like the camera: a refused write leaves the view as it is for this session). */
34
+ function save(body, doFetch) {
35
+ if (!body || typeof doFetch !== 'function') return null;
36
+ return Promise.resolve(
37
+ doFetch('/_api/canvas-meta', {
38
+ method: 'PATCH',
39
+ headers: { 'content-type': 'application/json' },
40
+ body: JSON.stringify(body),
41
+ })
42
+ ).catch(() => null);
43
+ }
44
+
45
+ export const savePagesPick = (activePath, designRel, view, doFetch = globalThis.fetch) =>
46
+ save(pagesPickBody(activePath, designRel, view), doFetch);
47
+
48
+ export const saveThemePick = (activePath, designRel, theme, doFetch = globalThis.fetch) =>
49
+ save(themePickBody(activePath, designRel, theme), doFetch);
@@ -0,0 +1,203 @@
1
+ // client/v2/shell/project-account-card.jsx — 2.0.5 W4: THIS project's account, opened from the avatar
2
+ // (your own face in the Share cluster) and from the account chip.
3
+ //
4
+ // PRESENTATIONAL. The words and the paths come from project-account-model.js; the host
5
+ // (share-cluster-host.jsx) runs them. Every button runs a registry action through `run(id)` or the
6
+ // kind's existing sign-out path through `onSignOut(path)` — and a row is drawn only where its path
7
+ // exists (a browser tab gets the facts and no button). Sign out asks first (CONTRACT §4).
8
+
9
+ import { useEffect, useRef, useState } from 'react';
10
+ import { onCanvasPointer } from './canvas-pointer.js';
11
+
12
+ /**
13
+ * The popover the card sits in, under the Share cluster's start. Esc, a press outside and a press in the
14
+ * canvas close it; a press on an opener (`data-account-opener` — your face, the account chip) is the
15
+ * opener's own toggle, so it is not an outside press.
16
+ */
17
+ export function ProjectAccountPopover({ open, onClose, children }) {
18
+ const wrap = useRef(null);
19
+ useEffect(() => {
20
+ if (!open) return undefined;
21
+ const onDown = (e) => {
22
+ const t = e.target;
23
+ if (wrap.current?.contains(t)) return;
24
+ if (t?.closest?.('[data-account-opener]')) return;
25
+ onClose();
26
+ };
27
+ const onKey = (e) => {
28
+ if (e.key === 'Escape') onClose();
29
+ };
30
+ document.addEventListener('pointerdown', onDown, true);
31
+ document.addEventListener('keydown', onKey);
32
+ const off = onCanvasPointer(() => onClose());
33
+ return () => {
34
+ document.removeEventListener('pointerdown', onDown, true);
35
+ document.removeEventListener('keydown', onKey);
36
+ off();
37
+ };
38
+ }, [open, onClose]);
39
+ if (!open) return null;
40
+ return (
41
+ <div className="sh-acct-card sh-pa-pop" role="dialog" aria-label="Account" ref={wrap}>
42
+ {children}
43
+ </div>
44
+ );
45
+ }
46
+
47
+ function Line({ k, testid, children }) {
48
+ if (!children) return null;
49
+ return (
50
+ <div className="sh-pa-line">
51
+ <span className="sh-pa-k">{k}</span>
52
+ <span className="sh-pa-v" data-testid={testid}>
53
+ {children}
54
+ </span>
55
+ </div>
56
+ );
57
+ }
58
+
59
+ /**
60
+ * @param account projectAccount()
61
+ * @param run (id) => void — the shell's runner (account.switch, account.github-signin)
62
+ * @param onSignOut (path) => Promise — 'cloud-signout' | 'hub-detach' | 'github-signout'
63
+ * @param onSwitch (spec) => void — a Switch with a `path` (W4b 'hub-switch'), not a registry id
64
+ * @param onClose () => void
65
+ */
66
+ export function ProjectAccountCard({ account, run, onSignOut, onSwitch, onClose }) {
67
+ const [asking, setAsking] = useState(null); // the signOut spec being confirmed
68
+ const [busy, setBusy] = useState(false);
69
+ if (!account) return null;
70
+ const gh = account.github;
71
+ const ghOut = gh?.canSignOut
72
+ ? {
73
+ path: 'github-signout',
74
+ label: `Sign out of GitHub (@${gh.login})…`,
75
+ confirm: {
76
+ title: `Sign out of @${gh.login}?`,
77
+ body: 'Every project on it is signed out of GitHub. Your work stays on this Mac.',
78
+ primary: 'Sign out',
79
+ cancel: 'Cancel',
80
+ },
81
+ }
82
+ : null;
83
+
84
+ const confirm = async () => {
85
+ const spec = asking;
86
+ setBusy(true);
87
+ try {
88
+ await onSignOut?.(spec.path);
89
+ } finally {
90
+ setBusy(false);
91
+ setAsking(null);
92
+ onClose?.();
93
+ }
94
+ };
95
+ const go = (id) => {
96
+ onClose?.();
97
+ run?.(id);
98
+ };
99
+
100
+ return (
101
+ <div className="sh-pa" data-testid="project-account">
102
+ <p className="sh-pa-h">This project’s account</p>
103
+ <Line k="Signed in with" testid="project-account-kind">
104
+ {account.kindLabel}
105
+ </Line>
106
+ <Line k="Account" testid="project-account-who">
107
+ {account.who}
108
+ </Line>
109
+ <Line k={account.kind === 'team' ? 'Server' : 'Project'} testid="project-account-where">
110
+ {account.where}
111
+ </Line>
112
+ <Line k="Profile on this Mac" testid="project-account-profile">
113
+ {account.profileLabel}
114
+ </Line>
115
+ {gh?.login && account.kind !== 'github' ? (
116
+ <Line k="GitHub" testid="project-account-github">
117
+ @{gh.login}
118
+ </Line>
119
+ ) : null}
120
+ {gh?.note ? (
121
+ <p className="sh-pa-note" data-testid="project-account-github-note">
122
+ {gh.note}
123
+ </p>
124
+ ) : null}
125
+
126
+ {asking ? (
127
+ <div className="sh-acct-ask" role="alertdialog" data-testid="project-account-confirm">
128
+ <strong>{asking.confirm.title}</strong>
129
+ <span>{asking.confirm.body}</span>
130
+ <span className="sh-acct-btns">
131
+ <button
132
+ type="button"
133
+ className="btn btn--sm"
134
+ data-testid="project-account-signout-cancel"
135
+ onClick={() => setAsking(null)}
136
+ >
137
+ {asking.confirm.cancel}
138
+ </button>
139
+ <button
140
+ type="button"
141
+ className="btn btn--sm btn--danger"
142
+ data-testid="project-account-signout-confirm"
143
+ disabled={busy}
144
+ onClick={confirm}
145
+ >
146
+ {asking.confirm.primary}
147
+ </button>
148
+ </span>
149
+ </div>
150
+ ) : (
151
+ <>
152
+ {account.switch || gh?.canSignIn || account.signOut || ghOut ? (
153
+ <hr className="sh-acct-sep" />
154
+ ) : null}
155
+ {account.switch ? (
156
+ <button
157
+ type="button"
158
+ className="sh-acct-act"
159
+ data-testid="project-account-switch"
160
+ onClick={() => {
161
+ if (!account.switch.path) return go(account.switch.id);
162
+ onClose?.();
163
+ onSwitch?.(account.switch);
164
+ }}
165
+ >
166
+ {account.switch.label}
167
+ </button>
168
+ ) : null}
169
+ {gh?.canSignIn ? (
170
+ <button
171
+ type="button"
172
+ className="sh-acct-act"
173
+ data-testid="project-account-github-signin"
174
+ onClick={() => go('account.github-signin')}
175
+ >
176
+ Sign in with GitHub…
177
+ </button>
178
+ ) : null}
179
+ {account.signOut ? (
180
+ <button
181
+ type="button"
182
+ className="sh-acct-act"
183
+ data-testid="project-account-signout"
184
+ onClick={() => setAsking(account.signOut)}
185
+ >
186
+ {account.signOut.label}
187
+ </button>
188
+ ) : null}
189
+ {ghOut ? (
190
+ <button
191
+ type="button"
192
+ className="sh-acct-act"
193
+ data-testid="project-account-github-signout"
194
+ onClick={() => setAsking(ghOut)}
195
+ >
196
+ {ghOut.label}
197
+ </button>
198
+ ) : null}
199
+ </>
200
+ )}
201
+ </div>
202
+ );
203
+ }