@1agh/maude 2.0.3 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -5
- package/apps/hub/src/project-transactions/kernel.mjs +10 -1
- package/apps/studio/access/filters.ts +12 -5
- package/apps/studio/access/known-canvases.ts +24 -1
- package/apps/studio/access/refused-inputs.ts +89 -0
- package/apps/studio/access/request.ts +0 -1
- package/apps/studio/acp/adapter-stderr.ts +43 -13
- package/apps/studio/acp/background-tasks.ts +155 -0
- package/apps/studio/acp/bridge.ts +44 -5
- package/apps/studio/acp/connected-fact.ts +15 -4
- package/apps/studio/acp/index.ts +14 -5
- package/apps/studio/actions/agents.ts +10 -0
- package/apps/studio/actions/defs/app.ts +12 -0
- package/apps/studio/actions/defs/view.ts +12 -0
- package/apps/studio/actions.manifest.json +25 -1
- package/apps/studio/actions.parity.json +13 -1
- package/apps/studio/annotations/ui/element-node.tsx +139 -54
- package/apps/studio/annotations/ui/lod.tsx +1 -1
- package/apps/studio/annotations/ui/text-style.ts +1 -1
- package/apps/studio/annotations-layer.tsx +0 -12
- package/apps/studio/api.ts +73 -24
- package/apps/studio/artboard-live-gate.tsx +267 -0
- package/apps/studio/artboard-live.ts +336 -0
- package/apps/studio/artboard-webgl.ts +668 -0
- package/apps/studio/bin/_agent-browser-bin.mjs +8 -0
- package/apps/studio/bin/_agent-browser-safe.mjs +2 -1
- package/apps/studio/bin/_canvas-reasons.mjs +34 -0
- package/apps/studio/bin/_ds-check-live.mjs +37 -0
- package/apps/studio/bin/_ds-check.mjs +4 -1
- package/apps/studio/bin/_ds-prove-judge.mjs +167 -0
- package/apps/studio/bin/_ds-prove-playwright.mjs +183 -105
- package/apps/studio/bin/_import-asset.mjs +2 -1
- package/apps/studio/bin/_perf-probe.mjs +2 -1
- package/apps/studio/bin/_png-playwright.mjs +10 -1
- package/apps/studio/bin/_pw-launch.mjs +14 -0
- package/apps/studio/bin/_studio-verb.mjs +24 -3
- package/apps/studio/bin/_thumb-blank.mjs +70 -0
- package/apps/studio/bin/_thumb-cover.mjs +35 -0
- package/apps/studio/bin/_thumbs-playwright.mjs +93 -13
- package/apps/studio/bin/ds-check.sh +5 -1
- package/apps/studio/bin/perf.sh +11 -1
- package/apps/studio/bin/server-up.sh +7 -2
- package/apps/studio/bin/smoke.sh +19 -0
- package/apps/studio/boot-progress.ts +31 -0
- package/apps/studio/canvas-build-sandbox.ts +275 -42
- package/apps/studio/canvas-build-worker.ts +10 -0
- package/apps/studio/canvas-create.ts +24 -0
- package/apps/studio/canvas-lib.tsx +131 -12
- package/apps/studio/canvas-module-cache.ts +93 -0
- package/apps/studio/canvas-source/errors.ts +39 -0
- package/apps/studio/canvas-source/waiting.ts +290 -0
- package/apps/studio/client/actions/shell-key-handlers.js +5 -0
- package/apps/studio/client/app.jsx +19 -9
- package/apps/studio/client/canvas-url.js +13 -0
- package/apps/studio/client/github.js +23 -3
- package/apps/studio/client/home/HomeAccounts.jsx +262 -0
- package/apps/studio/client/home/Shelves.jsx +4 -3
- package/apps/studio/client/home/home-accounts-model.js +121 -0
- package/apps/studio/client/home/home-api.js +36 -19
- package/apps/studio/client/home/home-app.jsx +141 -40
- package/apps/studio/client/home/home-model.js +172 -6
- package/apps/studio/client/home/home.css +169 -5
- package/apps/studio/client/home/shell-mode.js +8 -1
- package/apps/studio/client/hooks/use-git-actions.jsx +2 -1
- package/apps/studio/client/hooks/use-project-data.jsx +2 -0
- package/apps/studio/client/hooks/use-shell-core.jsx +3 -0
- package/apps/studio/client/hooks/use-tabs.jsx +64 -35
- package/apps/studio/client/index-loader.ts +23 -3
- package/apps/studio/client/panels/ChatPanel.jsx +49 -57
- package/apps/studio/client/panels/CreateProject.jsx +19 -5
- package/apps/studio/client/panels/DiffView.jsx +314 -248
- package/apps/studio/client/panels/TeamProjects.jsx +119 -69
- package/apps/studio/client/panels/acp-runtime.js +25 -0
- package/apps/studio/client/panels/caps-cache.js +46 -0
- package/apps/studio/client/panels/chat-finish.js +66 -0
- package/apps/studio/client/shell/frame-cap.js +53 -0
- package/apps/studio/client/shell/viewport.jsx +45 -8
- package/apps/studio/client/styles/_index.css +2 -0
- package/apps/studio/client/tree/tree.jsx +48 -21
- package/apps/studio/client/v2/access/access-client.js +2 -0
- package/apps/studio/client/v2/access/access-host.jsx +12 -1
- package/apps/studio/client/v2/access/trashed-banner.jsx +6 -3
- package/apps/studio/client/v2/ai/Advanced.jsx +12 -0
- package/apps/studio/client/v2/ai/BackgroundStrip.jsx +120 -0
- package/apps/studio/client/v2/ai/Composer.jsx +27 -10
- package/apps/studio/client/v2/ai/StoppedDivider.jsx +2 -1
- package/apps/studio/client/v2/ai/ai-run.css +87 -3
- package/apps/studio/client/v2/ai/background-model.js +113 -0
- package/apps/studio/client/v2/ai/needs-you-store.js +2 -1
- package/apps/studio/client/v2/ai/run-api.js +7 -3
- package/apps/studio/client/v2/ai/runs-store.js +2 -1
- package/apps/studio/client/v2/annotations/vote-store.js +11 -5
- package/apps/studio/client/v2/assets/asset-state-lane.js +6 -3
- package/apps/studio/client/v2/assets/assets-bus.js +10 -8
- package/apps/studio/client/v2/assets/browse-view.jsx +2 -0
- package/apps/studio/client/v2/assets/ds-library-view.jsx +47 -0
- package/apps/studio/client/v2/assets/spotlight-model.js +75 -0
- package/apps/studio/client/v2/assets/spotlight.css +153 -0
- package/apps/studio/client/v2/assets/spotlight.jsx +199 -0
- package/apps/studio/client/v2/assets/tile-menu.jsx +3 -1
- package/apps/studio/client/v2/assets/tile.jsx +3 -0
- package/apps/studio/client/v2/assets/use-assets.js +2 -1
- package/apps/studio/client/v2/canvases/canvases-panel.jsx +13 -2
- package/apps/studio/client/v2/canvases/covers.js +11 -5
- package/apps/studio/client/v2/canvases/folder-ask.js +139 -0
- package/apps/studio/client/v2/canvases/folder-dialogs.jsx +150 -0
- package/apps/studio/client/v2/canvases/trash-canvas.js +10 -2
- package/apps/studio/client/v2/canvases/trash-queue.js +152 -0
- package/apps/studio/client/v2/canvases/use-canvas-index.js +42 -18
- package/apps/studio/client/v2/canvases/use-pins.js +2 -1
- package/apps/studio/client/v2/code/canvas-error-card.jsx +70 -5
- package/apps/studio/client/v2/code/canvas-imports-card.jsx +15 -14
- package/apps/studio/client/v2/code/canvas-imports-words.js +44 -0
- package/apps/studio/client/v2/code/canvas-waiting-card.jsx +128 -0
- package/apps/studio/client/v2/code/canvas-waiting.js +164 -0
- package/apps/studio/client/v2/code/code-bus.js +5 -0
- package/apps/studio/client/v2/code/code.css +67 -0
- package/apps/studio/client/v2/code/use-canvas-source.js +19 -4
- package/apps/studio/client/v2/create/NameDialog.jsx +4 -2
- package/apps/studio/client/v2/create/name-dialog.css +10 -0
- package/apps/studio/client/v2/ds/advanced-host.jsx +11 -23
- package/apps/studio/client/v2/ds/ds-refresh.js +161 -0
- package/apps/studio/client/v2/ds/library-host.jsx +45 -45
- package/apps/studio/client/v2/ds/make-host.jsx +13 -12
- package/apps/studio/client/v2/ds/off-system-host.jsx +18 -16
- package/apps/studio/client/v2/ds/review-host.jsx +7 -1
- package/apps/studio/client/v2/ds/truth-host.jsx +15 -14
- package/apps/studio/client/v2/ds/upgrade-host.jsx +26 -10
- package/apps/studio/client/v2/empty/arriving.jsx +29 -12
- package/apps/studio/client/v2/empty/empty-host.jsx +8 -2
- package/apps/studio/client/v2/empty/not-local.jsx +31 -1
- package/apps/studio/client/v2/empty/use-empty-canvas.js +10 -1
- package/apps/studio/client/v2/export/last-finished.js +2 -1
- package/apps/studio/client/v2/history/branch-actions.js +13 -9
- package/apps/studio/client/v2/history/git-advanced.jsx +8 -1
- package/apps/studio/client/v2/history/git-model.js +21 -5
- package/apps/studio/client/v2/history/git-parts.jsx +76 -43
- package/apps/studio/client/v2/history/history.css +6 -0
- package/apps/studio/client/v2/left-panel/assets-panel.jsx +87 -10
- package/apps/studio/client/v2/left-panel/use-trash.js +2 -1
- package/apps/studio/client/v2/onboarding/AdvancedSheets.jsx +100 -33
- package/apps/studio/client/v2/onboarding/HubSheet.jsx +51 -83
- package/apps/studio/client/v2/onboarding/onboarding-model.js +10 -6
- package/apps/studio/client/v2/presence/faces.jsx +42 -14
- package/apps/studio/client/v2/present/order-notes-artboards.js +2 -1
- package/apps/studio/client/v2/search/search-recent.js +3 -1
- package/apps/studio/client/v2/search/search-remote.js +6 -4
- package/apps/studio/client/v2/settings/connections-model.js +1 -1
- package/apps/studio/client/v2/shell/account-card.jsx +10 -4
- package/apps/studio/client/v2/shell/canvas-crash-guard.js +137 -0
- package/apps/studio/client/v2/shell/github-signin-host.jsx +42 -0
- package/apps/studio/client/v2/shell/menu-runner.js +12 -0
- package/apps/studio/client/v2/shell/occlusion-insets.js +14 -2
- package/apps/studio/client/v2/shell/project-account-card.jsx +203 -0
- package/apps/studio/client/v2/shell/project-account-model.js +182 -0
- package/apps/studio/client/v2/shell/recovery-store.js +2 -1
- package/apps/studio/client/v2/shell/served-routes.js +120 -0
- package/apps/studio/client/v2/shell/share-cluster-host.jsx +139 -11
- package/apps/studio/client/v2/shell/share-cluster.css +58 -0
- package/apps/studio/client/v2/shell/share-cluster.jsx +26 -7
- package/apps/studio/client/v2/shell/shell-activity.js +19 -0
- package/apps/studio/client/v2/shell/team-switch.js +94 -0
- package/apps/studio/client/v2/shell/too-heavy-card.jsx +38 -0
- package/apps/studio/client/v2/shell/use-account.js +8 -1
- package/apps/studio/client/v2/shell/use-occluded-insets.js +3 -0
- package/apps/studio/client/v2/sync-states/conflict-card.jsx +7 -2
- package/apps/studio/client/v2/undo/use-undo-projection.jsx +3 -1
- package/apps/studio/cloud/endpoints.ts +23 -1
- package/apps/studio/collab/persistence.ts +9 -1
- package/apps/studio/collab/registry.ts +32 -0
- package/apps/studio/collab/room.ts +8 -0
- package/apps/studio/config-reload-wire.ts +53 -0
- package/apps/studio/dist/client.bundle.js +1098 -1102
- package/apps/studio/dist/styles.css +1 -1
- package/apps/studio/ds/board/specimen.tsx +12 -1
- package/apps/studio/ds/canvas-cli.ts +58 -2
- package/apps/studio/ds/check.ts +26 -1
- package/apps/studio/ds/cli.ts +7 -3
- package/apps/studio/ds/convert.ts +34 -6
- package/apps/studio/ds/ds-verb.ts +13 -0
- package/apps/studio/ds/post-build.ts +38 -0
- package/apps/studio/ds/upgrade-apply.ts +27 -5
- package/apps/studio/ds/upgrade-cli.ts +22 -2
- package/apps/studio/ds/upgrade-prove.ts +198 -15
- package/apps/studio/ds/upgrade-stage.ts +4 -1
- package/apps/studio/editing/minimap-context.tsx +3 -3
- package/apps/studio/editing/page-activity.ts +251 -0
- package/apps/studio/editing/rotate-handle.tsx +9 -5
- package/apps/studio/editing/sticky-name.tsx +4 -4
- package/apps/studio/history/restore-artboard-action.ts +40 -0
- package/apps/studio/history/trash.ts +6 -0
- package/apps/studio/home/accounts.ts +87 -0
- package/apps/studio/home/hub.ts +77 -175
- package/apps/studio/home/index-reader.ts +24 -2
- package/apps/studio/home/routes.ts +66 -8
- package/apps/studio/http.ts +131 -68
- package/apps/studio/index-flight.ts +40 -0
- package/apps/studio/managed-projects.ts +52 -24
- package/apps/studio/migrate/hub.ts +7 -1
- package/apps/studio/routes/canvas-source.ts +44 -2
- package/apps/studio/routes/ds-convert.ts +18 -0
- package/apps/studio/routes/history.ts +28 -5
- package/apps/studio/routes/hub-signin.ts +115 -0
- package/apps/studio/routes/index.ts +4 -0
- package/apps/studio/routes/table.ts +7 -0
- package/apps/studio/routes/trash.ts +19 -1
- package/apps/studio/server.ts +19 -10
- package/apps/studio/sync/accepted-cold-start.ts +54 -16
- package/apps/studio/sync/accepted-link.ts +9 -4
- package/apps/studio/sync/asset-push.ts +146 -23
- package/apps/studio/sync/asset-state.ts +3 -2
- package/apps/studio/sync/code-module-consent.ts +74 -0
- package/apps/studio/sync/file-ledger.ts +35 -0
- package/apps/studio/sync/file-membership.ts +28 -3
- package/apps/studio/sync/file-plane.ts +483 -86
- package/apps/studio/sync/file-pull.ts +304 -33
- package/apps/studio/sync/hub-browser-signin.ts +377 -0
- package/apps/studio/sync/hub-link.ts +1 -2
- package/apps/studio/sync/hub-text-undo.ts +30 -10
- package/apps/studio/sync/index.ts +381 -161
- package/apps/studio/sync/journal-client.ts +94 -5
- package/apps/studio/sync/pending-deletes.ts +100 -0
- package/apps/studio/sync/projection.ts +121 -14
- package/apps/studio/sync/pull-pacer.ts +160 -0
- package/apps/studio/sync/pull-priority.ts +119 -0
- package/apps/studio/sync/seed-progress.ts +58 -3
- package/apps/studio/sync/status.ts +3 -1
- package/apps/studio/sync/transaction-client.ts +71 -6
- package/apps/studio/sync/workspace-signin.ts +6 -256
- package/apps/studio/sync/writer-registry.ts +5 -1
- package/apps/studio/thumbs/service.ts +12 -2
- package/apps/studio/thumbs/validate.ts +7 -0
- package/apps/studio/ui-prefs-migrate.ts +4 -0
- package/apps/studio/video-comp.tsx +23 -0
- package/apps/studio/video-links-overlay.tsx +3 -2
- package/apps/studio/whats-new.json +126 -0
- package/cli/lib/bash-guard.mjs +13 -1
- package/cli/lib/design-help.gen.mjs +1 -1
- package/cli/lib/design-hook.mjs +20 -0
- package/cli/lib/studio-locate.mjs +35 -10
- package/cli/lib/workspace-plan.mjs +14 -0
- package/package.json +8 -8
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
import { useEffect, useRef, useState } from 'react';
|
|
7
7
|
import { StIcon } from '../../shell/icons.jsx';
|
|
8
|
+
import { ConfirmAskDialog } from '../canvases/folder-dialogs.jsx';
|
|
8
9
|
import { useModalFocus } from '../shell/modal-focus.js';
|
|
9
10
|
import {
|
|
10
11
|
GIT_WORDS as W,
|
|
11
12
|
chatGuardCopy,
|
|
12
|
-
|
|
13
|
+
discardAsk,
|
|
13
14
|
saveState,
|
|
14
15
|
slugifyBranch,
|
|
15
16
|
unitCheck,
|
|
@@ -90,8 +91,22 @@ function TriCheck({ state, onChange, ariaLabel }) {
|
|
|
90
91
|
);
|
|
91
92
|
}
|
|
92
93
|
|
|
94
|
+
/** 2.0.5 W4 — "Sign in with GitHub to …" is a button: the registry's `account.github-signin`. */
|
|
95
|
+
export function GitHubSignInButton({ onSignIn }) {
|
|
96
|
+
return (
|
|
97
|
+
<button
|
|
98
|
+
type="button"
|
|
99
|
+
className="btn btn--sm"
|
|
100
|
+
data-testid="git-signin-github"
|
|
101
|
+
onClick={() => onSignIn()}
|
|
102
|
+
>
|
|
103
|
+
Sign in with GitHub…
|
|
104
|
+
</button>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
93
108
|
/** A banner under the fold's head: a result, a warning, or an offer (Get latest after a publish conflict). */
|
|
94
|
-
export function Banner({ banner, busy, onGetLatest, onDismiss }) {
|
|
109
|
+
export function Banner({ banner, busy, onGetLatest, onDismiss, onSignIn }) {
|
|
95
110
|
if (!banner) return null;
|
|
96
111
|
return (
|
|
97
112
|
<div
|
|
@@ -113,6 +128,7 @@ export function Banner({ banner, busy, onGetLatest, onDismiss }) {
|
|
|
113
128
|
{W.getLatest}
|
|
114
129
|
</button>
|
|
115
130
|
) : null}
|
|
131
|
+
{banner.signIn && onSignIn ? <GitHubSignInButton onSignIn={onSignIn} /> : null}
|
|
116
132
|
</span>
|
|
117
133
|
<button type="button" className="vh-git-x" aria-label={W.dismiss} onClick={onDismiss}>
|
|
118
134
|
<StIcon name="x" size={12} />
|
|
@@ -123,6 +139,9 @@ export function Banner({ banner, busy, onGetLatest, onDismiss }) {
|
|
|
123
139
|
|
|
124
140
|
/** "Not in a version yet": one row per canvas (its sidecars travel with it), Compare, Discard. */
|
|
125
141
|
export function UnsavedList({ units, canWrite, busy, onOpen, onCompare, onDiscard }) {
|
|
142
|
+
// Discard asks in the shell's own dialog: `window.confirm` always answers no in the desktop app.
|
|
143
|
+
const [asking, setAsking] = useState(null);
|
|
144
|
+
const ask = asking ? discardAsk(asking) : null;
|
|
126
145
|
if (!units.length)
|
|
127
146
|
return (
|
|
128
147
|
<p className="vh-git-none" data-testid="vh-git-notyet">
|
|
@@ -130,51 +149,65 @@ export function UnsavedList({ units, canWrite, busy, onOpen, onCompare, onDiscar
|
|
|
130
149
|
</p>
|
|
131
150
|
);
|
|
132
151
|
return (
|
|
133
|
-
|
|
134
|
-
{
|
|
135
|
-
|
|
136
|
-
<
|
|
137
|
-
|
|
138
|
-
type="button"
|
|
139
|
-
className="vh-git-file"
|
|
140
|
-
title={u.path}
|
|
141
|
-
onClick={() => onOpen?.(u.path)}
|
|
142
|
-
>
|
|
143
|
-
<span className="vh-git-fname">{u.name}</span>
|
|
144
|
-
<span className="vh-git-fpath">
|
|
145
|
-
{u.supporting.length ? `${u.path} · +${u.supporting.length} supporting` : u.path}
|
|
146
|
-
</span>
|
|
147
|
-
</button>
|
|
148
|
-
{u.comparable && onCompare ? (
|
|
149
|
-
<button
|
|
150
|
-
type="button"
|
|
151
|
-
className="icon-btn"
|
|
152
|
-
data-testid="git-compare"
|
|
153
|
-
title={W.compareFile}
|
|
154
|
-
aria-label={`${W.compareFile}: ${u.name}`}
|
|
155
|
-
onClick={() => onCompare(u.path)}
|
|
156
|
-
>
|
|
157
|
-
<StIcon name="eye" size={13} />
|
|
158
|
-
</button>
|
|
159
|
-
) : null}
|
|
160
|
-
{canWrite ? (
|
|
152
|
+
<>
|
|
153
|
+
<ul className="vh-git-ul" data-testid="vh-git-notyet" aria-label={W.notYet}>
|
|
154
|
+
{units.map((u) => (
|
|
155
|
+
<li className="vh-git-unit" key={u.key}>
|
|
156
|
+
<Badge kind={u.badge} title={u.badgeTitle} />
|
|
161
157
|
<button
|
|
162
158
|
type="button"
|
|
163
|
-
className="
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
aria-label={`${W.discard} changes to ${u.name}`}
|
|
167
|
-
onClick={() => {
|
|
168
|
-
if (!window.confirm(discardConfirm(u))) return;
|
|
169
|
-
onDiscard(u);
|
|
170
|
-
}}
|
|
159
|
+
className="vh-git-file"
|
|
160
|
+
title={u.path}
|
|
161
|
+
onClick={() => onOpen?.(u.path)}
|
|
171
162
|
>
|
|
172
|
-
{
|
|
163
|
+
<span className="vh-git-fname">{u.name}</span>
|
|
164
|
+
<span className="vh-git-fpath">
|
|
165
|
+
{u.supporting.length ? `${u.path} · +${u.supporting.length} supporting` : u.path}
|
|
166
|
+
</span>
|
|
173
167
|
</button>
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
168
|
+
{u.comparable && onCompare ? (
|
|
169
|
+
<button
|
|
170
|
+
type="button"
|
|
171
|
+
className="icon-btn"
|
|
172
|
+
data-testid="git-compare"
|
|
173
|
+
title={W.compareFile}
|
|
174
|
+
aria-label={`${W.compareFile}: ${u.name}`}
|
|
175
|
+
onClick={() => onCompare(u.path)}
|
|
176
|
+
>
|
|
177
|
+
<StIcon name="eye" size={13} />
|
|
178
|
+
</button>
|
|
179
|
+
) : null}
|
|
180
|
+
{canWrite ? (
|
|
181
|
+
<button
|
|
182
|
+
type="button"
|
|
183
|
+
className="btn btn--ghost btn--sm"
|
|
184
|
+
data-testid="git-discard"
|
|
185
|
+
disabled={!!busy}
|
|
186
|
+
aria-label={`${W.discard} changes to ${u.name}`}
|
|
187
|
+
onClick={() => setAsking(u)}
|
|
188
|
+
>
|
|
189
|
+
{W.discard}
|
|
190
|
+
</button>
|
|
191
|
+
) : null}
|
|
192
|
+
</li>
|
|
193
|
+
))}
|
|
194
|
+
</ul>
|
|
195
|
+
{ask ? (
|
|
196
|
+
<ConfirmAskDialog
|
|
197
|
+
over
|
|
198
|
+
title={ask.title}
|
|
199
|
+
body={ask.body}
|
|
200
|
+
confirm={ask.confirm}
|
|
201
|
+
busyLabel={ask.busy}
|
|
202
|
+
onConfirm={() => {
|
|
203
|
+
const u = asking;
|
|
204
|
+
setAsking(null);
|
|
205
|
+
onDiscard(u);
|
|
206
|
+
}}
|
|
207
|
+
onCancel={() => setAsking(null)}
|
|
208
|
+
/>
|
|
209
|
+
) : null}
|
|
210
|
+
</>
|
|
178
211
|
);
|
|
179
212
|
}
|
|
180
213
|
|
|
@@ -509,6 +509,12 @@
|
|
|
509
509
|
flex: none;
|
|
510
510
|
}
|
|
511
511
|
|
|
512
|
+
/* a failed Restore or merge, said inside the sheet (replaces window.alert) */
|
|
513
|
+
.dv-err {
|
|
514
|
+
margin: 0 var(--space-5) var(--space-3);
|
|
515
|
+
flex: none;
|
|
516
|
+
}
|
|
517
|
+
|
|
512
518
|
.dv-note {
|
|
513
519
|
color: var(--fg-2);
|
|
514
520
|
font-size: var(--type-xs);
|
|
@@ -43,13 +43,15 @@ import { AssetDetails } from '../assets/details.jsx';
|
|
|
43
43
|
import { GenerateAsk } from '../assets/generate-ask.jsx';
|
|
44
44
|
import { COPY_FAILED_LINE, copyAssetImage } from '../assets/copy-asset.js';
|
|
45
45
|
import { KindsChip } from '../assets/kinds-chip.jsx';
|
|
46
|
-
import { filterKind,
|
|
46
|
+
import { filterKind, libraryFootWords } from '../assets/library-foot.js';
|
|
47
47
|
import { runMeta, runTitle, splitGenerated, useGenerated } from '../assets/generated.js';
|
|
48
48
|
import { splitJustAdded } from '../assets/just-added.js';
|
|
49
49
|
import { placeAsset, placedWords, SELECT_ARTBOARD_LINE } from '../assets/place-asset.js';
|
|
50
50
|
import { ARRIVAL_LINES, addingLine, linkName } from '../assets/import-lines.js';
|
|
51
51
|
import { toastArrivals } from '../assets/import-toast.js';
|
|
52
52
|
import { SeenLine } from '../assets/search-marks.jsx';
|
|
53
|
+
import { AssetSpotlight } from '../assets/spotlight.jsx';
|
|
54
|
+
import { groupShown, narrowOrder, spotlightRows } from '../assets/spotlight-model.js';
|
|
53
55
|
import { AssetTile } from '../assets/tile.jsx';
|
|
54
56
|
import { AssetTileMenu, tileMenuItems } from '../assets/tile-menu.jsx';
|
|
55
57
|
import { ConfirmTrash, NotCountedNote, TidyFoot, tidyModel } from '../assets/tidy.jsx';
|
|
@@ -183,6 +185,8 @@ export function AssetsPanel({
|
|
|
183
185
|
const [picked, setPicked] = useState(null);
|
|
184
186
|
const [menu, setMenu] = useState(null);
|
|
185
187
|
const [details, setDetails] = useState(null);
|
|
188
|
+
// 2.0.4 (#191) — the tile opened large ({ path, order }): `order` is the tiles ← → walks, fixed when it opened
|
|
189
|
+
const [spot, setSpot] = useState(null);
|
|
186
190
|
// S8.13 — the wide Browse view (null = the narrow tab), the Not used filter, the confirm sheet and the Undo line
|
|
187
191
|
const [browse, setBrowse] = useState(null);
|
|
188
192
|
const [notUsedOnly, setNotUsedOnly] = useState(false);
|
|
@@ -366,6 +370,17 @@ export function AssetsPanel({
|
|
|
366
370
|
}, [query, describe.hits, shown, byPath, notUsedOnly, hasUsage]);
|
|
367
371
|
useAssetAnswers(); // the bars on tiles follow what the studio last said about each open canvas
|
|
368
372
|
const url = (p) => `/${designRel}/${p}`;
|
|
373
|
+
// 2.0.4 (#191) — a double-click (or Space on the picked tile, `assets.spotlight`) opens the tile large. ← → walk the tiles
|
|
374
|
+
// the tab draws now: the wide Browse view's order when it is open, else the groups as the narrow tab shows them.
|
|
375
|
+
const openSpotlight = (path) => {
|
|
376
|
+
if (!byPath.has(path)) return;
|
|
377
|
+
setMenu(null);
|
|
378
|
+
const order =
|
|
379
|
+
browse && assets
|
|
380
|
+
? browseOrder(assets, browse)
|
|
381
|
+
: narrowOrder(groups, seen, { uncapped: notUsedOnly && hasUsage });
|
|
382
|
+
setSpot({ path, order: order.includes(path) ? order : [path] });
|
|
383
|
+
};
|
|
369
384
|
const renderTile = (a, o = undefined) => (
|
|
370
385
|
<AssetTile
|
|
371
386
|
key={a.path}
|
|
@@ -376,6 +391,7 @@ export function AssetsPanel({
|
|
|
376
391
|
canDrag={!readOnly}
|
|
377
392
|
onPick={setPicked}
|
|
378
393
|
onMenu={openMenu}
|
|
394
|
+
onOpen={openSpotlight}
|
|
379
395
|
uploading={assetUploadOf(a.path)}
|
|
380
396
|
/>
|
|
381
397
|
);
|
|
@@ -583,6 +599,7 @@ export function AssetsPanel({
|
|
|
583
599
|
place,
|
|
584
600
|
placeMany,
|
|
585
601
|
showDetails,
|
|
602
|
+
openSpotlight,
|
|
586
603
|
trashSelection,
|
|
587
604
|
startRename,
|
|
588
605
|
readOnly,
|
|
@@ -607,6 +624,15 @@ export function AssetsPanel({
|
|
|
607
624
|
l.showDetails(one);
|
|
608
625
|
} else if (l.picked) l.showDetails(l.picked);
|
|
609
626
|
},
|
|
627
|
+
// 2.0.4 (#191) — Space on the picked tile: the same window a double-click opens
|
|
628
|
+
spotlight: () => {
|
|
629
|
+
const l = live.current;
|
|
630
|
+
if (l.sourceDs) dsApi.current?.spotlight();
|
|
631
|
+
else {
|
|
632
|
+
const one = l.browse ? l.browsePicked()[0] : l.picked;
|
|
633
|
+
if (one) l.openSpotlight(one);
|
|
634
|
+
}
|
|
635
|
+
},
|
|
610
636
|
rename: () => {
|
|
611
637
|
const l = live.current;
|
|
612
638
|
const one = l.browse ? l.browsePicked()[0] : l.picked;
|
|
@@ -659,14 +685,14 @@ export function AssetsPanel({
|
|
|
659
685
|
const menuItems = menu
|
|
660
686
|
? tileMenuItems(menu.asset, { readOnly, placeLabel, count: menuCount })
|
|
661
687
|
: [];
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
setMenu(null);
|
|
665
|
-
if (!path) return;
|
|
688
|
+
// the tile menu's rows and the spotlight's: one function (`single`: the spotlight acts on the one picture it shows)
|
|
689
|
+
const runTileAction = (id, path, { single = false } = {}) => {
|
|
666
690
|
if (id === 'place') {
|
|
667
|
-
if (browse && browse.selected.has(path) && browse.selected.size > 1)
|
|
691
|
+
if (!single && browse && browse.selected.has(path) && browse.selected.size > 1)
|
|
668
692
|
void placeMany(browsePicked());
|
|
669
693
|
else void place(path);
|
|
694
|
+
} else if (id === 'spotlight') {
|
|
695
|
+
openSpotlight(path);
|
|
670
696
|
} else if (id === 'details') {
|
|
671
697
|
setBrowse(null);
|
|
672
698
|
showDetails(path);
|
|
@@ -677,6 +703,48 @@ export function AssetsPanel({
|
|
|
677
703
|
} else if (id === 'rename') startRename(path);
|
|
678
704
|
else if (id === 'trash') trashSelection(path);
|
|
679
705
|
};
|
|
706
|
+
const onMenuSelect = (id) => {
|
|
707
|
+
const path = menu?.asset.path;
|
|
708
|
+
setMenu(null);
|
|
709
|
+
if (path) runTileAction(id, path);
|
|
710
|
+
};
|
|
711
|
+
|
|
712
|
+
// ── 2.0.4 (#191): the spotlight ────────────────────────────────────────────────────────────────────────────────
|
|
713
|
+
const spotItems = spot ? spot.order.map((p) => byPath.get(p)).filter(Boolean) : [];
|
|
714
|
+
const spotIndex = spot ? spotItems.findIndex((a) => a.path === spot.path) : -1;
|
|
715
|
+
// the tile the window was showing takes focus back (esc, the button and a click outside all end here)
|
|
716
|
+
const focusTile = (path) => {
|
|
717
|
+
const tile = Array.from(document.querySelectorAll('[data-testid="assets-tile"]')).find(
|
|
718
|
+
(el) => el.dataset.asset === path && el.getClientRects().length > 0
|
|
719
|
+
);
|
|
720
|
+
tile?.focus?.({ preventScroll: true });
|
|
721
|
+
};
|
|
722
|
+
const closeSpotlight = () => {
|
|
723
|
+
const path = spot?.path;
|
|
724
|
+
if (path) focusTile(path);
|
|
725
|
+
setSpot(null);
|
|
726
|
+
};
|
|
727
|
+
// stepping moves the pick with it, so what ↵ places and ⌘I opens is the picture you were looking at
|
|
728
|
+
const stepSpotlight = (i) => {
|
|
729
|
+
const a = spotItems[i];
|
|
730
|
+
if (!a) return;
|
|
731
|
+
setSpot((cur) => (cur ? { ...cur, path: a.path } : cur));
|
|
732
|
+
if (browse) patchBrowse({ ...pickTile(spot.order, browse, a.path, {}) });
|
|
733
|
+
else setPicked(a.path);
|
|
734
|
+
};
|
|
735
|
+
const spotRows =
|
|
736
|
+
spotIndex >= 0
|
|
737
|
+
? spotlightRows(
|
|
738
|
+
tileMenuItems(spotItems[spotIndex], { readOnly, placeLabel, count: 1 }).filter(
|
|
739
|
+
(r) => r.id !== 'spotlight'
|
|
740
|
+
)
|
|
741
|
+
)
|
|
742
|
+
: [];
|
|
743
|
+
const runSpotRow = (id) => {
|
|
744
|
+
const path = spotItems[spotIndex]?.path;
|
|
745
|
+
setSpot(null);
|
|
746
|
+
if (path) runTileAction(id, path, { single: true });
|
|
747
|
+
};
|
|
680
748
|
|
|
681
749
|
const detailed = details ? byPath.get(details) : null;
|
|
682
750
|
// Not used, narrowed by the search: the numbers on the foot are what is listed, so "Move N" moves what is shown
|
|
@@ -1154,10 +1222,7 @@ export function AssetsPanel({
|
|
|
1154
1222
|
</div>
|
|
1155
1223
|
) : (
|
|
1156
1224
|
<div className="lp-grid">
|
|
1157
|
-
{(g
|
|
1158
|
-
? g.items
|
|
1159
|
-
: g.items.slice(0, GROUP_CAP)
|
|
1160
|
-
).map(renderTile)}
|
|
1225
|
+
{groupShown(g, { uncapped: notUsedOnly && hasUsage }).map(renderTile)}
|
|
1161
1226
|
</div>
|
|
1162
1227
|
)}
|
|
1163
1228
|
</section>
|
|
@@ -1238,6 +1303,7 @@ export function AssetsPanel({
|
|
|
1238
1303
|
onChange={patchBrowse}
|
|
1239
1304
|
onPick={onBrowsePick}
|
|
1240
1305
|
onMenu={openMenu}
|
|
1306
|
+
onOpen={openSpotlight}
|
|
1241
1307
|
onBack={() => setBrowse(null)}
|
|
1242
1308
|
onClear={() => patchBrowse({ ...NOTHING_PICKED })}
|
|
1243
1309
|
onPlace={(paths) => void placeMany(paths)}
|
|
@@ -1257,6 +1323,17 @@ export function AssetsPanel({
|
|
|
1257
1323
|
/>
|
|
1258
1324
|
) : null}
|
|
1259
1325
|
<AssetTileMenu state={menu} items={menuItems} onSelect={onMenuSelect} onClose={closeMenu} />
|
|
1326
|
+
{spot && spotIndex >= 0 ? (
|
|
1327
|
+
<AssetSpotlight
|
|
1328
|
+
items={spotItems}
|
|
1329
|
+
index={spotIndex}
|
|
1330
|
+
urlOf={url}
|
|
1331
|
+
rows={spotRows}
|
|
1332
|
+
onIndex={stepSpotlight}
|
|
1333
|
+
onClose={closeSpotlight}
|
|
1334
|
+
onRow={runSpotRow}
|
|
1335
|
+
/>
|
|
1336
|
+
) : null}
|
|
1260
1337
|
</div>
|
|
1261
1338
|
);
|
|
1262
1339
|
}
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
18
18
|
|
|
19
19
|
import { trashClearRequest, trashRestoreRequest } from '../../../history/surface-requests.ts';
|
|
20
|
+
import { fetchIfServed } from '../shell/served-routes.js';
|
|
20
21
|
|
|
21
22
|
/** The app shell relays the bus's `trash:changed { seq }` as this window event. */
|
|
22
23
|
export const TRASH_CHANGED_EVENT = 'maude:trash-changed';
|
|
@@ -32,7 +33,7 @@ export function visibleTrash(j) {
|
|
|
32
33
|
/** Today's per-Mac list (`/_api/sync/trash`): "Kept on this Mac". Null when the route refuses. */
|
|
33
34
|
export async function fetchTrash(fetchImpl = fetch) {
|
|
34
35
|
try {
|
|
35
|
-
const r = await
|
|
36
|
+
const r = await fetchIfServed('/_api/sync/trash', undefined, fetchImpl);
|
|
36
37
|
if (!r.ok) return null;
|
|
37
38
|
const j = await r.json();
|
|
38
39
|
return j && Array.isArray(j.entries) ? visibleTrash(j) : null;
|
|
@@ -3,16 +3,18 @@
|
|
|
3
3
|
// shell command a sheet's button runs. Each sheet is a view (exported from ./index.js for S11.14), so Settings ›
|
|
4
4
|
// Connections mounts the same sheets with its own wiring.
|
|
5
5
|
//
|
|
6
|
-
// hub → /_home/hub/
|
|
7
|
-
//
|
|
6
|
+
// hub → /_home/hub/test; Sign in (#204 K2) → /_home/hub/signin/start, the shell opens the hub's
|
|
7
|
+
// own page (`open_team_server_signin`; with an invite, the hub's invite page), poll until
|
|
8
|
+
// the browser came back, then /_home/hub/prepare and Home's own open of the managed copy
|
|
8
9
|
// folder-github → the shell's folder picker (`open_project_folder`); "From GitHub" (S6.10) → Rust's
|
|
9
10
|
// github_repos / home_github_sign_in / github_clone / github_create, then `open_project({root})`
|
|
10
11
|
// ai → /_home/ai/{status,connect} (install Claude Code, then the browser sign-in)
|
|
11
12
|
// cli → /_home/cli/{status,install} (a link to the bundled maude; the plugin when claude is there)
|
|
12
13
|
// figma → the target project opens with the `import-figma` intent (Q8)
|
|
13
14
|
//
|
|
14
|
-
// No credential reaches a log or comes back into the page: the
|
|
15
|
-
// own
|
|
15
|
+
// No credential reaches a log or comes back into the page: the app owns no team-server password (the hub's
|
|
16
|
+
// own page in the browser takes it, issue #204); the AI sign-in is the person's browser; nothing here stores
|
|
17
|
+
// a token.
|
|
16
18
|
|
|
17
19
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
18
20
|
|
|
@@ -21,12 +23,15 @@ import {
|
|
|
21
23
|
aiStatus,
|
|
22
24
|
cliInstall,
|
|
23
25
|
cliStatus,
|
|
24
|
-
hubJoin,
|
|
25
26
|
hubPrepare,
|
|
27
|
+
hubSignInCancel,
|
|
28
|
+
hubSignInPoll,
|
|
29
|
+
hubSignInStart,
|
|
26
30
|
hubTest,
|
|
27
31
|
inShell,
|
|
28
32
|
openProject,
|
|
29
33
|
openProjectFolder,
|
|
34
|
+
openTeamServerSignIn,
|
|
30
35
|
shellListen,
|
|
31
36
|
} from '../../home/home-api.js';
|
|
32
37
|
import { useGithubSegment } from './GithubSegment.jsx';
|
|
@@ -180,6 +185,95 @@ function FigmaHost({ target, onClose, startFigma }) {
|
|
|
180
185
|
return <FigmaSheet target={target} busy={busy} error={error} onImport={go} onCancel={onClose} />;
|
|
181
186
|
}
|
|
182
187
|
|
|
188
|
+
/** How often Home asks whether the browser came back (the hub's code lives a minute). */
|
|
189
|
+
export const HUB_POLL_MS = 1500;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* #204 K2 — the hub sheet's host: Sign in opens the hub's own page and waits for the browser to come back to
|
|
193
|
+
* Home's server; Cancel forgets the attempt (a late return then changes nothing). `pollMs` is a test seam.
|
|
194
|
+
*/
|
|
195
|
+
function HubHost({ onClose, profile, openPrepared, pollMs = HUB_POLL_MS }) {
|
|
196
|
+
const attempt = useRef(null); // { id, stop: (r) => void }
|
|
197
|
+
useEffect(
|
|
198
|
+
() => () => {
|
|
199
|
+
const a = attempt.current;
|
|
200
|
+
attempt.current = null;
|
|
201
|
+
if (a) {
|
|
202
|
+
a.stop({ ok: false, cancelled: true });
|
|
203
|
+
void hubSignInCancel(a.id);
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
[]
|
|
207
|
+
);
|
|
208
|
+
|
|
209
|
+
const waitForBrowser = (id) =>
|
|
210
|
+
new Promise((resolve) => {
|
|
211
|
+
let timer = null;
|
|
212
|
+
const stop = (r) => {
|
|
213
|
+
clearTimeout(timer);
|
|
214
|
+
resolve(r);
|
|
215
|
+
};
|
|
216
|
+
attempt.current = { id, stop };
|
|
217
|
+
const tick = async () => {
|
|
218
|
+
const p = await hubSignInPoll(id);
|
|
219
|
+
if (attempt.current?.id !== id) return; // cancelled meanwhile
|
|
220
|
+
if (p.json?.pending) {
|
|
221
|
+
timer = setTimeout(tick, pollMs);
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
attempt.current = null;
|
|
225
|
+
stop(
|
|
226
|
+
p.ok && p.json?.ok && p.json.url
|
|
227
|
+
? { ok: true, url: p.json.url }
|
|
228
|
+
: { ok: false, error: p.json?.error || HUB_WORDS.unreachable }
|
|
229
|
+
);
|
|
230
|
+
};
|
|
231
|
+
timer = setTimeout(tick, 0); // the first ask at once, then every pollMs
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
return (
|
|
235
|
+
<HubSheet
|
|
236
|
+
onCancel={onClose}
|
|
237
|
+
onTest={async (url) => {
|
|
238
|
+
const r = await hubTest(url);
|
|
239
|
+
return r.json?.ok
|
|
240
|
+
? { ok: true, version: r.json.version ?? null }
|
|
241
|
+
: { ok: false, error: r.json?.error || HUB_WORDS.unreachable };
|
|
242
|
+
}}
|
|
243
|
+
onSignIn={async ({ url, invite, onWaiting }) => {
|
|
244
|
+
const s = await hubSignInStart(profile, url, invite);
|
|
245
|
+
if (!s.ok || !s.json?.ok)
|
|
246
|
+
return { ok: false, error: s.json?.error || HUB_WORDS.unreachable };
|
|
247
|
+
const id = s.json.id;
|
|
248
|
+
const opened = await openTeamServerSignIn(s.json.signInUrl);
|
|
249
|
+
if (opened !== 'ok') {
|
|
250
|
+
void hubSignInCancel(id);
|
|
251
|
+
return {
|
|
252
|
+
ok: false,
|
|
253
|
+
error: opened === 'refused' ? HUB_WORDS.refused : HUB_WORDS.noBrowser,
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
onWaiting();
|
|
257
|
+
const done = await waitForBrowser(id);
|
|
258
|
+
if (!done.ok) return done;
|
|
259
|
+
const r = await hubPrepare(profile, done.url);
|
|
260
|
+
if (!r.ok || !r.json?.ok)
|
|
261
|
+
return { ok: false, error: r.json?.error || HUB_WORDS.unreachable };
|
|
262
|
+
await openPrepared(r, r.json.name, profile);
|
|
263
|
+
onClose();
|
|
264
|
+
return { ok: true };
|
|
265
|
+
}}
|
|
266
|
+
onAbortSignIn={() => {
|
|
267
|
+
const a = attempt.current;
|
|
268
|
+
attempt.current = null;
|
|
269
|
+
if (!a) return;
|
|
270
|
+
void hubSignInCancel(a.id);
|
|
271
|
+
a.stop({ ok: false, cancelled: true });
|
|
272
|
+
}}
|
|
273
|
+
/>
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
|
|
183
277
|
/**
|
|
184
278
|
* @param {{ open: string|null, onClose: () => void, profile: string, target?: object|null,
|
|
185
279
|
* openPrepared: (prep: object, name: string, profile: string) => Promise<unknown>,
|
|
@@ -199,34 +293,7 @@ export function AdvancedSheets({
|
|
|
199
293
|
github = null,
|
|
200
294
|
}) {
|
|
201
295
|
if (open === 'hub')
|
|
202
|
-
return
|
|
203
|
-
<HubSheet
|
|
204
|
-
onCancel={onClose}
|
|
205
|
-
onTest={async (url) => {
|
|
206
|
-
const r = await hubTest(url);
|
|
207
|
-
return r.json?.ok
|
|
208
|
-
? { ok: true, version: r.json.version ?? null }
|
|
209
|
-
: { ok: false, error: r.json?.error || HUB_WORDS.unreachable };
|
|
210
|
-
}}
|
|
211
|
-
onConnect={async ({ url, email, password }) => {
|
|
212
|
-
const r = await hubPrepare(profile, url, email || password ? { email, password } : null);
|
|
213
|
-
if (!r.ok || !r.json?.ok)
|
|
214
|
-
return { ok: false, error: r.json?.error || HUB_WORDS.unreachable };
|
|
215
|
-
await openPrepared(r, r.json.name, profile);
|
|
216
|
-
onClose();
|
|
217
|
-
return { ok: true };
|
|
218
|
-
}}
|
|
219
|
-
// S6.11b — "Invite link or key": the hub's own invite redeem, then the same open
|
|
220
|
-
onJoin={async ({ url, token, email, password }) => {
|
|
221
|
-
const r = await hubJoin(profile, url, { token, email, password });
|
|
222
|
-
if (!r.ok || !r.json?.ok)
|
|
223
|
-
return { ok: false, error: r.json?.error || HUB_WORDS.unreachable };
|
|
224
|
-
await openPrepared(r, r.json.name, profile);
|
|
225
|
-
onClose();
|
|
226
|
-
return { ok: true };
|
|
227
|
-
}}
|
|
228
|
-
/>
|
|
229
|
-
);
|
|
296
|
+
return <HubHost onClose={onClose} profile={profile} openPrepared={openPrepared} />;
|
|
230
297
|
if (open === 'folder-github')
|
|
231
298
|
return (
|
|
232
299
|
<FolderHost onClose={onClose} openFolder={openFolder} profile={profile} github={github} />
|