@1agh/maude 2.1.1 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/apps/studio/actions/agents.ts +18 -42
  2. package/apps/studio/actions/verbs.ts +49 -0
  3. package/apps/studio/actions.manifest.json +103 -19
  4. package/apps/studio/ai/create-claim.ts +1 -1
  5. package/apps/studio/bin/_asset-file.mjs +117 -0
  6. package/apps/studio/bin/_canvas-file.mjs +146 -0
  7. package/apps/studio/bin/_footage.mjs +123 -0
  8. package/apps/studio/bin/_pdf-playwright.mjs +14 -0
  9. package/apps/studio/bin/_png-playwright.mjs +15 -1
  10. package/apps/studio/bin/_pw-launch.mjs +98 -0
  11. package/apps/studio/bin/_retry-save.mjs +49 -0
  12. package/apps/studio/bin/_sync.mjs +145 -2
  13. package/apps/studio/bin/asset-rename.sh +12 -0
  14. package/apps/studio/bin/asset-trash.sh +12 -0
  15. package/apps/studio/bin/canvas-move.sh +12 -0
  16. package/apps/studio/bin/canvas-new.sh +12 -0
  17. package/apps/studio/bin/footage.sh +12 -0
  18. package/apps/studio/bin/generate.sh +7 -0
  19. package/apps/studio/bin/retry-save.sh +13 -0
  20. package/apps/studio/bridge/canvas-mode-store.ts +11 -2
  21. package/apps/studio/bridge/dgn-protocol.ts +8 -3
  22. package/apps/studio/bridge/occlusion.ts +45 -0
  23. package/apps/studio/canvas-theme-pill.tsx +182 -38
  24. package/apps/studio/client/export-center.jsx +32 -3
  25. package/apps/studio/client/home/HomeAccountBanner.jsx +61 -0
  26. package/apps/studio/client/home/HomeAccountsChip.jsx +404 -0
  27. package/apps/studio/client/home/HomeConnection.jsx +4 -3
  28. package/apps/studio/client/home/ProjectRows.jsx +514 -0
  29. package/apps/studio/client/home/home-accounts-model.js +148 -99
  30. package/apps/studio/client/home/home-api.js +4 -0
  31. package/apps/studio/client/home/home-app.jsx +127 -432
  32. package/apps/studio/client/home/home-icons.jsx +8 -0
  33. package/apps/studio/client/home/home-model.js +109 -0
  34. package/apps/studio/client/home/home.css +447 -111
  35. package/apps/studio/client/home/use-account-fix.js +123 -0
  36. package/apps/studio/client/v2/assets/generate-ask.jsx +3 -1
  37. package/apps/studio/client/v2/export/done-toast.jsx +2 -5
  38. package/apps/studio/client/v2/export/export-sheet.jsx +9 -2
  39. package/apps/studio/client/v2/export/export.css +9 -0
  40. package/apps/studio/client/v2/export/exports-model.js +16 -3
  41. package/apps/studio/client/v2/export/file-rows.jsx +81 -5
  42. package/apps/studio/client/v2/export/native-save.js +33 -0
  43. package/apps/studio/client/v2/export/sections/print-copy.js +3 -0
  44. package/apps/studio/client/v2/export/sections/print.jsx +37 -20
  45. package/apps/studio/client/v2/shell/occlusion-insets.js +37 -9
  46. package/apps/studio/client/v2/shell/use-occluded-insets.js +13 -3
  47. package/apps/studio/collab/room.ts +21 -7
  48. package/apps/studio/dist/client.bundle.js +692 -692
  49. package/apps/studio/dist/comment-mount.js +2 -2
  50. package/apps/studio/dist/styles.css +1 -1
  51. package/apps/studio/exporters/ghostscript.ts +78 -1
  52. package/apps/studio/exporters/pdf-fonts.ts +31 -4
  53. package/apps/studio/generation/jobs.ts +6 -0
  54. package/apps/studio/http.ts +6 -2
  55. package/apps/studio/routes/agent.ts +6 -2
  56. package/apps/studio/routes/project-undo.ts +10 -0
  57. package/apps/studio/server.ts +25 -0
  58. package/apps/studio/shell/cli-yield.ts +48 -11
  59. package/apps/studio/whats-new.json +18 -0
  60. package/cli/commands/design.mjs +74 -16
  61. package/cli/lib/bash-guard.mjs +4 -4
  62. package/cli/lib/confine-read.mjs +2 -0
  63. package/cli/lib/design-help.gen.mjs +15 -2
  64. package/cli/lib/design-hook.mjs +1 -1
  65. package/cli/lib/desktop-locate.mjs +36 -8
  66. package/cli/lib/studio-locate.mjs +8 -2
  67. package/cli/lib/sub-verbs.mjs +13 -1
  68. package/package.json +8 -8
  69. package/plugins/flow/.claude-plugin/config.schema.json +11 -1
  70. package/apps/studio/client/home/HomeAccounts.jsx +0 -262
  71. package/apps/studio/client/home/HomeAccountsRow.jsx +0 -221
@@ -36,13 +36,14 @@ import {
36
36
  prepareCloud,
37
37
  prepareCloudLink,
38
38
  relinkProject,
39
+ revealProjectFolder,
40
+ forgetProject,
39
41
  saveRecentSearch,
40
42
  search,
41
43
  setPin,
42
44
  shellListen,
43
45
  shellState,
44
46
  takePendingDeepLink,
45
- thumbObjectUrl,
46
47
  } from './home-api.js';
47
48
  import { homeBootConfig } from './shell-mode.js';
48
49
  import { parseMaudeLink } from '../share-link.js';
@@ -60,18 +61,13 @@ import { HomeAsk } from './HomeAsk.jsx';
60
61
  import { HOME_MENU, homeMenuCtx, homeMenuState } from './home-menu.js';
61
62
  import { InviteSheet } from './InviteSheet.jsx';
62
63
  import { INVITE_WORDS, joinPendingAndOpen, useInviteFlow } from './invite-flow.js';
63
- import { HIcon, HMark, HSpark, ProjectSquare } from './home-icons.jsx';
64
- import { HomeAccounts } from './HomeAccounts.jsx';
65
- import { HomeAccountsRow } from './HomeAccountsRow.jsx';
66
- import { AcctFace, StateWord, WhereChip } from './HomeConnection.jsx';
67
- import { homeAccountCards } from './home-accounts-model.js';
64
+ import { HIcon, HSpark, ProjectSquare } from './home-icons.jsx';
65
+ import { HomeAccountBanner } from './HomeAccountBanner.jsx';
66
+ import { HomeAccountsChip } from './HomeAccountsChip.jsx';
67
+ import { homeAccountBanner, homeAccountCards, homeAccountsSummary } from './home-accounts-model.js';
68
+ import { useAccountFix } from './use-account-fix.js';
68
69
  import {
69
- accountFace,
70
70
  buildHomeModel,
71
- canvasCount,
72
- cloudRoleWord,
73
- ownerWord,
74
- capProjectGroups,
75
71
  defaultTarget,
76
72
  indexQuery,
77
73
  invitedRows,
@@ -86,7 +82,7 @@ import {
86
82
  } from './home-model.js';
87
83
  import { pickStarters } from './home-starters.js';
88
84
  import { NewProjectButton, ProjectsEmpty, SharedWithYou } from './Shelves.jsx';
89
- import { reasonProps } from '../v2/access/disabled-reason.js';
85
+ import { ProjectList, Thumb } from './ProjectRows.jsx';
90
86
 
91
87
  // ── theme: the Home window follows the Mac's appearance (light is the v2 default) ──────────────
92
88
  // S6.9 — every row of the Advanced options flyout now opens its sheet
@@ -359,8 +355,8 @@ function useOnline() {
359
355
  // "Shared with you" rows already opened on this Mac (they stop counting as "new this week"). A per-Mac
360
356
  // convenience, so Home's own storage is enough; it renders correctly without it.
361
357
  const SEEN_KEY = 'maude-home-shared-seen';
362
- // 11 pn-home: the Projects list draws this many rows, then "N more" (the board: five of twenty)
363
- const PROJECTS_SHOWN = 6;
358
+ // 11 pn-home: the Projects list draws this many rows, then "N more"; 2.1.2 (artboard 15) slim rows show ten
359
+ const PROJECTS_SHOWN = 10;
364
360
  function readSeen() {
365
361
  try {
366
362
  const v = JSON.parse(localStorage.getItem(SEEN_KEY) || '[]');
@@ -385,7 +381,6 @@ export function HomeApp() {
385
381
  // Recent canvases are one row of six with a "See all" (pn-home); Projects: find + sort (pn-projlist)
386
382
  const [recentAll, setRecentAll] = useState(false);
387
383
  const [projFind, setProjFind] = useState('');
388
- const [projSort, setProjSort] = useState('recent');
389
384
  const [projAll, setProjAll] = useState(false);
390
385
  const [notice, setNotice] = useState(null);
391
386
  const [link, setLink] = useDeepLink(data.native);
@@ -505,9 +500,11 @@ export function HomeApp() {
505
500
  }),
506
501
  [data.shell, data.index, data.clouds, filterPid, hubAccounts, hubStates, cloudUrl]
507
502
  );
508
- // 2.1.1 (artboard 14) — the accounts row on top; an account whose sign-in stopped working is fixed
509
- // from its own card. A Maude Cloud one drops the dead credential first so the sign-in may use that
510
- // same profile again (Rust never re-signs a profile that still holds one).
503
+ // 2.1.2 HB1 (canvas 17, artboards 15–18) — accounts are a chip at the top right that opens the list;
504
+ // only a sign-in the person can fix raises the banner on top. An account whose sign-in stopped
505
+ // working is fixed from its own line or the banner (one shared attempt). A Maude Cloud one drops the
506
+ // dead credential first so the sign-in may use that same profile again (Rust never re-signs a
507
+ // profile that still holds one). A Maude Cloud cell is never a server (`cloudUrl`).
511
508
  const accountCards = useMemo(
512
509
  () =>
513
510
  homeAccountCards({
@@ -515,10 +512,20 @@ export function HomeApp() {
515
512
  clouds: data.clouds,
516
513
  hubProfiles: hubProfiles ?? [],
517
514
  groups: model.groups,
515
+ cloudUrl,
518
516
  }),
519
- [data.shell, data.clouds, hubProfiles, model.groups]
517
+ [data.shell, data.clouds, hubProfiles, model.groups, cloudUrl]
520
518
  );
521
- // 2.0.5 W4b — the face at the top right opens every account on this Mac (HomeAccounts.jsx)
519
+ const accountSummary = useMemo(() => homeAccountsSummary(accountCards), [accountCards]);
520
+ const accountBanner = useMemo(() => homeAccountBanner(accountCards), [accountCards]);
521
+ const [accountsOpen, setAccountsOpen] = useState(false);
522
+ const accountFix = useAccountFix({
523
+ onCloudSignIn: async (card) => {
524
+ if (card.state === 'rejected') await cloudSignOut(card.profile);
525
+ signin.begin({ profile: card.profile });
526
+ },
527
+ onChanged: data.reload,
528
+ });
522
529
  const searchPids = useMemo(
523
530
  () => (data.shell ? indexQuery(data.shell).pids : browserPids()),
524
531
  [data.shell]
@@ -658,6 +665,29 @@ export function HomeApp() {
658
665
  [fail]
659
666
  );
660
667
 
668
+ // 2.1.2 — a row's "Show in Finder" and "Remove from list" (after the row's confirm). Rust takes each
669
+ // pid off this Mac's list and says so on `shell://state`; nothing on disk changes.
670
+ const reveal = useCallback(
671
+ async (pid) => {
672
+ try {
673
+ await revealProjectFolder(pid);
674
+ } catch (e) {
675
+ fail(e);
676
+ }
677
+ },
678
+ [fail]
679
+ );
680
+ const forget = useCallback(
681
+ async (pids) => {
682
+ try {
683
+ for (const pid of pids) await forgetProject(pid);
684
+ } catch (e) {
685
+ fail(e);
686
+ }
687
+ },
688
+ [fail]
689
+ );
690
+
661
691
  // #206 T6.3g — a Worktrees row's chip: its own tab, by pid (never `open_project`, never a path).
662
692
  const openWorktreeTab = useCallback(
663
693
  async (pid) => {
@@ -961,23 +991,20 @@ export function HomeApp() {
961
991
  [askNewProject, openFolder, startEmpty, whatsNew.open]
962
992
  );
963
993
 
964
- const hasProjects = model.groups.some((g) => g.rows.length);
965
- // Find a project + the sort (pn-home Projects): by name as typed, Recent keeps the model's order
966
- const { projGroups, projMore } = useMemo(() => {
994
+ const hasProjects = model.projects.length > 0;
995
+ // Find a project (pn-home Projects) by name as typed; the list keeps the model's order (last used first).
996
+ // 2.1.2 (artboard 15): one flat list — no account headers and no sort; a row wears its account's face.
997
+ const { projRows, projMore } = useMemo(() => {
967
998
  const q = projFind.trim().toLowerCase();
968
- const byName = (a, b) => String(a.name).localeCompare(String(b.name));
969
- const all = model.groups
970
- .map((g) => {
971
- const rows = g.rows.filter((r) => !q || String(r.name).toLowerCase().includes(q));
972
- return { ...g, rows: projSort === 'name' ? [...rows].sort(byName) : rows };
973
- })
974
- .filter((g) => g.rows.length || !q);
999
+ const all = model.projects.filter((r) => !q || String(r.name).toLowerCase().includes(q));
975
1000
  // 11 pn-home: the list shows its first rows and a "N more" foot; finding a project searches all of them
976
- if (q || projAll) return { projGroups: all, projMore: 0 };
977
- const cut = capProjectGroups(all, PROJECTS_SHOWN);
978
- return { projGroups: cut.groups, projMore: cut.more };
979
- }, [model.groups, projFind, projSort, projAll]);
980
- const showShared = signedIn && (hasProjects || shared.length > 0 || invited.length > 0);
1001
+ if (q || projAll || all.length <= PROJECTS_SHOWN) return { projRows: all, projMore: 0 };
1002
+ return { projRows: all.slice(0, PROJECTS_SHOWN), projMore: all.length - PROJECTS_SHOWN };
1003
+ }, [model.projects, projFind, projAll]);
1004
+ // 2.1.2 — Maude Cloud can't be reached: one quiet line above the list (the account headers are gone)
1005
+ const cloudOffline = (data.clouds ?? []).some((c) => c?.offline);
1006
+ // 2.1.2 (artboard 15) — "Shared with you" shows only when something is shared
1007
+ const showShared = signedIn && (shared.length > 0 || invited.length > 0);
981
1008
  return (
982
1009
  <div className="maude-v2 home-root" data-theme={theme} data-testid="home-root">
983
1010
  <header className="home-top">
@@ -1006,19 +1033,31 @@ export function HomeApp() {
1006
1033
  }}
1007
1034
  canOpen={data.native}
1008
1035
  />
1009
- <HomeAccounts
1010
- shell={data.shell}
1011
- clouds={data.clouds}
1012
- native={data.native}
1013
- onAddCloud={() => signin.begin()}
1014
- onAddTeam={() => openSheet('hub')}
1015
- onChanged={data.reload}
1016
- />
1036
+ {accountCards.length || (data.native && data.shell?.profiles?.length) ? (
1037
+ <HomeAccountsChip
1038
+ summary={accountSummary}
1039
+ shell={data.shell}
1040
+ native={data.native}
1041
+ open={accountsOpen}
1042
+ onOpen={() => setAccountsOpen(true)}
1043
+ onClose={() => setAccountsOpen(false)}
1044
+ fixer={accountFix}
1045
+ onAddCloud={() => signin.begin()}
1046
+ onAddTeam={() => openSheet('hub')}
1047
+ onChanged={data.reload}
1048
+ />
1049
+ ) : null}
1017
1050
  </div>
1018
1051
  </header>
1019
1052
 
1020
1053
  <main className="home-page" aria-label="Home">
1021
1054
  <h1 className="home-sr">Home</h1>
1055
+ <HomeAccountBanner
1056
+ banner={accountBanner}
1057
+ native={data.native}
1058
+ fixer={accountFix}
1059
+ onReview={() => setAccountsOpen(true)}
1060
+ />
1022
1061
  <HomeAsk
1023
1062
  choices={choices}
1024
1063
  targetKey={targetKey}
@@ -1095,58 +1134,7 @@ export function HomeApp() {
1095
1134
  </p>
1096
1135
  ) : null}
1097
1136
 
1098
- {data.native && accountCards.length ? (
1099
- <HomeAccountsRow
1100
- cards={accountCards}
1101
- native={data.native}
1102
- onCloudSignIn={async (card) => {
1103
- if (card.state === 'rejected') await cloudSignOut(card.profile);
1104
- signin.begin({ profile: card.profile });
1105
- }}
1106
- onAddCloud={() => signin.begin()}
1107
- onAddTeam={() => openSheet('hub')}
1108
- onChanged={data.reload}
1109
- />
1110
- ) : null}
1111
-
1112
- {model.pinned.length ? (
1113
- <section className="home-sec" aria-labelledby="home-h-pinned">
1114
- <h2 className="home-h" id="home-h-pinned">
1115
- Pinned
1116
- <span className="home-h-aside">pin any canvas from its row or its menu</span>
1117
- </h2>
1118
- <ul className="home-pins">
1119
- {model.pinned.map((r) => (
1120
- <li key={`${r.pid}:${r.rel}`} className="home-pincard">
1121
- <button
1122
- type="button"
1123
- className="home-pincard-main"
1124
- data-testid={`home-pinned-row-${r.pid}-${r.slug}`}
1125
- onClick={() => open(r.pid, r.rel)}
1126
- disabled={!data.native}
1127
- >
1128
- <Thumb src={r.thumb} className="home-thumb-pin" />
1129
- <span className="home-pincard-t">
1130
- <strong>{r.name}</strong>
1131
- <span>
1132
- <ProjectSquare id={r.pid} name={r.projectName} />
1133
- {r.projectName}
1134
- {r.folder ? ` · ${r.folder}` : ''}
1135
- </span>
1136
- </span>
1137
- </button>
1138
- <PinButton
1139
- row={r}
1140
- testid={`home-pinned-unpin-${r.pid}-${r.slug}`}
1141
- onToggle={togglePin}
1142
- />
1143
- </li>
1144
- ))}
1145
- </ul>
1146
- </section>
1147
- ) : null}
1148
-
1149
- {model.recent.length || filterPid ? (
1137
+ {model.cards.length || filterPid ? (
1150
1138
  <section className="home-sec" aria-labelledby="home-h-recent">
1151
1139
  <h2 className="home-h" id="home-h-recent">
1152
1140
  Recent canvases
@@ -1171,7 +1159,7 @@ export function HomeApp() {
1171
1159
  </label>
1172
1160
  </span>
1173
1161
  ) : null}
1174
- {model.recent.length > RECENT_CAP ? (
1162
+ {model.cards.length > RECENT_CAP ? (
1175
1163
  <button
1176
1164
  type="button"
1177
1165
  className="btn btn--ghost btn--sm home-seeall"
@@ -1183,9 +1171,9 @@ export function HomeApp() {
1183
1171
  </button>
1184
1172
  ) : null}
1185
1173
  </h2>
1186
- {model.recent.length ? (
1174
+ {model.cards.length ? (
1187
1175
  <ul className="home-cards">
1188
- {(recentAll ? model.recent : model.recent.slice(0, RECENT_CAP)).map((r) => (
1176
+ {(recentAll ? model.cards : model.cards.slice(0, RECENT_CAP)).map((r) => (
1189
1177
  <li key={`${r.pid}:${r.rel}`} className="home-card">
1190
1178
  <button
1191
1179
  type="button"
@@ -1204,12 +1192,11 @@ export function HomeApp() {
1204
1192
  ) : null}
1205
1193
  </span>
1206
1194
  <strong>{r.name}</strong>
1195
+ {/* 2.1.2 (artboard 15): one meta line — the project · when */}
1207
1196
  <span className="home-card-meta home-card-proj">
1208
- <ProjectSquare id={r.pid} name={r.projectName} />
1209
- <span>{r.projectName}</span>
1210
- </span>
1211
- <span className="home-card-meta">
1212
- {[r.folder, relativeTime(r.openedAt)].filter(Boolean).join(' · ')}
1197
+ {[r.projectName, relativeTime(r.openedAt ?? undefined)]
1198
+ .filter(Boolean)
1199
+ .join(' · ')}
1213
1200
  </span>
1214
1201
  </button>
1215
1202
  <PinButton
@@ -1245,15 +1232,14 @@ export function HomeApp() {
1245
1232
  ) : null}
1246
1233
  {hasProjects ? (
1247
1234
  <section className="home-sec" aria-labelledby="home-h-projects">
1235
+ {/* 2.1.2 (artboard 15): Projects · count · Find · Open project… · New project, one row */}
1248
1236
  <h2 className="home-h" id="home-h-projects">
1249
1237
  Projects
1250
1238
  {model.projectCount ? (
1251
- <span className="home-h-aside">
1252
- {model.projectCount} {model.projectCount === 1 ? 'project' : 'projects'}
1253
- </span>
1239
+ <span className="home-h-aside home-h-n">{model.projectCount}</span>
1254
1240
  ) : null}
1255
- {model.projectCount > 1 ? (
1256
- <span className="home-h-right">
1241
+ <span className="home-h-right">
1242
+ {model.projectCount > 1 ? (
1257
1243
  <label className="home-projfind">
1258
1244
  <span className="home-sr">Find a project</span>
1259
1245
  <HIcon name="search" size={14} />
@@ -1266,37 +1252,39 @@ export function HomeApp() {
1266
1252
  onChange={(e) => setProjFind(e.target.value)}
1267
1253
  />
1268
1254
  </label>
1269
- <label className="home-filter">
1270
- <span className="home-sr">Sort projects</span>
1271
- <select
1272
- className="chip home-filter-select"
1273
- data-testid="home-project-sort"
1274
- value={projSort}
1275
- onChange={(e) => setProjSort(e.target.value)}
1276
- >
1277
- <option value="recent">Recent</option>
1278
- <option value="name">Name</option>
1279
- </select>
1280
- <HIcon name="chevron" size={12} />
1281
- </label>
1282
- </span>
1283
- ) : null}
1255
+ ) : null}
1256
+ <button
1257
+ type="button"
1258
+ className="btn btn--ghost btn--sm home-projopen"
1259
+ data-testid="home-open-folder"
1260
+ onClick={openFolder}
1261
+ disabled={!data.native}
1262
+ >
1263
+ <HIcon name="folder" size={14} />
1264
+ Open project…
1265
+ </button>
1266
+ <NewProjectButton native={data.native} onNewProject={askNewProject} />
1267
+ </span>
1284
1268
  </h2>
1269
+ {cloudOffline ? (
1270
+ <p className="home-acct-note" role="note">
1271
+ Maude Cloud can't be reached. Showing the last list; projects on this Mac still
1272
+ open.
1273
+ </p>
1274
+ ) : null}
1285
1275
  <div className="island home-projlist">
1286
- {projGroups.map((g) => (
1287
- <ProfileGroup
1288
- key={g.profile.id}
1289
- group={g}
1290
- showHeader={projGroups.length > 1 || !!g.profile.email}
1291
- canOpen={data.native}
1292
- onOpen={(pid) => open(pid)}
1293
- onOpenWorktree={openWorktreeTab}
1294
- onRelink={relink}
1295
- onOpenCloud={openCloud}
1296
- />
1297
- ))}
1298
- <div className="home-projmore">
1299
- {projMore ? (
1276
+ <ProjectList
1277
+ rows={projRows}
1278
+ canOpen={data.native}
1279
+ onOpen={(pid) => open(pid)}
1280
+ onOpenWorktree={openWorktreeTab}
1281
+ onRelink={relink}
1282
+ onOpenCloud={openCloud}
1283
+ onReveal={reveal}
1284
+ onForget={forget}
1285
+ />
1286
+ {projMore ? (
1287
+ <div className="home-projmore">
1300
1288
  <button
1301
1289
  type="button"
1302
1290
  className="btn btn--ghost btn--sm home-projmore-n"
@@ -1305,24 +1293,8 @@ export function HomeApp() {
1305
1293
  >
1306
1294
  {projMore} more
1307
1295
  </button>
1308
- ) : (
1309
- <span />
1310
- )}
1311
- <span className="home-projacts">
1312
- <NewProjectButton native={data.native} onNewProject={askNewProject} />
1313
- <button
1314
- type="button"
1315
- className="btn btn--ghost btn--sm home-projopen"
1316
- data-testid="home-open-folder"
1317
- onClick={openFolder}
1318
- disabled={!data.native}
1319
- >
1320
- <HIcon name="folder" size={14} />
1321
- Open project…
1322
- <kbd className="kbd">⌘O</kbd>
1323
- </button>
1324
- </span>
1325
- </div>
1296
+ </div>
1297
+ ) : null}
1326
1298
  </div>
1327
1299
  </section>
1328
1300
  ) : data.status !== 'loading' && !cardOn && (firstRunSeen !== null || !data.native) ? (
@@ -1415,30 +1387,6 @@ export function HomeApp() {
1415
1387
  );
1416
1388
  }
1417
1389
 
1418
- /** A Home picture: fetched with the Home header (home-api `thumbObjectUrl`), shown as a blob URL. */
1419
- function Thumb({ src, className }) {
1420
- const [url, setUrl] = useState(null);
1421
- const [broken, setBroken] = useState(false);
1422
- useEffect(() => {
1423
- let alive = true;
1424
- setUrl(null);
1425
- setBroken(false);
1426
- if (src)
1427
- thumbObjectUrl(src).then((u) => {
1428
- if (alive) setUrl(u);
1429
- });
1430
- return () => {
1431
- alive = false;
1432
- };
1433
- }, [src]);
1434
- if (!url || broken) return <span className={`home-thumb home-thumb--empty ${className}`} />;
1435
- return (
1436
- <span className={`home-thumb ${className}`}>
1437
- <img src={url} alt="" decoding="async" onError={() => setBroken(true)} />
1438
- </span>
1439
- );
1440
- }
1441
-
1442
1390
  function PinButton({ row, testid, onToggle }) {
1443
1391
  const pinned = row.pinnedAt != null;
1444
1392
  return (
@@ -1458,259 +1406,6 @@ function PinButton({ row, testid, onToggle }) {
1458
1406
 
1459
1407
  const RECENT_CAP = 6;
1460
1408
 
1461
- const STATE_WORD = {
1462
- tab: 'in a tab',
1463
- cloud: (
1464
- <>
1465
- <HIcon name="cloud" size={12} />
1466
- not on this Mac yet
1467
- </>
1468
- ),
1469
- };
1470
-
1471
- // 2.1.1 (artboard 14) — a project row says where it lives (the account, or the place) and shows the
1472
- // connection badge the project window shows: the account's face with the state on it, and its word.
1473
- // `home-project-conn-<pid>` stays the connection cell (data-kind = local / cloud / team, data-state).
1474
- function RowWhere({ row }) {
1475
- if (!row.where) return null;
1476
- return (
1477
- <span className="home-prow-where">
1478
- <WhereChip where={row.where} testid={`home-project-where-${row.pid}`} />
1479
- </span>
1480
- );
1481
- }
1482
- function RowConn({ row }) {
1483
- const c = row.conn;
1484
- return (
1485
- <span
1486
- className="home-prow-st"
1487
- data-testid={`home-project-conn-${row.pid}`}
1488
- data-kind={row.connection?.kind ?? undefined}
1489
- data-state={c?.state ?? undefined}
1490
- >
1491
- {c ? (
1492
- <>
1493
- <AcctFace face={c.face} state={c.state} size="sm" />
1494
- <StateWord tone={c.tone} testid={`home-project-state-${row.pid}`}>
1495
- {c.word}
1496
- </StateWord>
1497
- </>
1498
- ) : null}
1499
- </span>
1500
- );
1501
- }
1502
-
1503
- // 2.0.5 W4b — the folders folded into this row (a managed cloud copy; another folder on the same
1504
- // design root). Each still opens its own project.
1505
- function RowCopies({ row, canOpen, onOpen }) {
1506
- if (!row.copies?.length) return null;
1507
- return (
1508
- <span className="home-prow-copies">
1509
- {row.copies.map((c) => (
1510
- <button
1511
- key={c.pid}
1512
- type="button"
1513
- className="chip home-prow-copy"
1514
- data-testid={`home-project-copy-${c.pid}`}
1515
- data-kind={c.kind}
1516
- onClick={() => onOpen(c.pid)}
1517
- disabled={!canOpen}
1518
- {...reasonProps(!canOpen, 'homeBrowser')}
1519
- title={c.root}
1520
- aria-label={
1521
- c.kind === 'folder' ? `Open ${c.label}` : `Open the ${c.label} of ${row.name}`
1522
- }
1523
- >
1524
- {c.kind === 'folder' ? `also ${c.label}` : c.label}
1525
- </button>
1526
- ))}
1527
- </span>
1528
- );
1529
- }
1530
-
1531
- // #206 T6.3g (contract 206 §5) — the git worktrees of this project this Mac opened as tabs: one
1532
- // "Worktrees" row under the project, a chip per branch. A worktree is never a project row of its own.
1533
- function RowWorktrees({ row, canOpen, onOpen }) {
1534
- if (!row.worktrees?.length) return null;
1535
- return (
1536
- <span className="home-prow-copies" data-testid={`home-project-worktrees-${row.pid}`}>
1537
- <span className="home-prow-wt-h">Worktrees</span>
1538
- {row.worktrees.map((w) => (
1539
- <button
1540
- key={w.pid}
1541
- type="button"
1542
- className="chip home-prow-copy"
1543
- data-testid={`home-worktree-${w.pid}`}
1544
- data-place={w.place}
1545
- onClick={() => onOpen(w.pid)}
1546
- disabled={!canOpen}
1547
- {...reasonProps(!canOpen, 'homeBrowser')}
1548
- title={w.root}
1549
- aria-label={`Open the ${w.branch} worktree of ${row.name}`}
1550
- >
1551
- {w.branch}
1552
- </button>
1553
- ))}
1554
- </span>
1555
- );
1556
- }
1557
-
1558
- // A project tab's live state (shell_state `ai` + `place`), canvas 11's words: AI working (a spark
1559
- // while it runs) · Needs you (it is waiting on a decision — the one that asks for you wins) ·
1560
- // Resting (its server is stopped; the tab wakes it). A resting tab never has AI (rest policy).
1561
- function RowLive({ row }) {
1562
- const ai = row.ai;
1563
- if (ai?.awaiting > 0)
1564
- return (
1565
- <span
1566
- className="chip home-prow-ai"
1567
- data-testid={`home-project-ai-${row.pid}`}
1568
- data-ai="awaiting"
1569
- >
1570
- Needs you
1571
- </span>
1572
- );
1573
- if (ai?.running > 0)
1574
- return (
1575
- <span
1576
- className="chip chip--spark home-prow-ai"
1577
- data-testid={`home-project-ai-${row.pid}`}
1578
- data-ai="running"
1579
- >
1580
- <HSpark size={9} />
1581
- AI working
1582
- </span>
1583
- );
1584
- if (row.place === 'resting')
1585
- return (
1586
- <span className="home-prow-rest" data-testid={`home-project-resting-${row.pid}`}>
1587
- <span className="home-prow-ring" aria-hidden="true" />
1588
- Resting
1589
- </span>
1590
- );
1591
- return null;
1592
- }
1593
-
1594
- function ProfileGroup({
1595
- group,
1596
- showHeader,
1597
- canOpen,
1598
- onOpen,
1599
- onOpenWorktree,
1600
- onRelink,
1601
- onOpenCloud,
1602
- }) {
1603
- const { profile, cloud } = group;
1604
- return (
1605
- <div className="home-acct" data-testid={`home-profile-${profile.id}`}>
1606
- {showHeader ? (
1607
- <h3 className="home-acct-h">
1608
- <span
1609
- className={`home-acctf home-acctf--${accountFace(profile).tone}`}
1610
- aria-hidden="true"
1611
- >
1612
- {accountFace(profile).initial}
1613
- </span>
1614
- {profile.label}
1615
- {profile.email ? ` · ${profile.email}` : ''}
1616
- </h3>
1617
- ) : null}
1618
- {cloud?.offline ? (
1619
- <p className="home-acct-note" role="note">
1620
- Maude Cloud can't be reached. Showing the last list; projects on this Mac still open.
1621
- </p>
1622
- ) : null}
1623
- <ul className="home-prows">
1624
- {group.rows.map((r) =>
1625
- r.kind === 'cloud' ? (
1626
- <li key={`c:${r.projectId}`} className="row-item home-prow home-prow--cloud">
1627
- <ProjectSquare id={r.projectId} name={r.name} size="md" />
1628
- <span className="home-prow-t" data-testid={`home-cloud-row-${r.projectId}`}>
1629
- <strong>{r.name}</strong>
1630
- <span>
1631
- {ownerWord(r.ownerName, r.role) ? `${ownerWord(r.ownerName, r.role)} · ` : ''}
1632
- {cloudRoleWord(r.role)} · {STATE_WORD.cloud}
1633
- </span>
1634
- </span>
1635
- <span className="home-prow-where">
1636
- <WhereChip where={r.where} testid={`home-project-where-${r.projectId}`} />
1637
- </span>
1638
- <button
1639
- type="button"
1640
- className="btn btn--sm"
1641
- data-testid={`home-cloud-open-${r.projectId}`}
1642
- onClick={() => onOpenCloud(r)}
1643
- disabled={!canOpen}
1644
- {...reasonProps(!canOpen, 'homeBrowser')}
1645
- aria-label={`Open ${r.name}`}
1646
- >
1647
- Open
1648
- </button>
1649
- </li>
1650
- ) : (
1651
- <li key={r.pid} className="home-prow-li">
1652
- {r.status === 'gone' ? (
1653
- <div className="row-item home-prow home-prow--gone">
1654
- <ProjectSquare id={r.pid} name={r.name} size="md" />
1655
- <span className="home-prow-t" data-testid={`home-project-row-${r.pid}`}>
1656
- <strong>{r.name}</strong>
1657
- <span>{r.name} isn't where it was.</span>
1658
- </span>
1659
- <button
1660
- type="button"
1661
- className="btn btn--sm"
1662
- data-testid={`home-relink-${r.pid}`}
1663
- onClick={() => onRelink(r.pid)}
1664
- disabled={!canOpen}
1665
- {...reasonProps(!canOpen, 'homeBrowser')}
1666
- >
1667
- Find the folder…
1668
- </button>
1669
- </div>
1670
- ) : (
1671
- <button
1672
- type="button"
1673
- className="row-item home-prow"
1674
- data-testid={`home-project-row-${r.pid}`}
1675
- data-place={r.place}
1676
- onClick={() => onOpen(r.pid)}
1677
- disabled={!canOpen}
1678
- {...reasonProps(!canOpen, 'homeBrowser')}
1679
- >
1680
- <Thumb src={r.cover} className="home-prow-thumb" />
1681
- <span className="home-prow-t">
1682
- <strong>{r.name}</strong>
1683
- <span>
1684
- {[
1685
- r.canvasCount != null ? canvasCount(r.canvasCount) : null,
1686
- STATE_WORD[r.status] ?? null,
1687
- ]
1688
- .filter(Boolean)
1689
- .map((part, i) => (
1690
- // biome-ignore lint/suspicious/noArrayIndexKey: a fixed three-part line
1691
- <span key={i} className="home-prow-part">
1692
- {i ? ' · ' : ''}
1693
- {part}
1694
- </span>
1695
- ))}
1696
- </span>
1697
- </span>
1698
- <RowWhere row={r} />
1699
- <RowConn row={r} />
1700
- <RowLive row={r} />
1701
- <ProjectSquare id={r.pid} name={r.name} />
1702
- </button>
1703
- )}
1704
- <RowCopies row={r} canOpen={canOpen} onOpen={onOpen} />
1705
- <RowWorktrees row={r} canOpen={canOpen} onOpen={onOpenWorktree} />
1706
- </li>
1707
- )
1708
- )}
1709
- </ul>
1710
- </div>
1711
- );
1712
- }
1713
-
1714
1409
  // ── ⌘K Search (11 pn-home-search) ───────────────────────────────────────────────────────────
1715
1410
  // The top bar holds an icon + the ⌘K key; the field lives in a centred 620 palette over a veil. Before you
1716
1411
  // type it is a shortcut list — Recent searches · Open tabs · Recent canvases — with an Ask AI row and a