@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.
- package/apps/studio/access/request.ts +1 -0
- package/apps/studio/actions/agents.ts +27 -0
- package/apps/studio/actions/defs/app.ts +28 -1
- package/apps/studio/actions/defs/sync.ts +4 -0
- package/apps/studio/actions.manifest.json +60 -2
- package/apps/studio/actions.parity.json +13 -1
- package/apps/studio/bin/_curl-local.mjs +7 -4
- package/apps/studio/client/app.jsx +16 -4
- package/apps/studio/client/home/HomeAccountsRow.jsx +221 -0
- package/apps/studio/client/home/HomeConnection.jsx +111 -0
- package/apps/studio/client/home/home-accounts-model.js +110 -1
- package/apps/studio/client/home/home-api.js +6 -2
- package/apps/studio/client/home/home-app.jsx +74 -12
- package/apps/studio/client/home/home-model.js +40 -1
- package/apps/studio/client/home/home-where-model.js +105 -0
- package/apps/studio/client/home/home.css +233 -1
- package/apps/studio/client/hooks/use-palette-and-panels.jsx +3 -1
- package/apps/studio/client/hooks/use-tabs.jsx +11 -4
- package/apps/studio/client/panels/TeamProjects.jsx +137 -134
- package/apps/studio/client/share-link.js +12 -0
- package/apps/studio/client/styles/_index.css +4 -0
- package/apps/studio/client/v2/diagnostics/diagnostics-host.jsx +1 -0
- package/apps/studio/client/v2/diagnostics/diagnostics-model.js +32 -2
- package/apps/studio/client/v2/diagnostics/diagnostics-sheet.jsx +35 -8
- package/apps/studio/client/v2/diagnostics/diagnostics.css +34 -0
- package/apps/studio/client/v2/diagnostics/sync-details/sync-details-model.js +94 -3
- package/apps/studio/client/v2/diagnostics/sync-details/sync-details.jsx +187 -4
- package/apps/studio/client/v2/link-server/LinkServerDialog.jsx +492 -0
- package/apps/studio/client/v2/link-server/LinkServerHost.jsx +42 -0
- package/apps/studio/client/v2/link-server/link-server-api.js +142 -0
- package/apps/studio/client/v2/link-server/link-server-model.js +438 -0
- package/apps/studio/client/v2/link-server/link-server.css +109 -0
- package/apps/studio/client/v2/onboarding/AdvancedSheets.jsx +31 -86
- package/apps/studio/client/v2/onboarding/onboarding-model.js +1 -18
- package/apps/studio/client/v2/search/search-keywords.js +3 -2
- package/apps/studio/client/v2/settings/account.jsx +4 -2
- package/apps/studio/client/v2/settings/advanced-section.jsx +245 -148
- package/apps/studio/client/v2/settings/connection-row.jsx +3 -59
- package/apps/studio/client/v2/settings/connections-section.jsx +118 -425
- package/apps/studio/client/v2/settings/general-section.jsx +138 -43
- package/apps/studio/client/v2/settings/project-sync-settings.jsx +4 -3
- package/apps/studio/client/v2/settings/reset-section.jsx +14 -3
- package/apps/studio/client/v2/settings/settings-card.jsx +142 -0
- package/apps/studio/client/v2/settings/settings-cards.js +220 -0
- package/apps/studio/client/v2/settings/settings-handlers.js +7 -6
- package/apps/studio/client/v2/settings/settings-model.js +91 -31
- package/apps/studio/client/v2/settings/settings-sheet.jsx +25 -6
- package/apps/studio/client/v2/settings/settings.css +374 -64
- package/apps/studio/client/v2/settings/this-project-card.jsx +730 -0
- package/apps/studio/client/v2/settings/this-project-model.js +172 -0
- package/apps/studio/client/v2/settings/use-connections.js +3 -2
- package/apps/studio/client/v2/settings/use-open-card.js +37 -0
- package/apps/studio/client/v2/shell/connection-state.js +197 -0
- package/apps/studio/client/v2/shell/menu-runner.js +7 -2
- package/apps/studio/client/v2/shell/project-account-bus.js +36 -0
- package/apps/studio/client/v2/shell/project-account-card.jsx +357 -148
- package/apps/studio/client/v2/shell/project-account-model.js +272 -149
- package/apps/studio/client/v2/shell/project-account-toast.js +66 -0
- package/apps/studio/client/v2/shell/project-account.css +237 -0
- package/apps/studio/client/v2/shell/share-cluster-host.jsx +166 -83
- package/apps/studio/client/v2/shell/shell-parity.js +3 -2
- package/apps/studio/client/v2/shell/shell-parity.json +40 -26
- package/apps/studio/client/v2/shell/use-account.js +2 -0
- package/apps/studio/client/v2/signin/use-signin.js +1 -1
- package/apps/studio/cloud/endpoints.ts +29 -4
- package/apps/studio/dist/client.bundle.js +834 -834
- package/apps/studio/dist/styles.css +1 -1
- package/apps/studio/home/accounts.ts +30 -11
- package/apps/studio/home/cloud.ts +6 -1
- package/apps/studio/home/hub-health.ts +76 -0
- package/apps/studio/home/routes.ts +9 -3
- package/apps/studio/http.ts +8 -0
- package/apps/studio/migrate/hub.ts +8 -1
- package/apps/studio/routes/hub-link-folder.ts +334 -0
- package/apps/studio/routes/hub-signin.ts +78 -1
- package/apps/studio/routes/index.ts +4 -0
- package/apps/studio/routes/sync.ts +22 -4
- package/apps/studio/shell/api-key.ts +11 -0
- package/apps/studio/sync/accepted-cold-start.ts +144 -8
- package/apps/studio/sync/action-stage.ts +18 -1
- package/apps/studio/sync/ctl-heal.ts +58 -0
- package/apps/studio/sync/file-ledger.ts +38 -4
- package/apps/studio/sync/file-plane.ts +226 -19
- package/apps/studio/sync/held-deletes.ts +86 -5
- package/apps/studio/sync/hub-link.ts +8 -0
- package/apps/studio/sync/index.ts +68 -4
- package/apps/studio/sync/link-consent.ts +22 -75
- package/apps/studio/sync/link-survey.ts +252 -0
- package/apps/studio/sync/local-kernel.ts +16 -1
- package/apps/studio/sync/seed-progress.ts +12 -0
- package/apps/studio/sync/source-recovery.ts +18 -2
- package/apps/studio/sync/status.ts +11 -1
- package/apps/studio/sync/writer-registry.ts +5 -0
- package/apps/studio/whats-new.json +18 -0
- package/cli/lib/bash-guard.mjs +19 -0
- package/cli/lib/design-help.gen.mjs +1 -1
- package/package.json +9 -8
- package/apps/studio/client/v2/onboarding/HubSheet.jsx +0 -212
- package/apps/studio/client/v2/shell/account-card-model.js +0 -114
- package/apps/studio/client/v2/shell/account-card.jsx +0 -189
|
@@ -1,229 +1,48 @@
|
|
|
1
|
-
// client/v2/settings/connections-section.jsx — S11.14: Settings › Connections (06 ad-edge-hub;
|
|
1
|
+
// client/v2/settings/connections-section.jsx — S11.14: Settings › Connections (06 ad-edge-hub; D12, D14).
|
|
2
|
+
// 2.1.1 T6 (canvas 17 · 10): one column of cards, only the person's own integrations —
|
|
2
3
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// Hub version maude-hub 2.0.0
|
|
9
|
-
// ⌁ GitHub Not connected [Connect] › Advanced
|
|
10
|
-
// ✦ AI images, video and voice 2 keys · Gemini, ElevenLabs [Manage] › Advanced
|
|
11
|
-
// ▢ Figma Connected · for imports [Test] [Disconnect] › Advanced
|
|
4
|
+
// ✦ AI — your Claude account Pro or Max, or an API key. ● Connected [Change…] ›
|
|
5
|
+
// ▢ Figma For Import from Figma. ● Not connected [Add token…] ›
|
|
6
|
+
// ⌁ GitHub GitHub projects and invites… ● Connected as @… [Disconnect] ›
|
|
7
|
+
// ▣ AI images, video and voice Your own keys for pictures… ● 2 keys · … [Manage…] ›
|
|
8
|
+
// Which account a project uses, and where it lives, is in General › This project.
|
|
12
9
|
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
10
|
+
// Claude, Figma, GitHub and the AI providers follow the person into every project. Maude Cloud and your
|
|
11
|
+
// team's own server belong to a project, so they moved to General › This project (this-project-card.jsx):
|
|
12
|
+
// the cloud account and its projects on this Mac (D11), the server's address, masked token and Replace…
|
|
13
|
+
// (D12), its Sign out. Every card runs on the hooks in use-connections.js; the mono words live only under
|
|
14
|
+
// a card's own Advanced fold (`connections.<row>`).
|
|
18
15
|
//
|
|
19
16
|
// Desktop only (`cloud === null`): a browser tab has no keychain, and the routes behind these rows are
|
|
20
17
|
// refused in a cell by design (DDR-209 D1). The sheet doesn't render this section there.
|
|
21
18
|
|
|
22
19
|
import { useState } from 'react';
|
|
23
20
|
|
|
24
|
-
import {
|
|
25
|
-
CloudDeviceDialog,
|
|
26
|
-
isLinkedProjectRow,
|
|
27
|
-
openExternal,
|
|
28
|
-
shareViewUrl,
|
|
29
|
-
} from '../../panels/CloudBar.jsx';
|
|
21
|
+
import { openExternal } from '../../panels/CloudBar.jsx';
|
|
30
22
|
import { GitHubDeviceDialog } from '../../panels/IdentityBar.jsx';
|
|
31
23
|
import { ProviderCard } from '../../panels/SettingsPanel.jsx';
|
|
32
|
-
import { TeamProjectsDialog } from '../../panels/TeamProjects.jsx';
|
|
33
24
|
import { ConnectSheet } from '../ai/ConnectSheet.jsx';
|
|
34
|
-
import {
|
|
25
|
+
import { reasonProps } from '../access/disabled-reason.js';
|
|
26
|
+
import { ConnField } from './connection-row.jsx';
|
|
35
27
|
import {
|
|
36
28
|
claudeRow,
|
|
37
|
-
|
|
29
|
+
connectionFoldId,
|
|
38
30
|
figmaRow,
|
|
39
31
|
figmaTestWords,
|
|
40
32
|
githubRow,
|
|
41
|
-
hubRow,
|
|
42
|
-
maskedToken,
|
|
43
33
|
providerSummary,
|
|
44
34
|
} from './connections-model.js';
|
|
35
|
+
import { SettingsCard } from './settings-card.jsx';
|
|
45
36
|
import {
|
|
46
37
|
useClaudeAccount,
|
|
47
|
-
useCloudConnection,
|
|
48
38
|
useFigmaConnection,
|
|
49
39
|
useGitHubConnection,
|
|
50
|
-
useHubDetails,
|
|
51
40
|
useProviderKeys,
|
|
52
41
|
} from './use-connections.js';
|
|
53
|
-
import {
|
|
42
|
+
import { useOpenCard } from './use-open-card.js';
|
|
54
43
|
|
|
55
44
|
const btn = 'btn btn--sm';
|
|
56
|
-
|
|
57
|
-
function CloudProjects({ c }) {
|
|
58
|
-
const { projects, local, cloudUrl, busy } = c;
|
|
59
|
-
if (projects === null)
|
|
60
|
-
return (
|
|
61
|
-
<div className="v2s-conn-li" aria-disabled="true">
|
|
62
|
-
Loading projects…
|
|
63
|
-
</div>
|
|
64
|
-
);
|
|
65
|
-
if (projects.length === 0)
|
|
66
|
-
return (
|
|
67
|
-
<div className="v2s-conn-li" aria-disabled="true">
|
|
68
|
-
No projects yet — start one on the dashboard.
|
|
69
|
-
</div>
|
|
70
|
-
);
|
|
71
|
-
return projects.map((p) => {
|
|
72
|
-
const name = p.name || p.id;
|
|
73
|
-
// Viewer dignity (Phase 17 T4): no dead Connect that would 403 at the workspace — viewing has a
|
|
74
|
-
// first-class home in the browser, and the label says why.
|
|
75
|
-
if (p.role === 'viewer')
|
|
76
|
-
return (
|
|
77
|
-
<div className="v2s-conn-li" key={p.id}>
|
|
78
|
-
<button
|
|
79
|
-
type="button"
|
|
80
|
-
className="btn btn--ghost btn--sm"
|
|
81
|
-
onClick={() => openExternal(shareViewUrl(p.url, p.id))}
|
|
82
|
-
title="Viewing works in the browser. Editing in the app needs the member role — ask whoever runs the project."
|
|
83
|
-
data-testid={`cloud-project-${p.id}`}
|
|
84
|
-
>
|
|
85
|
-
{`View ${name} in the browser`}
|
|
86
|
-
</button>
|
|
87
|
-
</div>
|
|
88
|
-
);
|
|
89
|
-
const linked = isLinkedProjectRow({
|
|
90
|
-
projectUrl: p.url,
|
|
91
|
-
linkedHubUrl: local.linkedHub?.url,
|
|
92
|
-
linkedHubCredentialed: local.linkedHub?.credentialed,
|
|
93
|
-
cloudUrl,
|
|
94
|
-
});
|
|
95
|
-
return linked ? (
|
|
96
|
-
<div className="v2s-conn-li is-connected" key={p.id} data-testid={`cloud-project-${p.id}`}>
|
|
97
|
-
<span>{name}</span>
|
|
98
|
-
<span className="v2s-conn-s v2s-conn-s--ok">Connected</span>
|
|
99
|
-
<button
|
|
100
|
-
type="button"
|
|
101
|
-
className="btn btn--ghost btn--sm"
|
|
102
|
-
disabled={busy === 'disconnect'}
|
|
103
|
-
onClick={c.disconnect}
|
|
104
|
-
aria-label={`Disconnect this folder from ${name}`}
|
|
105
|
-
data-testid={`cloud-disconnect-${p.id}`}
|
|
106
|
-
>
|
|
107
|
-
{busy === 'disconnect' ? 'Disconnecting…' : 'Disconnect'}
|
|
108
|
-
</button>
|
|
109
|
-
</div>
|
|
110
|
-
) : (
|
|
111
|
-
<div className="v2s-conn-li" key={p.id}>
|
|
112
|
-
<span>{name}</span>
|
|
113
|
-
<button
|
|
114
|
-
type="button"
|
|
115
|
-
className="btn btn--ghost btn--sm"
|
|
116
|
-
disabled={busy === p.id}
|
|
117
|
-
onClick={() => c.connect(p.id)}
|
|
118
|
-
title={`Connect this folder to ${name}`}
|
|
119
|
-
data-testid={`cloud-project-${p.id}`}
|
|
120
|
-
>
|
|
121
|
-
{busy === p.id ? 'Connecting…' : `Connect ${name}`}
|
|
122
|
-
</button>
|
|
123
|
-
</div>
|
|
124
|
-
);
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/** Replace… — a password field, sent once through `POST /_api/hub/link`, then cleared. */
|
|
129
|
-
function ReplaceToken({ hub }) {
|
|
130
|
-
const [open, setOpen] = useState(false);
|
|
131
|
-
const [value, setValue] = useState('');
|
|
132
|
-
if (!open)
|
|
133
|
-
return (
|
|
134
|
-
<button
|
|
135
|
-
type="button"
|
|
136
|
-
className="btn btn--ghost btn--sm"
|
|
137
|
-
onClick={() => setOpen(true)}
|
|
138
|
-
data-testid="settings-hub-token-replace"
|
|
139
|
-
>
|
|
140
|
-
Replace…
|
|
141
|
-
</button>
|
|
142
|
-
);
|
|
143
|
-
const done = async () => {
|
|
144
|
-
const ok = await hub.replace(value);
|
|
145
|
-
setValue('');
|
|
146
|
-
if (ok) setOpen(false);
|
|
147
|
-
};
|
|
148
|
-
return (
|
|
149
|
-
<span className="v2s-conn-replace">
|
|
150
|
-
<input
|
|
151
|
-
className="input"
|
|
152
|
-
type="password"
|
|
153
|
-
autoComplete="off"
|
|
154
|
-
spellCheck={false}
|
|
155
|
-
value={value}
|
|
156
|
-
placeholder="Paste the new token"
|
|
157
|
-
aria-label="New access token"
|
|
158
|
-
onChange={(e) => setValue(e.target.value)}
|
|
159
|
-
onKeyDown={(e) => {
|
|
160
|
-
if (e.key === 'Enter') done();
|
|
161
|
-
if (e.key === 'Escape') {
|
|
162
|
-
setValue('');
|
|
163
|
-
setOpen(false);
|
|
164
|
-
}
|
|
165
|
-
}}
|
|
166
|
-
data-testid="settings-hub-token-input"
|
|
167
|
-
/>
|
|
168
|
-
<button
|
|
169
|
-
type="button"
|
|
170
|
-
className={btn}
|
|
171
|
-
disabled={hub.busy || !value.trim()}
|
|
172
|
-
onClick={done}
|
|
173
|
-
data-testid="settings-hub-token-save"
|
|
174
|
-
>
|
|
175
|
-
{hub.busy ? 'Saving…' : 'Replace'}
|
|
176
|
-
</button>
|
|
177
|
-
<button
|
|
178
|
-
type="button"
|
|
179
|
-
className="btn btn--ghost btn--sm"
|
|
180
|
-
onClick={() => {
|
|
181
|
-
setValue('');
|
|
182
|
-
setOpen(false);
|
|
183
|
-
}}
|
|
184
|
-
>
|
|
185
|
-
Cancel
|
|
186
|
-
</button>
|
|
187
|
-
</span>
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/** The linked workspace's address + masked token — under the row the link belongs to. */
|
|
192
|
-
function HubFields({ url, hub, replace, credentialed }) {
|
|
193
|
-
const d = hub.details;
|
|
194
|
-
// Until the details answer, the link's own corroboration says whether a token is stored at all.
|
|
195
|
-
const stored = d ? d.credentialed : !!credentialed;
|
|
196
|
-
return (
|
|
197
|
-
<div data-testid="settings-hub-address">
|
|
198
|
-
<ConnField k="Address" mono copy={url}>
|
|
199
|
-
{url}
|
|
200
|
-
</ConnField>
|
|
201
|
-
<ConnField k="Access token" mono testid="settings-hub-token">
|
|
202
|
-
<span className="v2s-conn-inline">
|
|
203
|
-
{stored ? maskedToken(d?.tokenLast4) : 'None saved for this folder'}
|
|
204
|
-
{replace && stored ? <ReplaceToken hub={hub} /> : null}
|
|
205
|
-
</span>
|
|
206
|
-
</ConnField>
|
|
207
|
-
{/* P8-T G1b-3 (06 ad-edge-hub): who this credential signed in as. A credential from before the
|
|
208
|
-
field existed carries none — no line, never an error. */}
|
|
209
|
-
{typeof d?.account === 'string' && d.account ? (
|
|
210
|
-
<ConnField k="Signed in as" mono testid="settings-hub-account">
|
|
211
|
-
{d.account}
|
|
212
|
-
</ConnField>
|
|
213
|
-
) : null}
|
|
214
|
-
{d?.version ? (
|
|
215
|
-
<ConnField k="Hub version" mono testid="settings-hub-version">
|
|
216
|
-
{d.version}
|
|
217
|
-
</ConnField>
|
|
218
|
-
) : null}
|
|
219
|
-
{hub.error ? (
|
|
220
|
-
<p className="v2s-conn-err" role="alert">
|
|
221
|
-
{hub.error}
|
|
222
|
-
</p>
|
|
223
|
-
) : null}
|
|
224
|
-
</div>
|
|
225
|
-
);
|
|
226
|
-
}
|
|
45
|
+
const swOf = (tone) => (tone === 'ok' ? 'ok' : 'off');
|
|
227
46
|
|
|
228
47
|
export function FigmaToken({ f }) {
|
|
229
48
|
const [value, setValue] = useState('');
|
|
@@ -279,199 +98,55 @@ export function FigmaToken({ f }) {
|
|
|
279
98
|
);
|
|
280
99
|
}
|
|
281
100
|
|
|
282
|
-
export default function ConnectionsSection({
|
|
283
|
-
const cloud = useCloudConnection({ onLinkedHub, onLocalProject, syncStatus });
|
|
101
|
+
export default function ConnectionsSection({ focus = null }) {
|
|
284
102
|
const gh = useGitHubConnection();
|
|
285
103
|
const keys = useProviderKeys();
|
|
286
104
|
const figma = useFigmaConnection();
|
|
287
105
|
const claude = useClaudeAccount();
|
|
288
|
-
const
|
|
289
|
-
const [
|
|
290
|
-
const [teamOpen, setTeamOpen] = useState(false);
|
|
291
|
-
const [keysOpen, setKeysOpen] = useState(false);
|
|
106
|
+
const { open, toggle, show } = useOpenCard('connections', focus);
|
|
107
|
+
const [connecting, setConnecting] = useState(false);
|
|
292
108
|
|
|
293
|
-
const linkedUrl = cloud.local.linkedHub?.url ?? null;
|
|
294
|
-
const team = hubRow({
|
|
295
|
-
linkedHub: cloud.local.linkedHub,
|
|
296
|
-
cloudUrl: cloud.cloudUrl,
|
|
297
|
-
project: cloud.local.project,
|
|
298
|
-
lastSyncAt: syncStatus?.lastSyncAt,
|
|
299
|
-
});
|
|
300
|
-
const hub = useHubDetails(linkedUrl);
|
|
301
|
-
const cr = cloudRow({ state: cloud.state, email: cloud.email });
|
|
302
109
|
const gr = githubRow({ native: gh.native, state: gh.state, login: gh.login });
|
|
303
110
|
const cl = claudeRow(claude.state);
|
|
304
111
|
const fr = figmaRow(figma.status);
|
|
305
112
|
const tested = figmaTestWords(figma.test);
|
|
306
|
-
|
|
307
|
-
if (cloud.state === 'loading') return null;
|
|
113
|
+
const card = (id) => ({ open: open === id, onToggle: toggle, reveal: focus?.card === id });
|
|
308
114
|
|
|
309
115
|
return (
|
|
310
|
-
<div className="v2s-
|
|
311
|
-
<
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
icon="cloud"
|
|
315
|
-
title="Maude Cloud"
|
|
316
|
-
desc="Where your projects live."
|
|
317
|
-
rowTestid={cloud.state === 'in' ? 'cloud-account' : undefined}
|
|
318
|
-
status={cr.status}
|
|
319
|
-
tone={cr.tone}
|
|
320
|
-
action={
|
|
321
|
-
cr.action === 'sign-out' ? (
|
|
322
|
-
<button
|
|
323
|
-
type="button"
|
|
324
|
-
className={btn}
|
|
325
|
-
disabled={cloud.busy === 'signout'}
|
|
326
|
-
onClick={cloud.signOut}
|
|
327
|
-
data-testid="cloud-sign-out"
|
|
328
|
-
>
|
|
329
|
-
Sign out
|
|
330
|
-
</button>
|
|
331
|
-
) : cr.action === 'sign-in' ? (
|
|
332
|
-
<button
|
|
333
|
-
type="button"
|
|
334
|
-
className={btn}
|
|
335
|
-
onClick={cloud.startSignIn}
|
|
336
|
-
data-testid="cloud-signin"
|
|
337
|
-
>
|
|
338
|
-
Sign in
|
|
339
|
-
</button>
|
|
340
|
-
) : null
|
|
341
|
-
}
|
|
342
|
-
advanced={
|
|
343
|
-
<>
|
|
344
|
-
{cloud.cloudUrl ? (
|
|
345
|
-
<ConnField k="Address" mono copy={cloud.cloudUrl}>
|
|
346
|
-
{cloud.cloudUrl}
|
|
347
|
-
</ConnField>
|
|
348
|
-
) : null}
|
|
349
|
-
{cloud.email ? (
|
|
350
|
-
<ConnField k="Signed in as" mono>
|
|
351
|
-
{cloud.email}
|
|
352
|
-
</ConnField>
|
|
353
|
-
) : null}
|
|
354
|
-
{linkedUrl && !team.linked ? (
|
|
355
|
-
<HubFields
|
|
356
|
-
url={linkedUrl}
|
|
357
|
-
hub={hub}
|
|
358
|
-
credentialed={cloud.local.linkedHub?.credentialed}
|
|
359
|
-
/>
|
|
360
|
-
) : null}
|
|
361
|
-
</>
|
|
362
|
-
}
|
|
363
|
-
>
|
|
364
|
-
{/* `cloud-bar`: the account's own words — the projects, the Connect outcome, an error. */}
|
|
365
|
-
<div className="v2s-conn-body" data-testid="cloud-bar">
|
|
366
|
-
{cloud.state === 'in' ? (
|
|
367
|
-
<div className="v2s-conn-list">
|
|
368
|
-
<p className="v2s-conn-h">Cloud projects on this Mac</p>
|
|
369
|
-
<div data-testid="settings-cloud-projects">
|
|
370
|
-
<CloudProjects c={cloud} />
|
|
371
|
-
</div>
|
|
372
|
-
{cloud.note ? (
|
|
373
|
-
<p
|
|
374
|
-
className="v2s-hint"
|
|
375
|
-
role="status"
|
|
376
|
-
aria-live="polite"
|
|
377
|
-
data-testid="cloud-connect-note"
|
|
378
|
-
>
|
|
379
|
-
{cloud.note.text}
|
|
380
|
-
</p>
|
|
381
|
-
) : null}
|
|
382
|
-
</div>
|
|
383
|
-
) : null}
|
|
384
|
-
{cloud.error ? (
|
|
385
|
-
<p className="v2s-conn-err" role="alert">
|
|
386
|
-
{cloud.error}
|
|
387
|
-
</p>
|
|
388
|
-
) : null}
|
|
389
|
-
</div>
|
|
390
|
-
</ConnectionRow>
|
|
391
|
-
|
|
392
|
-
<ConnectionRow
|
|
393
|
-
row="hub"
|
|
394
|
-
icon="box"
|
|
395
|
-
title={team.title}
|
|
396
|
-
desc="A self-hosted server, beside Maude Cloud."
|
|
397
|
-
status={team.status}
|
|
398
|
-
tone={team.tone}
|
|
399
|
-
action={
|
|
400
|
-
team.action === 'sign-out' ? (
|
|
401
|
-
<button
|
|
402
|
-
type="button"
|
|
403
|
-
className={btn}
|
|
404
|
-
disabled={cloud.busy === 'disconnect'}
|
|
405
|
-
onClick={cloud.disconnect}
|
|
406
|
-
data-testid="settings-hub-sign-out"
|
|
407
|
-
>
|
|
408
|
-
Sign out
|
|
409
|
-
</button>
|
|
410
|
-
) : (
|
|
411
|
-
<button
|
|
412
|
-
type="button"
|
|
413
|
-
className={btn}
|
|
414
|
-
onClick={() => setTeamOpen(true)}
|
|
415
|
-
data-testid="settings-team-server-add"
|
|
416
|
-
>
|
|
417
|
-
{team.action === 'sign-in' ? 'Sign in…' : 'Add a team server…'}
|
|
418
|
-
</button>
|
|
419
|
-
)
|
|
420
|
-
}
|
|
421
|
-
advanced={
|
|
422
|
-
team.linked ? (
|
|
423
|
-
<HubFields
|
|
424
|
-
url={linkedUrl}
|
|
425
|
-
hub={hub}
|
|
426
|
-
replace
|
|
427
|
-
credentialed={cloud.local.linkedHub?.credentialed}
|
|
428
|
-
/>
|
|
429
|
-
) : null
|
|
430
|
-
}
|
|
431
|
-
>
|
|
432
|
-
{team.action === 'sign-out' ? (
|
|
433
|
-
<button
|
|
434
|
-
type="button"
|
|
435
|
-
className="btn btn--ghost btn--sm v2s-conn-more"
|
|
436
|
-
onClick={() => setTeamOpen(true)}
|
|
437
|
-
data-testid="settings-team-server-add"
|
|
438
|
-
>
|
|
439
|
-
Add another team server…
|
|
440
|
-
</button>
|
|
441
|
-
) : null}
|
|
442
|
-
{teamOpen ? (
|
|
443
|
-
<TeamProjectsDialog
|
|
444
|
-
serverOnly
|
|
445
|
-
title="Add a team server"
|
|
446
|
-
onClose={() => setTeamOpen(false)}
|
|
447
|
-
/>
|
|
448
|
-
) : null}
|
|
449
|
-
</ConnectionRow>
|
|
450
|
-
|
|
451
|
-
<ConnectionRow
|
|
452
|
-
row="claude"
|
|
116
|
+
<div className="v2s-cards" data-testid="settings-connections">
|
|
117
|
+
<SettingsCard
|
|
118
|
+
id="claude"
|
|
119
|
+
summaryTestid="settings-conn-claude-status"
|
|
453
120
|
testid="settings-claude"
|
|
454
121
|
icon="sparkle"
|
|
455
122
|
title="AI — your Claude account"
|
|
456
123
|
desc="Pro or Max, or an API key."
|
|
457
|
-
|
|
458
|
-
|
|
124
|
+
summary={cl.status}
|
|
125
|
+
sw={swOf(cl.tone)}
|
|
459
126
|
action={
|
|
460
127
|
cl.action ? (
|
|
461
128
|
<button
|
|
462
129
|
type="button"
|
|
463
130
|
className={btn}
|
|
464
|
-
aria-expanded={
|
|
131
|
+
aria-expanded={connecting}
|
|
465
132
|
aria-controls="v2s-claude-connect"
|
|
466
|
-
onClick={() =>
|
|
133
|
+
onClick={() => {
|
|
134
|
+
setConnecting((v) => !v);
|
|
135
|
+
show('claude');
|
|
136
|
+
}}
|
|
467
137
|
data-testid="settings-claude-action"
|
|
468
138
|
>
|
|
469
139
|
{cl.action === 'change' ? 'Change…' : 'Connect…'}
|
|
470
140
|
</button>
|
|
471
141
|
) : null
|
|
472
142
|
}
|
|
143
|
+
{...card('claude')}
|
|
473
144
|
>
|
|
474
|
-
|
|
145
|
+
<p className="v2s-hint">
|
|
146
|
+
Maude’s AI runs on this account. Sign in through your browser; Claude Code is set up for
|
|
147
|
+
you.
|
|
148
|
+
</p>
|
|
149
|
+
{connecting ? (
|
|
475
150
|
<div id="v2s-claude-connect" className="v2s-conn-keys">
|
|
476
151
|
<ConnectSheet
|
|
477
152
|
inline
|
|
@@ -486,26 +161,27 @@ export default function ConnectionsSection({ onLinkedHub, onLocalProject, syncSt
|
|
|
486
161
|
fine={null}
|
|
487
162
|
onConnect={async () => {
|
|
488
163
|
const ok = await claude.connect({ force: cl.action === 'change' });
|
|
489
|
-
if (ok)
|
|
164
|
+
if (ok) setConnecting(false);
|
|
490
165
|
}}
|
|
491
166
|
onCancel={() => {
|
|
492
167
|
claude.cancel();
|
|
493
168
|
claude.setError('');
|
|
494
|
-
|
|
169
|
+
setConnecting(false);
|
|
495
170
|
}}
|
|
496
171
|
/>
|
|
497
172
|
</div>
|
|
498
173
|
) : null}
|
|
499
|
-
</
|
|
174
|
+
</SettingsCard>
|
|
500
175
|
|
|
501
|
-
<
|
|
502
|
-
|
|
176
|
+
<SettingsCard
|
|
177
|
+
id="figma"
|
|
178
|
+
summaryTestid="settings-conn-figma-status"
|
|
503
179
|
testid="figma-connect-card"
|
|
504
|
-
icon="
|
|
180
|
+
icon="vector"
|
|
505
181
|
title="Figma"
|
|
506
182
|
desc="For Import from Figma."
|
|
507
|
-
|
|
508
|
-
|
|
183
|
+
summary={fr.status}
|
|
184
|
+
sw={swOf(fr.tone)}
|
|
509
185
|
action={
|
|
510
186
|
fr.configured ? (
|
|
511
187
|
<>
|
|
@@ -513,7 +189,10 @@ export default function ConnectionsSection({ onLinkedHub, onLocalProject, syncSt
|
|
|
513
189
|
type="button"
|
|
514
190
|
className={btn}
|
|
515
191
|
disabled={figma.busy}
|
|
516
|
-
onClick={
|
|
192
|
+
onClick={() => {
|
|
193
|
+
show('figma');
|
|
194
|
+
figma.runTest();
|
|
195
|
+
}}
|
|
517
196
|
data-testid="figma-test"
|
|
518
197
|
>
|
|
519
198
|
Test
|
|
@@ -532,18 +211,23 @@ export default function ConnectionsSection({ onLinkedHub, onLocalProject, syncSt
|
|
|
532
211
|
<button
|
|
533
212
|
type="button"
|
|
534
213
|
className={btn}
|
|
535
|
-
aria-expanded={
|
|
214
|
+
aria-expanded={open === 'figma'}
|
|
536
215
|
aria-controls="v2s-figma-token"
|
|
537
|
-
onClick={() =>
|
|
216
|
+
onClick={() => toggle('figma')}
|
|
538
217
|
data-testid="figma-add-token"
|
|
539
218
|
>
|
|
540
219
|
Add token…
|
|
541
220
|
</button>
|
|
542
221
|
) : null
|
|
543
222
|
}
|
|
544
|
-
|
|
223
|
+
fold={
|
|
224
|
+
fr.configured
|
|
225
|
+
? { panel: connectionFoldId('figma'), body: <FigmaToken f={figma} /> }
|
|
226
|
+
: undefined
|
|
227
|
+
}
|
|
228
|
+
{...card('figma')}
|
|
545
229
|
>
|
|
546
|
-
{!fr.configured && figma.status
|
|
230
|
+
{!fr.configured && figma.status ? (
|
|
547
231
|
<div id="v2s-figma-token" className="v2s-conn-keys">
|
|
548
232
|
<FigmaToken f={figma} />
|
|
549
233
|
</div>
|
|
@@ -562,16 +246,17 @@ export default function ConnectionsSection({ onLinkedHub, onLocalProject, syncSt
|
|
|
562
246
|
{figma.error}
|
|
563
247
|
</p>
|
|
564
248
|
) : null}
|
|
565
|
-
</
|
|
249
|
+
</SettingsCard>
|
|
566
250
|
|
|
567
|
-
<
|
|
568
|
-
|
|
251
|
+
<SettingsCard
|
|
252
|
+
id="github"
|
|
253
|
+
summaryTestid="settings-conn-github-status"
|
|
569
254
|
testid="settings-github"
|
|
570
255
|
icon="link"
|
|
571
256
|
title="GitHub"
|
|
572
257
|
desc="GitHub projects and invites by username."
|
|
573
|
-
|
|
574
|
-
|
|
258
|
+
summary={gr.status}
|
|
259
|
+
sw={swOf(gr.tone)}
|
|
575
260
|
action={
|
|
576
261
|
gr.action === 'connect' ? (
|
|
577
262
|
<button
|
|
@@ -594,69 +279,77 @@ export default function ConnectionsSection({ onLinkedHub, onLocalProject, syncSt
|
|
|
594
279
|
</button>
|
|
595
280
|
) : null
|
|
596
281
|
}
|
|
597
|
-
|
|
598
|
-
gh.native
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
282
|
+
fold={
|
|
283
|
+
gh.native
|
|
284
|
+
? {
|
|
285
|
+
panel: connectionFoldId('github'),
|
|
286
|
+
body: (
|
|
287
|
+
<>
|
|
288
|
+
{gh.login ? (
|
|
289
|
+
<ConnField k="Signed in as" mono>
|
|
290
|
+
@{gh.login}
|
|
291
|
+
</ConnField>
|
|
292
|
+
) : null}
|
|
293
|
+
<ConnField k="Token">Kept in this Mac’s keychain — never shown</ConnField>
|
|
294
|
+
</>
|
|
295
|
+
),
|
|
296
|
+
}
|
|
297
|
+
: undefined
|
|
608
298
|
}
|
|
299
|
+
{...card('github')}
|
|
609
300
|
>
|
|
610
301
|
{gh.error ? (
|
|
611
302
|
<p className="v2s-conn-err" role="alert">
|
|
612
303
|
{gh.error}
|
|
613
304
|
</p>
|
|
614
305
|
) : null}
|
|
615
|
-
</
|
|
306
|
+
</SettingsCard>
|
|
616
307
|
|
|
617
|
-
<
|
|
618
|
-
|
|
308
|
+
<SettingsCard
|
|
309
|
+
id="ai"
|
|
310
|
+
summaryTestid="settings-conn-ai-status"
|
|
619
311
|
testid="settings-ai-keys"
|
|
620
|
-
icon="
|
|
312
|
+
icon="image"
|
|
621
313
|
title="AI images, video and voice"
|
|
622
|
-
|
|
314
|
+
desc="Your own keys for pictures, video and voice."
|
|
315
|
+
summary={providerSummary(keys.providers)}
|
|
316
|
+
sw={
|
|
317
|
+
Array.isArray(keys.providers) && keys.providers.some((p) => p?.configured) ? 'ok' : 'off'
|
|
318
|
+
}
|
|
623
319
|
action={
|
|
624
320
|
<button
|
|
625
321
|
type="button"
|
|
626
322
|
className={btn}
|
|
627
|
-
aria-expanded={
|
|
323
|
+
aria-expanded={open === 'ai'}
|
|
628
324
|
aria-controls="v2s-ai-keys"
|
|
629
|
-
onClick={() =>
|
|
325
|
+
onClick={() => toggle('ai')}
|
|
630
326
|
data-testid="settings-ai-keys-toggle"
|
|
631
327
|
>
|
|
632
|
-
{
|
|
328
|
+
{open === 'ai' ? 'Hide' : 'Manage…'}
|
|
633
329
|
</button>
|
|
634
330
|
}
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
331
|
+
fold={{
|
|
332
|
+
panel: connectionFoldId('ai'),
|
|
333
|
+
body: (
|
|
334
|
+
<ConnField k="Where the keys are">
|
|
335
|
+
On this Mac only — never sent anywhere but the provider, never shown to a canvas.
|
|
336
|
+
</ConnField>
|
|
337
|
+
),
|
|
338
|
+
}}
|
|
339
|
+
{...card('ai')}
|
|
640
340
|
>
|
|
641
|
-
|
|
642
|
-
<
|
|
643
|
-
|
|
644
|
-
{
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
341
|
+
<div id="v2s-ai-keys" className="v2s-conn-keys">
|
|
342
|
+
{keys.error ? <p className="v2s-conn-err">{keys.error}</p> : null}
|
|
343
|
+
{(keys.providers ?? []).map((p) => (
|
|
344
|
+
<ProviderCard key={p.id} provider={p} onChanged={keys.reload} />
|
|
345
|
+
))}
|
|
346
|
+
</div>
|
|
347
|
+
</SettingsCard>
|
|
348
|
+
|
|
349
|
+
<p className="v2s-hint v2s-cards-foot" data-testid="settings-connections-foot">
|
|
350
|
+
Which account a project uses, and where it lives, is in General › This project.
|
|
351
|
+
</p>
|
|
650
352
|
|
|
651
|
-
{cloud.device ? (
|
|
652
|
-
<CloudDeviceDialog
|
|
653
|
-
device={cloud.device}
|
|
654
|
-
cloudUrl={cloud.cloudUrl}
|
|
655
|
-
openFailed={cloud.openFailed}
|
|
656
|
-
onOpenResult={(s) => cloud.setOpenFailed(s === 'ok' ? '' : s)}
|
|
657
|
-
onCancel={cloud.cancelSignIn}
|
|
658
|
-
/>
|
|
659
|
-
) : null}
|
|
660
353
|
{gh.device ? <GitHubDeviceDialog device={gh.device} onClose={gh.closeDevice} /> : null}
|
|
661
354
|
</div>
|
|
662
355
|
);
|