@1agh/maude 2.1.0 → 2.1.1

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 (100) hide show
  1. package/apps/studio/access/request.ts +1 -0
  2. package/apps/studio/actions/agents.ts +27 -0
  3. package/apps/studio/actions/defs/app.ts +28 -1
  4. package/apps/studio/actions/defs/sync.ts +4 -0
  5. package/apps/studio/actions.manifest.json +60 -2
  6. package/apps/studio/actions.parity.json +13 -1
  7. package/apps/studio/bin/_curl-local.mjs +7 -4
  8. package/apps/studio/client/app.jsx +16 -4
  9. package/apps/studio/client/home/HomeAccountsRow.jsx +221 -0
  10. package/apps/studio/client/home/HomeConnection.jsx +111 -0
  11. package/apps/studio/client/home/home-accounts-model.js +110 -1
  12. package/apps/studio/client/home/home-api.js +6 -2
  13. package/apps/studio/client/home/home-app.jsx +74 -12
  14. package/apps/studio/client/home/home-model.js +40 -1
  15. package/apps/studio/client/home/home-where-model.js +105 -0
  16. package/apps/studio/client/home/home.css +233 -1
  17. package/apps/studio/client/hooks/use-palette-and-panels.jsx +3 -1
  18. package/apps/studio/client/hooks/use-tabs.jsx +11 -4
  19. package/apps/studio/client/panels/TeamProjects.jsx +137 -134
  20. package/apps/studio/client/share-link.js +12 -0
  21. package/apps/studio/client/styles/_index.css +4 -0
  22. package/apps/studio/client/v2/diagnostics/diagnostics-host.jsx +1 -0
  23. package/apps/studio/client/v2/diagnostics/diagnostics-model.js +32 -2
  24. package/apps/studio/client/v2/diagnostics/diagnostics-sheet.jsx +35 -8
  25. package/apps/studio/client/v2/diagnostics/diagnostics.css +34 -0
  26. package/apps/studio/client/v2/diagnostics/sync-details/sync-details-model.js +94 -3
  27. package/apps/studio/client/v2/diagnostics/sync-details/sync-details.jsx +187 -4
  28. package/apps/studio/client/v2/link-server/LinkServerDialog.jsx +492 -0
  29. package/apps/studio/client/v2/link-server/LinkServerHost.jsx +42 -0
  30. package/apps/studio/client/v2/link-server/link-server-api.js +142 -0
  31. package/apps/studio/client/v2/link-server/link-server-model.js +438 -0
  32. package/apps/studio/client/v2/link-server/link-server.css +109 -0
  33. package/apps/studio/client/v2/onboarding/AdvancedSheets.jsx +31 -86
  34. package/apps/studio/client/v2/onboarding/onboarding-model.js +1 -18
  35. package/apps/studio/client/v2/search/search-keywords.js +3 -2
  36. package/apps/studio/client/v2/settings/account.jsx +4 -2
  37. package/apps/studio/client/v2/settings/advanced-section.jsx +245 -148
  38. package/apps/studio/client/v2/settings/connection-row.jsx +3 -59
  39. package/apps/studio/client/v2/settings/connections-section.jsx +118 -425
  40. package/apps/studio/client/v2/settings/general-section.jsx +138 -43
  41. package/apps/studio/client/v2/settings/project-sync-settings.jsx +4 -3
  42. package/apps/studio/client/v2/settings/reset-section.jsx +14 -3
  43. package/apps/studio/client/v2/settings/settings-card.jsx +142 -0
  44. package/apps/studio/client/v2/settings/settings-cards.js +220 -0
  45. package/apps/studio/client/v2/settings/settings-handlers.js +7 -6
  46. package/apps/studio/client/v2/settings/settings-model.js +91 -31
  47. package/apps/studio/client/v2/settings/settings-sheet.jsx +25 -6
  48. package/apps/studio/client/v2/settings/settings.css +374 -64
  49. package/apps/studio/client/v2/settings/this-project-card.jsx +730 -0
  50. package/apps/studio/client/v2/settings/this-project-model.js +172 -0
  51. package/apps/studio/client/v2/settings/use-connections.js +3 -2
  52. package/apps/studio/client/v2/settings/use-open-card.js +37 -0
  53. package/apps/studio/client/v2/shell/connection-state.js +197 -0
  54. package/apps/studio/client/v2/shell/menu-runner.js +7 -2
  55. package/apps/studio/client/v2/shell/project-account-bus.js +36 -0
  56. package/apps/studio/client/v2/shell/project-account-card.jsx +357 -148
  57. package/apps/studio/client/v2/shell/project-account-model.js +272 -149
  58. package/apps/studio/client/v2/shell/project-account-toast.js +66 -0
  59. package/apps/studio/client/v2/shell/project-account.css +237 -0
  60. package/apps/studio/client/v2/shell/share-cluster-host.jsx +166 -83
  61. package/apps/studio/client/v2/shell/shell-parity.js +3 -2
  62. package/apps/studio/client/v2/shell/shell-parity.json +40 -26
  63. package/apps/studio/client/v2/shell/use-account.js +2 -0
  64. package/apps/studio/client/v2/signin/use-signin.js +1 -1
  65. package/apps/studio/cloud/endpoints.ts +29 -4
  66. package/apps/studio/dist/client.bundle.js +834 -834
  67. package/apps/studio/dist/styles.css +1 -1
  68. package/apps/studio/home/accounts.ts +30 -11
  69. package/apps/studio/home/cloud.ts +6 -1
  70. package/apps/studio/home/hub-health.ts +76 -0
  71. package/apps/studio/home/routes.ts +9 -3
  72. package/apps/studio/http.ts +8 -0
  73. package/apps/studio/migrate/hub.ts +8 -1
  74. package/apps/studio/routes/hub-link-folder.ts +334 -0
  75. package/apps/studio/routes/hub-signin.ts +78 -1
  76. package/apps/studio/routes/index.ts +4 -0
  77. package/apps/studio/routes/sync.ts +22 -4
  78. package/apps/studio/shell/api-key.ts +11 -0
  79. package/apps/studio/sync/accepted-cold-start.ts +144 -8
  80. package/apps/studio/sync/action-stage.ts +18 -1
  81. package/apps/studio/sync/ctl-heal.ts +58 -0
  82. package/apps/studio/sync/file-ledger.ts +38 -4
  83. package/apps/studio/sync/file-plane.ts +226 -19
  84. package/apps/studio/sync/held-deletes.ts +86 -5
  85. package/apps/studio/sync/hub-link.ts +8 -0
  86. package/apps/studio/sync/index.ts +68 -4
  87. package/apps/studio/sync/link-consent.ts +22 -75
  88. package/apps/studio/sync/link-survey.ts +252 -0
  89. package/apps/studio/sync/local-kernel.ts +16 -1
  90. package/apps/studio/sync/seed-progress.ts +12 -0
  91. package/apps/studio/sync/source-recovery.ts +18 -2
  92. package/apps/studio/sync/status.ts +11 -1
  93. package/apps/studio/sync/writer-registry.ts +5 -0
  94. package/apps/studio/whats-new.json +18 -0
  95. package/cli/lib/bash-guard.mjs +19 -0
  96. package/cli/lib/design-help.gen.mjs +1 -1
  97. package/package.json +9 -8
  98. package/apps/studio/client/v2/onboarding/HubSheet.jsx +0 -212
  99. package/apps/studio/client/v2/shell/account-card-model.js +0 -114
  100. package/apps/studio/client/v2/shell/account-card.jsx +0 -189
@@ -959,7 +959,7 @@
959
959
  }
960
960
  .home-prow-t {
961
961
  flex: 1;
962
- min-width: 0;
962
+ min-width: 96px;
963
963
  display: flex;
964
964
  flex-direction: column;
965
965
  gap: 1px;
@@ -1832,6 +1832,238 @@
1832
1832
  background: var(--object-coral);
1833
1833
  }
1834
1834
 
1835
+ /* 2.1.1 B4 (artboard 14): accounts row, the Where chip and the connection badge */
1836
+ .home-face--lg {
1837
+ width: 32px;
1838
+ height: 32px;
1839
+ font-size: var(--type-base);
1840
+ }
1841
+ .home-acr-cards {
1842
+ display: grid;
1843
+ grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
1844
+ gap: var(--space-3);
1845
+ }
1846
+ .home-acr-add {
1847
+ position: relative;
1848
+ }
1849
+ .home-acr-menu {
1850
+ position: absolute;
1851
+ top: calc(100% + var(--space-1));
1852
+ right: 0;
1853
+ z-index: 5;
1854
+ display: flex;
1855
+ flex-direction: column;
1856
+ min-width: 220px;
1857
+ padding: var(--space-1);
1858
+ }
1859
+ .home-acc {
1860
+ display: flex;
1861
+ align-items: center;
1862
+ gap: var(--space-3);
1863
+ min-width: 0;
1864
+ padding: var(--space-3);
1865
+ border-radius: var(--radius-lg);
1866
+ background: var(--bg-1);
1867
+ box-shadow:
1868
+ var(--shadow-sm),
1869
+ inset 0 0 0 0.5px var(--border-default);
1870
+ }
1871
+ .home-acc--bad {
1872
+ background: var(--status-error-soft);
1873
+ }
1874
+ .home-acc-t {
1875
+ flex: 1;
1876
+ min-width: 0;
1877
+ display: flex;
1878
+ flex-direction: column;
1879
+ gap: 1px;
1880
+ }
1881
+ .home-acc-t strong {
1882
+ font-size: var(--type-sm);
1883
+ font-weight: var(--w-semibold);
1884
+ overflow: hidden;
1885
+ text-overflow: ellipsis;
1886
+ white-space: nowrap;
1887
+ }
1888
+ .home-acc-t > span:not(.home-sw) {
1889
+ font-size: var(--type-xs);
1890
+ color: var(--fg-2);
1891
+ white-space: nowrap;
1892
+ overflow: hidden;
1893
+ text-overflow: ellipsis;
1894
+ }
1895
+ .home-acc .btn {
1896
+ flex: none;
1897
+ white-space: nowrap;
1898
+ }
1899
+ /* an account's face with the connection on it */
1900
+ .home-acf {
1901
+ position: relative;
1902
+ display: inline-grid;
1903
+ flex: none;
1904
+ }
1905
+ .home-acf-tile {
1906
+ display: grid;
1907
+ place-items: center;
1908
+ border-radius: var(--radius-md);
1909
+ }
1910
+ .home-acf-tile--sm {
1911
+ width: 16px;
1912
+ height: 16px;
1913
+ border-radius: var(--radius-xs);
1914
+ }
1915
+ .home-acf-tile--md {
1916
+ width: 24px;
1917
+ height: 24px;
1918
+ }
1919
+ .home-acf-tile--lg {
1920
+ width: 32px;
1921
+ height: 32px;
1922
+ }
1923
+ .home-acf-tile--server {
1924
+ background: var(--object-green);
1925
+ color: var(--object-ink);
1926
+ }
1927
+ .home-acf-tile--local {
1928
+ background: var(--bg-3);
1929
+ color: var(--fg-1);
1930
+ box-shadow: inset 0 0 0 0.5px var(--border-default);
1931
+ }
1932
+ .home-acf[data-conn="offline"] .home-face,
1933
+ .home-acf[data-conn="offline"] .home-acf-tile {
1934
+ background: var(--bg-4);
1935
+ color: var(--fg-2);
1936
+ }
1937
+ .home-acf-ring {
1938
+ position: absolute;
1939
+ inset: -3px;
1940
+ border-radius: var(--radius-pill);
1941
+ box-shadow: inset 0 0 0 2px transparent;
1942
+ border: 2px solid var(--status-info);
1943
+ border-right-color: transparent;
1944
+ border-bottom-color: transparent;
1945
+ animation: home-acf-spin 1.2s linear infinite;
1946
+ }
1947
+ @keyframes home-acf-spin {
1948
+ to {
1949
+ transform: rotate(360deg);
1950
+ }
1951
+ }
1952
+ .home-acf-badge {
1953
+ position: absolute;
1954
+ right: -5px;
1955
+ bottom: -5px;
1956
+ display: grid;
1957
+ place-items: center;
1958
+ width: 16px;
1959
+ height: 16px;
1960
+ border-radius: var(--radius-pill);
1961
+ box-shadow: 0 0 0 1.5px var(--bg-1);
1962
+ font-size: var(--type-xs);
1963
+ font-weight: var(--w-semibold);
1964
+ line-height: 1;
1965
+ }
1966
+ .home-acf--sm .home-acf-badge {
1967
+ width: 12px;
1968
+ height: 12px;
1969
+ right: -4px;
1970
+ bottom: -4px;
1971
+ font-size: var(--type-xs);
1972
+ }
1973
+ .home-acf--lg .home-acf-badge {
1974
+ width: 20px;
1975
+ height: 20px;
1976
+ right: -6px;
1977
+ bottom: -6px;
1978
+ }
1979
+ .home-acf-badge--bad {
1980
+ background: var(--status-error);
1981
+ color: var(--status-error-fg);
1982
+ }
1983
+ .home-acf-badge--warn {
1984
+ background: var(--status-warn);
1985
+ color: var(--status-warn-fg);
1986
+ }
1987
+ /* the state as a word with its dot */
1988
+ .home-sw {
1989
+ display: inline-flex;
1990
+ align-items: center;
1991
+ gap: var(--space-1);
1992
+ font-size: var(--type-xs);
1993
+ color: var(--fg-1);
1994
+ white-space: nowrap;
1995
+ }
1996
+ .home-sw > i {
1997
+ flex: none;
1998
+ width: 6px;
1999
+ height: 6px;
2000
+ border-radius: var(--radius-pill);
2001
+ background: var(--fg-2);
2002
+ }
2003
+ .home-sw[data-tone="ok"] > i {
2004
+ background: var(--status-success);
2005
+ }
2006
+ .home-sw[data-tone="bad"] > i {
2007
+ background: var(--status-error);
2008
+ }
2009
+ .home-sw[data-tone="warn"] > i {
2010
+ background: var(--status-warn);
2011
+ }
2012
+ .home-sw[data-tone="busy"] > i {
2013
+ background: var(--status-info);
2014
+ }
2015
+ /* a project row: Where · Connection */
2016
+ .home-prow-where {
2017
+ flex: 0 1 300px;
2018
+ min-width: 120px;
2019
+ display: flex;
2020
+ }
2021
+ .home-prow-st {
2022
+ flex: 0 1 190px;
2023
+ min-width: 110px;
2024
+ display: inline-flex;
2025
+ align-items: center;
2026
+ gap: var(--space-2);
2027
+ }
2028
+ .home-where {
2029
+ display: flex;
2030
+ align-items: center;
2031
+ gap: var(--space-2);
2032
+ min-width: 0;
2033
+ }
2034
+ .home-place {
2035
+ display: inline-flex;
2036
+ align-items: center;
2037
+ gap: var(--space-1);
2038
+ max-width: 100%;
2039
+ height: 22px;
2040
+ padding: 0 var(--space-2);
2041
+ border-radius: var(--radius-sm);
2042
+ background: var(--bg-3);
2043
+ font-size: var(--type-xs);
2044
+ font-weight: var(--w-medium);
2045
+ color: var(--fg-1);
2046
+ white-space: nowrap;
2047
+ overflow: hidden;
2048
+ }
2049
+ .home-place > span {
2050
+ overflow: hidden;
2051
+ text-overflow: ellipsis;
2052
+ }
2053
+ .home-place > svg {
2054
+ flex: none;
2055
+ color: var(--fg-2);
2056
+ }
2057
+ .home-where-path {
2058
+ min-width: 0;
2059
+ overflow: hidden;
2060
+ text-overflow: ellipsis;
2061
+ white-space: nowrap;
2062
+ font-family: var(--font-mono);
2063
+ font-size: var(--type-xs);
2064
+ color: var(--fg-2);
2065
+ }
2066
+
1835
2067
  @media (prefers-reduced-motion: reduce) {
1836
2068
  .home-root *,
1837
2069
  .home-root *::before,
@@ -28,6 +28,7 @@ import { useLayersTreeRequest } from '../v2/layers/layers-request.js';
28
28
  import { bindPaletteEnv, sendToAskAI } from '../v2/search/search-env.js';
29
29
  import { desktopProjectsEnv } from '../v2/search/search-projects.js';
30
30
  import { actionSearchRows, settingsSearchRows } from '../v2/search/search-model.js';
31
+ import { settingsTarget } from '../v2/settings/settings-cards.js';
31
32
  import { isNativeApp, onMenuAction } from '../github.js';
32
33
  import { DOCK_PANELS, PANEL_SIDES_DEFAULTS } from '../shell/dock.jsx';
33
34
  import { EMPTY_GROUPS, SYSTEM_TAB } from '../shell/constants.js';
@@ -439,7 +440,8 @@ export function usePaletteAndPanels({
439
440
  ...settingsSearchRows({
440
441
  cloud: cfg.cloud,
441
442
  readOnly: viewerMode,
442
- run: (section) => setSettingsOpen(section),
443
+ // 2.1.1 T6: the tab AND the card that holds the row ("advanced#privacy"), so a closed card opens
444
+ run: (section, row) => setSettingsOpen(settingsTarget(section, row)),
443
445
  }),
444
446
  // S10.13 — the Design system and everything in it by name (a converted system opens its canvas, an
445
447
  // older one its v1 view)
@@ -3,7 +3,13 @@
3
3
  import { useCallback, useEffect, useRef, useState } from 'react';
4
4
  import { CANVAS_EXT_RE, SYSTEM_TAB } from '../shell/constants.js';
5
5
  import { remapDirPrefix, revealPath } from '../tree-expansion.js';
6
- import { buildShareLinks, normalizeOpenPath, readOpenParam, withOpenParam } from '../share-link.js';
6
+ import {
7
+ buildShareLinks,
8
+ normalizeOpenPath,
9
+ readOpenParam,
10
+ shareTargetFor,
11
+ withOpenParam,
12
+ } from '../share-link.js';
7
13
  import { basename, displayName, previewKind, shellToast } from '../shell/util.js';
8
14
  import { assembleVideoFlow } from '../v2/timeline/assemble-video.js';
9
15
  import { notify } from '../../notifications.tsx';
@@ -205,9 +211,10 @@ export function useTabs({
205
211
  localUrl: location.origin,
206
212
  readOnly: !!cfg.readOnly,
207
213
  });
208
- const showShare = (path = sharePath) => {
209
- const rel = normalizeOpenPath(path, cfg.designRel);
210
- if (rel) setShareDialog({ path, rel, label: basename(path) });
214
+ // `{ project: true }` (Move to Maude Cloud, Connect): the project's sheet when no canvas is open
215
+ const showShare = (path = sharePath, opts) => {
216
+ const target = shareTargetFor(path, cfg.designRel, opts);
217
+ if (target) setShareDialog(target);
211
218
  };
212
219
 
213
220
  // Retry from the #115 error panel: re-read /_config FIRST (the stale
@@ -33,6 +33,8 @@ import {
33
33
  openTeamServerSignIn,
34
34
  } from '../github.js';
35
35
  import { reasonProps } from '../v2/access/disabled-reason.js';
36
+ import { projectLinkApi } from '../v2/link-server/link-server-api.js';
37
+ import { LinkServerDialog } from '../v2/link-server/LinkServerDialog.jsx';
36
38
  import { SIGNIN_WORDS } from '../v2/signin/signin-model.js';
37
39
 
38
40
  const api = async (path, init) => {
@@ -149,10 +151,9 @@ function ErrorLine({ text }) {
149
151
  );
150
152
  }
151
153
 
152
- // `serverOnly` (V2-4.7a): Settings › Connections › “Add a team server…” opens just the address +
153
- // Sign in (issue #204: the server's own page signs you in) — the recents and the cloud list have their own homes. The same form,
154
- // the same handler, the same consent path (opening a project still goes through the switch).
155
- export default function TeamProjects({ variant = 'door', initialServer = '', serverOnly = false }) {
154
+ // 2.1.1 T5: Settings' “Add a team server…” (the old `serverOnly` form) is the one "Link your server" dialog
155
+ // now (v2/link-server/) — `TeamProjectsDialog serverOnly` hands over to it below.
156
+ export default function TeamProjects({ variant = 'door', initialServer = '' }) {
156
157
  const [recents, setRecents] = useState(null);
157
158
  const [cloud, setCloud] = useState({
158
159
  state: 'loading',
@@ -367,7 +368,7 @@ export default function TeamProjects({ variant = 'door', initialServer = '', ser
367
368
  </div>
368
369
  )}
369
370
 
370
- {!serverOnly && recents && recents.length > 0 && (
371
+ {recents && recents.length > 0 && (
371
372
  <section className="tp-section" aria-label="Recent team projects">
372
373
  <div className="ob-section-label">On this computer</div>
373
374
  <div className="ob-repolist">
@@ -405,142 +406,140 @@ export default function TeamProjects({ variant = 'door', initialServer = '', ser
405
406
  </section>
406
407
  )}
407
408
 
408
- {!serverOnly && (
409
- <section className="tp-section" aria-label="Maude Cloud">
410
- <div className="ob-section-label">Maude Cloud</div>
411
- {cloud.state === 'loading' && <div className="ob-foot-note">Checking your sign-in…</div>}
412
- {cloud.state === 'out' && !device && (
413
- <button
414
- type="button"
415
- className="ob-repo"
416
- onClick={startCloudSignIn}
417
- data-testid="team-cloud-signin"
418
- >
419
- <span className="ob-repo-icon">
420
- <Spark size={15} />
409
+ <section className="tp-section" aria-label="Maude Cloud">
410
+ <div className="ob-section-label">Maude Cloud</div>
411
+ {cloud.state === 'loading' && <div className="ob-foot-note">Checking your sign-in…</div>}
412
+ {cloud.state === 'out' && !device && (
413
+ <button
414
+ type="button"
415
+ className="ob-repo"
416
+ onClick={startCloudSignIn}
417
+ data-testid="team-cloud-signin"
418
+ >
419
+ <span className="ob-repo-icon">
420
+ <Spark size={15} />
421
+ </span>
422
+ <span className="ob-repo-tx">
423
+ <span className="ob-repo-name">Sign in to Maude Cloud</span>
424
+ <span className="ob-repo-meta">See the projects you were invited to</span>
425
+ </span>
426
+ <span className="ob-repo-go">
427
+ <Icon name="arrow-right" size={15} /> Sign in
428
+ </span>
429
+ </button>
430
+ )}
431
+ {device && (
432
+ <div className="tp-device" data-testid="team-cloud-device">
433
+ <span className="ob-field-label">{SIGNIN_WORDS.codeCheck}</span>
434
+ <div className="gi-code">
435
+ <span className="gi-code-val" data-testid="team-cloud-code">
436
+ {device.userCode}
421
437
  </span>
422
- <span className="ob-repo-tx">
423
- <span className="ob-repo-name">Sign in to Maude Cloud</span>
424
- <span className="ob-repo-meta">See the projects you were invited to</span>
438
+ <button
439
+ type="button"
440
+ className="btn btn--ghost gi-code-copy"
441
+ onClick={() =>
442
+ navigator.clipboard?.writeText(device.userCode).then(
443
+ () => {
444
+ setCopied(true);
445
+ setTimeout(() => setCopied(false), 1500);
446
+ },
447
+ () => {}
448
+ )
449
+ }
450
+ aria-label="Copy the code"
451
+ >
452
+ <Icon name="copy" size={15} /> {copied ? 'Copied' : 'Copy'}
453
+ </button>
454
+ </div>
455
+ {device.verificationUrl && isDisplayableUrl(device.verificationUrl, cloud.url) && (
456
+ <span className="ob-foot-note">
457
+ If your browser didn’t open, go to{' '}
458
+ <span className="gi-dc-url">{device.verificationUrl}</span>
425
459
  </span>
426
- <span className="ob-repo-go">
427
- <Icon name="arrow-right" size={15} /> Sign in
460
+ )}
461
+ <div className="ob-form-actions">
462
+ <span className="gi-dc-status" aria-live="polite">
463
+ <span className="gi-pulse" aria-hidden="true" /> Waiting for you to confirm…
428
464
  </span>
429
- </button>
430
- )}
431
- {device && (
432
- <div className="tp-device" data-testid="team-cloud-device">
433
- <span className="ob-field-label">{SIGNIN_WORDS.codeCheck}</span>
434
- <div className="gi-code">
435
- <span className="gi-code-val" data-testid="team-cloud-code">
436
- {device.userCode}
437
- </span>
438
- <button
439
- type="button"
440
- className="btn btn--ghost gi-code-copy"
441
- onClick={() =>
442
- navigator.clipboard?.writeText(device.userCode).then(
443
- () => {
444
- setCopied(true);
445
- setTimeout(() => setCopied(false), 1500);
446
- },
447
- () => {}
448
- )
449
- }
450
- aria-label="Copy the code"
451
- >
452
- <Icon name="copy" size={15} /> {copied ? 'Copied' : 'Copy'}
453
- </button>
454
- </div>
455
- {device.verificationUrl && isDisplayableUrl(device.verificationUrl, cloud.url) && (
456
- <span className="ob-foot-note">
457
- If your browser didn’t open, go to{' '}
458
- <span className="gi-dc-url">{device.verificationUrl}</span>
459
- </span>
460
- )}
461
- <div className="ob-form-actions">
462
- <span className="gi-dc-status" aria-live="polite">
463
- <span className="gi-pulse" aria-hidden="true" /> Waiting for you to confirm…
464
- </span>
465
- <button type="button" className="btn btn--ghost" onClick={cancelCloudSignIn}>
466
- Cancel
467
- </button>
468
- </div>
465
+ <button type="button" className="btn btn--ghost" onClick={cancelCloudSignIn}>
466
+ Cancel
467
+ </button>
469
468
  </div>
470
- )}
471
- {cloud.state === 'in' && (
472
- <>
473
- {projects === null && <div className="ob-foot-note">Loading your projects…</div>}
474
- {Array.isArray(projects) && projects.length === 0 && (
475
- <div className="ob-foot-note" data-testid="team-cloud-empty">
476
- You aren’t in any project yet. Ask whoever runs your team’s project to invite{' '}
477
- {cloud.email || 'you'}.
478
- </div>
479
- )}
480
- {Array.isArray(projects) && projects.length > 0 && (
481
- <div className="ob-repolist">
482
- {projects.map((p) => {
483
- const k = `cloud:${p.id}`;
484
- if (p.role === 'viewer') {
485
- return (
486
- <button
487
- type="button"
488
- key={p.id}
489
- className="ob-repo"
490
- onClick={() => openExternal(shareViewUrl(p.url, p.id))}
491
- data-testid={`team-cloud-project-${p.id}`}
492
- title="Viewing works in the browser. Editing in the app needs the member role — ask whoever runs the project."
493
- >
494
- <span className="ob-repo-icon">
495
- <Icon name="globe" size={15} />
496
- </span>
497
- <span className="ob-repo-tx">
498
- <span className="ob-repo-name">{p.name || p.id}</span>
499
- <span className="ob-repo-meta">viewer · opens in your browser</span>
500
- </span>
501
- <span className="ob-repo-go">
502
- <Icon name="external" size={15} /> View
503
- </span>
504
- </button>
505
- );
506
- }
469
+ </div>
470
+ )}
471
+ {cloud.state === 'in' && (
472
+ <>
473
+ {projects === null && <div className="ob-foot-note">Loading your projects…</div>}
474
+ {Array.isArray(projects) && projects.length === 0 && (
475
+ <div className="ob-foot-note" data-testid="team-cloud-empty">
476
+ You aren’t in any project yet. Ask whoever runs your team’s project to invite{' '}
477
+ {cloud.email || 'you'}.
478
+ </div>
479
+ )}
480
+ {Array.isArray(projects) && projects.length > 0 && (
481
+ <div className="ob-repolist">
482
+ {projects.map((p) => {
483
+ const k = `cloud:${p.id}`;
484
+ if (p.role === 'viewer') {
507
485
  return (
508
486
  <button
509
487
  type="button"
510
488
  key={p.id}
511
489
  className="ob-repo"
512
- disabled={!!busy}
513
- onClick={() => openCloud(p)}
490
+ onClick={() => openExternal(shareViewUrl(p.url, p.id))}
514
491
  data-testid={`team-cloud-project-${p.id}`}
492
+ title="Viewing works in the browser. Editing in the app needs the member role — ask whoever runs the project."
515
493
  >
516
494
  <span className="ob-repo-icon">
517
- <Spark size={15} />
495
+ <Icon name="globe" size={15} />
518
496
  </span>
519
497
  <span className="ob-repo-tx">
520
498
  <span className="ob-repo-name">{p.name || p.id}</span>
521
- <span className="ob-repo-meta">
522
- {p.role}
523
- {p.stateLabel ? ` · ${p.stateLabel}` : ''}
524
- </span>
499
+ <span className="ob-repo-meta">viewer · opens in your browser</span>
525
500
  </span>
526
501
  <span className="ob-repo-go">
527
- {busy === k ? (
528
- <Icon name="spinner" size={16} className="ob-spin" />
529
- ) : (
530
- <>
531
- <Icon name="arrow-right" size={15} /> Open
532
- </>
533
- )}
502
+ <Icon name="external" size={15} /> View
534
503
  </span>
535
504
  </button>
536
505
  );
537
- })}
538
- </div>
539
- )}
540
- </>
541
- )}
542
- </section>
543
- )}
506
+ }
507
+ return (
508
+ <button
509
+ type="button"
510
+ key={p.id}
511
+ className="ob-repo"
512
+ disabled={!!busy}
513
+ onClick={() => openCloud(p)}
514
+ data-testid={`team-cloud-project-${p.id}`}
515
+ >
516
+ <span className="ob-repo-icon">
517
+ <Spark size={15} />
518
+ </span>
519
+ <span className="ob-repo-tx">
520
+ <span className="ob-repo-name">{p.name || p.id}</span>
521
+ <span className="ob-repo-meta">
522
+ {p.role}
523
+ {p.stateLabel ? ` · ${p.stateLabel}` : ''}
524
+ </span>
525
+ </span>
526
+ <span className="ob-repo-go">
527
+ {busy === k ? (
528
+ <Icon name="spinner" size={16} className="ob-spin" />
529
+ ) : (
530
+ <>
531
+ <Icon name="arrow-right" size={15} /> Open
532
+ </>
533
+ )}
534
+ </span>
535
+ </button>
536
+ );
537
+ })}
538
+ </div>
539
+ )}
540
+ </>
541
+ )}
542
+ </section>
544
543
 
545
544
  <section className="tp-section" aria-label="Your team's server">
546
545
  <div className="ob-section-label">Your team’s own server</div>
@@ -622,13 +621,21 @@ export default function TeamProjects({ variant = 'door', initialServer = '', ser
622
621
  );
623
622
  }
624
623
 
625
- /** The same picker as a dialog — from the project switcher. */
626
- export function TeamProjectsDialog({
627
- onClose,
628
- initialServer = '',
629
- title = 'Open a team project',
630
- serverOnly = false,
631
- }) {
624
+ /** The same picker as a dialog — from the project switcher. `serverOnly` (Settings' “Add a team server…”)
625
+ * is the one "Link your server" dialog since 2.1.1 T5. */
626
+ export function TeamProjectsDialog(props) {
627
+ if (props.serverOnly)
628
+ return (
629
+ <LinkServerDialog
630
+ api={projectLinkApi()}
631
+ initialUrl={props.initialServer || ''}
632
+ onClose={props.onClose}
633
+ />
634
+ );
635
+ return <TeamProjectsPicker {...props} />;
636
+ }
637
+
638
+ function TeamProjectsPicker({ onClose, initialServer = '', title = 'Open a team project' }) {
632
639
  const ref = useRef(null);
633
640
  useEffect(() => {
634
641
  const prev = document.activeElement;
@@ -649,11 +656,7 @@ export function TeamProjectsDialog({
649
656
  <div className="tp-dialog-head">
650
657
  <div>
651
658
  <h2 id="tp-dialog-title">{title}</h2>
652
- <p>
653
- {serverOnly
654
- ? 'Sign in to your team’s own server. Its projects open in their own copy on this computer.'
655
- : 'Projects you were added to open in their own copy on this computer.'}
656
- </p>
659
+ <p>Projects you were added to open in their own copy on this computer.</p>
657
660
  </div>
658
661
  <button
659
662
  type="button"
@@ -665,7 +668,7 @@ export function TeamProjectsDialog({
665
668
  <Icon name="x" size={14} />
666
669
  </button>
667
670
  </div>
668
- <TeamProjects variant="dialog" initialServer={initialServer} serverOnly={serverOnly} />
671
+ <TeamProjects variant="dialog" initialServer={initialServer} />
669
672
  </div>
670
673
  </div>
671
674
  );
@@ -14,6 +14,18 @@ export function normalizeOpenPath(raw, designRel = '.design') {
14
14
  return rel.split('/').some((s) => s === '' || s === '.' || s === '..') ? null : rel;
15
15
  }
16
16
 
17
+ /**
18
+ * What the Share sheet opens on: the canvas at `path`, or — with no canvas — nothing, unless the ask is about the
19
+ * PROJECT (`{ project: true }`: Move to Maude Cloud, Connect), which gets the project's own sheet (2.1.1 T7: from
20
+ * Diagnostics › Sync with no canvas open, "Create project on Maude Cloud" did nothing).
21
+ * @returns {{ path: string, rel: string|null, label: string } | null}
22
+ */
23
+ export function shareTargetFor(path, designRel = '.design', opts = {}) {
24
+ const rel = normalizeOpenPath(path, designRel);
25
+ if (rel) return { path, rel, label: path.split('/').pop() || path };
26
+ return opts?.project ? { path: '', rel: null, label: '' } : null;
27
+ }
28
+
17
29
  /** Decode a URL value exactly once, then validate. */
18
30
  export function normalizeOpenParam(raw, designRel = '.design') {
19
31
  if (typeof raw !== 'string') return null;
@@ -64,6 +64,8 @@
64
64
  @import url("../v2/present/video-present.css");
65
65
  /* V2-4.3a — the Share cluster, top-right. */
66
66
  @import url("../v2/shell/share-cluster.css");
67
+ /* 2.1.1 T2/T4 — the account chip face, the avatar menu and Switch account. */
68
+ @import url("../v2/shell/project-account.css");
67
69
  /* S3.9 - Preview's own islands: the PreviewBar and the zoom readout. */
68
70
  @import url("../v2/preview/preview.css");
69
71
  /* S8.2 — the Export sheet (client/v2/export/). */
@@ -184,6 +186,8 @@
184
186
  @import url("../v2/signin/signin.css");
185
187
  /* S6.9 — the five Advanced sheets: hub, folder or GitHub, Connect AI, the maude command, Figma (client/v2/onboarding/). */
186
188
  @import url("../v2/onboarding/onboarding.css");
189
+ /* 2.1.1 T5 — the one "Link your server" dialog (client/v2/link-server/). */
190
+ @import url("../v2/link-server/link-server.css");
187
191
  @import url("./5-utilities.css");
188
192
  /* S3.7a — the Present follower page (follow bar, Live, watching; the audience window has no chrome). */
189
193
  @import url("../v2/present/follow.css");