@buffcore/admin-shell 0.8.42 → 0.8.43
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/dist/screens/assistant/use-ask.d.ts +4 -3
- package/dist/workbench/app/ServedAgents.js +4 -1
- package/dist/workbench/app/ServedComp.d.ts +3 -0
- package/dist/workbench/app/ServedComp.js +33 -0
- package/dist/workbench/app/ServedPrototype.js +9 -0
- package/dist/workbench/app/actions.d.ts +7 -0
- package/dist/workbench/app/actions.js +1 -0
- package/dist/workbench/app/chat-session.d.ts +2 -0
- package/dist/workbench/app/chat.d.ts +2 -0
- package/dist/workbench/app/fresh.d.ts +63 -0
- package/dist/workbench/app/fresh.js +66 -0
- package/dist/workbench/app/places.d.ts +1 -1
- package/dist/workbench/app/prototype-comp.d.ts +46 -0
- package/dist/workbench/app/prototype-comp.js +77 -0
- package/dist/workbench/app/prototype.d.ts +1 -1
- package/dist/workbench/app/prototype.js +3 -1
- package/dist/workbench/app/test/loop-fixture.d.ts +13 -8
- package/dist/workbench/app/useStudio.d.ts +43 -1
- package/dist/workbench/app/useStudio.js +8 -1
- package/dist/workbench/app/work.d.ts +7 -7
- package/dist/workbench/studio/frame/LimitCard.d.ts +5 -0
- package/dist/workbench/studio/frame/LimitCard.js +26 -0
- package/dist/workbench/studio/frame/PanelMessage.js +3 -0
- package/dist/workbench/studio/frame/panelLines.d.ts +1 -0
- package/dist/workbench/studio/frame/panelLines.js +2 -1
- package/dist/workbench/studio/i18n/comp.en.d.ts +26 -0
- package/dist/workbench/studio/i18n/comp.en.js +26 -0
- package/dist/workbench/studio/i18n/comp.es.d.ts +26 -0
- package/dist/workbench/studio/i18n/comp.es.js +25 -0
- package/dist/workbench/studio/i18n/frame.en.d.ts +13 -0
- package/dist/workbench/studio/i18n/frame.en.js +13 -0
- package/dist/workbench/studio/i18n/frame.es.json +14 -1
- package/dist/workbench/studio/i18n/fresh.en.d.ts +19 -0
- package/dist/workbench/studio/i18n/fresh.en.js +20 -0
- package/dist/workbench/studio/i18n/fresh.es.json +18 -0
- package/dist/workbench/studio/i18n/index.js +6 -0
- package/dist/workbench/studio/loop/AgentsPage.d.ts +4 -1
- package/dist/workbench/studio/loop/AgentsPage.js +5 -4
- package/dist/workbench/studio/loop/CritiqueNote.d.ts +4 -0
- package/dist/workbench/studio/loop/CritiqueNote.js +9 -0
- package/dist/workbench/studio/loop/FreshLookPanel.d.ts +21 -0
- package/dist/workbench/studio/loop/FreshLookPanel.js +60 -0
- package/dist/workbench/studio/loop/PrototypeComp.d.ts +25 -0
- package/dist/workbench/studio/loop/PrototypeComp.js +78 -0
- package/dist/workbench/studio/loop/PrototypePage.d.ts +7 -0
- package/dist/workbench/studio/loop/PrototypePage.js +1 -1
- package/dist/workbench/studio/loop/PrototypeSimplePage.js +11 -4
- package/dist/workbench/studio/loop/PrototypeSnapshot.d.ts +3 -0
- package/dist/workbench/studio/loop/PrototypeSnapshot.js +2 -1
- package/dist/workbench/studio/loop/ReviewSetting.d.ts +6 -0
- package/dist/workbench/studio/loop/ReviewSetting.js +14 -0
- package/dist/workbench/studio/loop/SaveStep.d.ts +3 -0
- package/dist/workbench/studio/loop/SaveStep.js +3 -1
- package/dist/workbench/studio/loop/ServedPlanning.js +1 -1
- package/dist/workbench/studio/loop/StructurePage.d.ts +5 -0
- package/dist/workbench/studio/loop/StructurePage.js +3 -2
- package/dist/workbench/studio/loop/SurfaceChoice.d.ts +7 -0
- package/dist/workbench/studio/loop/SurfaceChoice.js +20 -0
- package/dist/workbench/studio/loop/usePlanningDraft.js +5 -1
- package/dist/workbench/studio/work/work-test-data.d.ts +6 -4
- package/package.json +6 -6
|
@@ -12,5 +12,47 @@ export declare function useStudio({ token, fetch, every }: StudioAppProps): {
|
|
|
12
12
|
age: string | number | undefined;
|
|
13
13
|
trouble: Trouble | null;
|
|
14
14
|
detail: Notice | undefined;
|
|
15
|
-
actions:
|
|
15
|
+
actions: {
|
|
16
|
+
prototypeHome?: import('./prototype-home.ts').HomeRead;
|
|
17
|
+
snapshot?: (request: import("./prototype-snapshot.ts").SnapshotRequest, signal?: AbortSignal) => Promise<import("./prototype-snapshot.ts").SnapshotRead | undefined>;
|
|
18
|
+
checkAgents?: (signal?: AbortSignal) => Promise<import("@buffcore/contracts/workbench").FoundAgent[] | undefined>;
|
|
19
|
+
prototypeScenes?: (signal?: AbortSignal) => Promise<import("@buffcore/contracts/workbench").PrototypeScenesReply>;
|
|
20
|
+
go?: (page: import("../index.ts").StudioPage) => void;
|
|
21
|
+
readIcon?: (signal: AbortSignal) => Promise<Blob | undefined>;
|
|
22
|
+
uploadIcon?: (file: File) => Promise<unknown>;
|
|
23
|
+
run: (id: string, server?: import("../types.ts").ServerForm) => unknown;
|
|
24
|
+
stack: (action: 'start' | 'stop') => void;
|
|
25
|
+
level: (level: (typeof import("@buffcore/contracts/workbench").LEVELS)[number], neverAsk?: boolean) => void;
|
|
26
|
+
answerPermission?: (chat: string, card: string, answer: 'once' | 'always' | 'deny') => Promise<true | string>;
|
|
27
|
+
approvePrototype?: (change: string, version: number) => unknown;
|
|
28
|
+
chooseSurface?: (surface: 'desktop' | 'phone') => unknown;
|
|
29
|
+
approvePlaces?: (change: string, revision: string) => unknown;
|
|
30
|
+
approve?: (direction: string, fingerprint: string) => unknown;
|
|
31
|
+
approveRelease?: (id: string, server: import("../types.ts").ServerForm) => Promise<unknown>;
|
|
32
|
+
catchUp?: (change: string) => Promise<unknown>;
|
|
33
|
+
send: (id: string, text: string, waitForRefresh?: false) => Promise<boolean>;
|
|
34
|
+
newChat: (body: import("@buffcore/contracts/workbench").NewChat) => Promise<import("@buffcore/contracts/workbench").Chat | undefined>;
|
|
35
|
+
allowFolder?: (id: string, at: number) => Promise<true | string>;
|
|
36
|
+
platformsWanted?: {
|
|
37
|
+
current?: {
|
|
38
|
+
ios: boolean;
|
|
39
|
+
android: boolean;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
stop: (id: string, confirm?: boolean, signal?: AbortSignal) => Promise<import('zod').infer<typeof import("@buffcore/contracts/workbench").stopAnswer> | undefined>;
|
|
43
|
+
answerInChat?: (question: string, key?: string) => void;
|
|
44
|
+
chooseQuestion?: (question: string, number?: number) => void;
|
|
45
|
+
questionChoices?: Record<string, import("./question-transcript.ts").QuestionChoice>;
|
|
46
|
+
questionBusy?: boolean;
|
|
47
|
+
setAgents: (assignment: import("@buffcore/contracts/workbench").AgentAssignment) => void;
|
|
48
|
+
merge: (change: string) => Promise<unknown>;
|
|
49
|
+
markBuilt?: (change: string, version: number, commit: string) => Promise<import("./actions.ts").SaveResult>;
|
|
50
|
+
previewMerge?: (change: string, signal: AbortSignal) => Promise<import("@buffcore/contracts/workbench").MergePreview | undefined>;
|
|
51
|
+
retryTurn?: (chat: string) => Promise<unknown>;
|
|
52
|
+
holdMerges?: (held: boolean) => Promise<unknown>;
|
|
53
|
+
removeWorktree: (change: string) => Promise<unknown>;
|
|
54
|
+
fresh?: import("./fresh.ts").FreshActions;
|
|
55
|
+
save: (step: import("./actions.ts").SaveStep, fingerprint?: string, files?: readonly string[], change?: string) => Promise<import("./actions.ts").SaveResult>;
|
|
56
|
+
comp: import("./prototype-comp.ts").CompReads;
|
|
57
|
+
};
|
|
16
58
|
};
|
|
@@ -2,7 +2,9 @@ import { chatSchema, localTokenRefusalSchema, studioStateSchema, workbenchApi, }
|
|
|
2
2
|
import { useT } from '@buffcore/i18n/react';
|
|
3
3
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
4
|
import { studioActions } from './actions.js';
|
|
5
|
+
import { freshActions } from './fresh.js';
|
|
5
6
|
import { mergePreviewRead } from './merge-preview.js';
|
|
7
|
+
import { compReads } from './prototype-comp.js';
|
|
6
8
|
import { prototypeHomeRead } from './prototype-home.js';
|
|
7
9
|
import { prototypeScenesRead } from './prototype-scenes.js';
|
|
8
10
|
import { studioPost, studioReadNotice } from './studio-post.js';
|
|
@@ -114,6 +116,11 @@ export function useStudio({ token, fetch = globalThis.fetch, every }) {
|
|
|
114
116
|
// A check and a poll publish into the same state in the order their answers arrive.
|
|
115
117
|
setLastRead((held) => held && { ...held, agents: { ...held.agents, found } });
|
|
116
118
|
});
|
|
119
|
+
actions.fresh = freshActions(fetch, headers, post);
|
|
120
|
+
// The comp's reads keep one identity; its approval posts through the latest `send`.
|
|
121
|
+
const latestSend = useRef(send);
|
|
122
|
+
latestSend.current = send;
|
|
123
|
+
const comp = useMemo(() => compReads(fetch, headers, (path, body) => latestSend.current(path, body)), [fetch, headers]);
|
|
117
124
|
return {
|
|
118
125
|
state,
|
|
119
126
|
gate,
|
|
@@ -123,7 +130,7 @@ export function useStudio({ token, fetch = globalThis.fetch, every }) {
|
|
|
123
130
|
age,
|
|
124
131
|
trouble,
|
|
125
132
|
detail,
|
|
126
|
-
actions,
|
|
133
|
+
actions: { ...actions, comp },
|
|
127
134
|
};
|
|
128
135
|
}
|
|
129
136
|
function withoutLevels(state) {
|
|
@@ -11,13 +11,13 @@ export declare const workCallbacks: (actions: StudioActions) => {
|
|
|
11
11
|
* approval asks the same rule, changeNeedsPrototype).
|
|
12
12
|
*/
|
|
13
13
|
export declare function codingPrerequisite(state: StudioState | null, change?: string): {
|
|
14
|
-
reason?: undefined;
|
|
15
14
|
readonly status: 'no-change';
|
|
15
|
+
readonly reason?: undefined;
|
|
16
16
|
readonly noScreens?: undefined;
|
|
17
17
|
readonly version?: undefined;
|
|
18
18
|
} | {
|
|
19
|
-
reason?: undefined;
|
|
20
19
|
readonly status: 'unknown';
|
|
20
|
+
readonly reason?: undefined;
|
|
21
21
|
readonly noScreens?: undefined;
|
|
22
22
|
readonly version?: undefined;
|
|
23
23
|
} | {
|
|
@@ -26,28 +26,28 @@ export declare function codingPrerequisite(state: StudioState | null, change?: s
|
|
|
26
26
|
readonly noScreens?: undefined;
|
|
27
27
|
readonly version?: undefined;
|
|
28
28
|
} | {
|
|
29
|
-
reason?: undefined;
|
|
29
|
+
readonly reason?: undefined;
|
|
30
30
|
readonly status: 'ready';
|
|
31
31
|
readonly noScreens: true;
|
|
32
32
|
readonly version?: undefined;
|
|
33
33
|
} | {
|
|
34
|
-
reason?: undefined;
|
|
34
|
+
readonly reason?: undefined;
|
|
35
35
|
readonly noScreens?: undefined;
|
|
36
36
|
readonly status: 'missing';
|
|
37
37
|
readonly version?: undefined;
|
|
38
38
|
} | {
|
|
39
|
-
reason?: undefined;
|
|
39
|
+
readonly reason?: undefined;
|
|
40
40
|
readonly noScreens?: undefined;
|
|
41
41
|
readonly status: 'unknown';
|
|
42
42
|
readonly version: number;
|
|
43
43
|
} | {
|
|
44
|
-
reason?: undefined;
|
|
44
|
+
readonly reason?: undefined;
|
|
45
45
|
readonly noScreens?: undefined;
|
|
46
46
|
readonly status: "ready" | "unapproved";
|
|
47
47
|
readonly version: number;
|
|
48
48
|
readonly newer?: undefined;
|
|
49
49
|
} | {
|
|
50
|
-
reason?: undefined;
|
|
50
|
+
readonly reason?: undefined;
|
|
51
51
|
readonly noScreens?: undefined;
|
|
52
52
|
readonly status: "ready" | "unapproved";
|
|
53
53
|
readonly version: number;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useT } from '@buffcore/i18n/react';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { Button } from '../../../components/Button.js';
|
|
5
|
+
import { chatCard } from './AllowFolderCard.js';
|
|
6
|
+
import { AskTitle, askCommand, askFine } from './PermissionAskCard.js';
|
|
7
|
+
import { isRedactedTarget } from './panelLines.js';
|
|
8
|
+
import { folderButtonStyle } from './TurnControls.js';
|
|
9
|
+
/** The chat keeps a command's first 2000 characters: a longer one is cut, and never copied. */
|
|
10
|
+
const KEPT = 2000;
|
|
11
|
+
export function LimitCard({ limit, command }) {
|
|
12
|
+
const t = useT();
|
|
13
|
+
// A cut or scrubbed command is no longer the one the agent wrote: copying it would mislead.
|
|
14
|
+
const whole = command.length < KEPT && !isRedactedTarget([command]);
|
|
15
|
+
const [copied, setCopied] = useState();
|
|
16
|
+
const copy = async () => {
|
|
17
|
+
try {
|
|
18
|
+
await navigator.clipboard.writeText(command);
|
|
19
|
+
setCopied('copied');
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
setCopied('copyFailed');
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
return (_jsx("li", { "data-limit-card": limit, children: _jsxs("div", { style: chatCard, children: [_jsx(AskTitle, { icon: "lock", children: t('studio.frame.limit.title') }), _jsx("pre", { translate: "no", style: askCommand, children: command }), _jsx("p", { style: { margin: 0, fontWeight: 'var(--weight-semibold)', color: 'var(--text-strong)' }, children: t(`studio.frame.limit.kind.${limit}`) }), _jsx("p", { style: { margin: 0 }, children: t('studio.frame.limit.next') }), whole ? (_jsxs("span", { style: { display: 'grid', gap: 'var(--space-2)', justifyItems: 'start' }, children: [_jsx(Button, { size: "lg", variant: "secondary", icon: "copy", style: folderButtonStyle, onClick: () => void copy(), children: t('studio.frame.limit.copy') }), copied && (_jsx("span", { role: "status", style: askFine, children: t(`studio.frame.limit.${copied}`) }))] })) : (_jsx("p", { style: askFine, children: t('studio.frame.limit.long') })), _jsx("p", { style: askFine, children: t('studio.frame.limit.list') })] }) }));
|
|
26
|
+
}
|
|
@@ -5,6 +5,7 @@ import { visuallyHidden } from '../../../components/field.js';
|
|
|
5
5
|
import { Icon } from '../../../components/Icon.js';
|
|
6
6
|
import { bodyText, captionText, monoText } from '../../../components/styles.js';
|
|
7
7
|
import { AgentMarkdown } from './AgentMarkdown.js';
|
|
8
|
+
import { LimitCard } from './LimitCard.js';
|
|
8
9
|
import { PanelEnd, PanelWarning } from './PanelNotice.js';
|
|
9
10
|
import { PanelPermission } from './PanelPermission.js';
|
|
10
11
|
import { PanelTool } from './PanelTool.js';
|
|
@@ -40,6 +41,8 @@ function Bubble({ m, simple }) {
|
|
|
40
41
|
}
|
|
41
42
|
export function PanelMessage(props) {
|
|
42
43
|
const { m } = props;
|
|
44
|
+
if (m.tool?.limit)
|
|
45
|
+
return _jsx(LimitCard, { limit: m.tool.limit, command: m.tool.targets[0] ?? '' });
|
|
43
46
|
if (m.tool)
|
|
44
47
|
return _jsx(PanelTool, { tool: m.tool });
|
|
45
48
|
if (m.permission)
|
|
@@ -17,6 +17,7 @@ export declare const isRedactedTarget: (targets: readonly string[]) => boolean;
|
|
|
17
17
|
/**
|
|
18
18
|
* The last call the agent was refused, when the person has not answered it yet: nothing from the
|
|
19
19
|
* person after it, the agent not running, and no permission notice (it has its own two buttons).
|
|
20
|
+
* A call a limit refused has its own card, with nothing to ask again.
|
|
20
21
|
*/
|
|
21
22
|
export declare function refusedCall(lines: readonly PanelMessage[], running: boolean | undefined): {
|
|
22
23
|
tool: NonNullable<PanelMessage['tool']>;
|
|
@@ -62,11 +62,12 @@ export const isRedactedTarget = (targets) => targets.some((target) => REDACTION_
|
|
|
62
62
|
/**
|
|
63
63
|
* The last call the agent was refused, when the person has not answered it yet: nothing from the
|
|
64
64
|
* person after it, the agent not running, and no permission notice (it has its own two buttons).
|
|
65
|
+
* A call a limit refused has its own card, with nothing to ask again.
|
|
65
66
|
*/
|
|
66
67
|
export function refusedCall(lines, running) {
|
|
67
68
|
if (running)
|
|
68
69
|
return undefined;
|
|
69
|
-
const at = lines.findLastIndex((m) => m.tool?.refused);
|
|
70
|
+
const at = lines.findLastIndex((m) => m.tool?.refused && !m.tool.limit);
|
|
70
71
|
if (at < 0)
|
|
71
72
|
return undefined;
|
|
72
73
|
const after = lines.slice(at + 1);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'studio.structure.surface.question': string;
|
|
3
|
+
'studio.structure.surface.help': string;
|
|
4
|
+
'studio.structure.surface.desktop': string;
|
|
5
|
+
'studio.structure.surface.desktopHelp': string;
|
|
6
|
+
'studio.structure.surface.phone': string;
|
|
7
|
+
'studio.structure.surface.phoneHelp': string;
|
|
8
|
+
'studio.structure.surface.first': string;
|
|
9
|
+
'studio.comp.title': string;
|
|
10
|
+
'studio.comp.intro': string;
|
|
11
|
+
'studio.comp.desktop': string;
|
|
12
|
+
'studio.comp.phone': string;
|
|
13
|
+
'studio.comp.reference': string;
|
|
14
|
+
'studio.comp.noReference': string;
|
|
15
|
+
'studio.comp.noPicture': string;
|
|
16
|
+
'studio.comp.approve': string;
|
|
17
|
+
'studio.comp.change': string;
|
|
18
|
+
'studio.comp.approved': string;
|
|
19
|
+
'studio.comp.approvedBy': string;
|
|
20
|
+
'studio.comp.open': string;
|
|
21
|
+
'studio.comp.back': string;
|
|
22
|
+
'studio.comp.sample.notes': string;
|
|
23
|
+
'studio.comp.sample.write': string;
|
|
24
|
+
'studio.comp.sample.settings': string;
|
|
25
|
+
};
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// The comp: which surface comes first (Structure) and the look on three screens (Prototype).
|
|
2
|
+
export default {
|
|
3
|
+
'studio.structure.surface.question': 'Which surface comes first?',
|
|
4
|
+
'studio.structure.surface.help': 'The first screens are drawn for it; the other follows from them.',
|
|
5
|
+
'studio.structure.surface.desktop': 'Desktop',
|
|
6
|
+
'studio.structure.surface.desktopHelp': 'People mostly use it at a desk, on a wide screen.',
|
|
7
|
+
'studio.structure.surface.phone': 'Phone',
|
|
8
|
+
'studio.structure.surface.phoneHelp': 'People mostly use it on the go, one hand.',
|
|
9
|
+
'studio.structure.surface.first': 'Draft the structure first; then choose which surface comes first.',
|
|
10
|
+
'studio.comp.title': 'The look, on three screens',
|
|
11
|
+
'studio.comp.intro': 'The three screens that decide the look, at full width, beside the references the brand chose. Approve the look and the agent draws every scene from it.',
|
|
12
|
+
'studio.comp.desktop': 'Drawn for desktop, {width} px wide.',
|
|
13
|
+
'studio.comp.phone': 'Drawn for phone, {width} px wide.',
|
|
14
|
+
'studio.comp.reference': 'Reference {n}',
|
|
15
|
+
'studio.comp.noReference': 'No reference picture yet: design/references.md names none for this screen.',
|
|
16
|
+
'studio.comp.noPicture': 'This screen has no picture yet: the agent snapshots the comp.',
|
|
17
|
+
'studio.comp.approve': 'Approve the look',
|
|
18
|
+
'studio.comp.change': 'Say what to change in the chat; the agent redraws the three.',
|
|
19
|
+
'studio.comp.approved': 'The look is approved.',
|
|
20
|
+
'studio.comp.approvedBy': 'Approved by {by}. Every scene is drawn to match it.',
|
|
21
|
+
'studio.comp.open': 'See the look',
|
|
22
|
+
'studio.comp.back': 'Back to the app',
|
|
23
|
+
'studio.comp.sample.notes': 'Your notes',
|
|
24
|
+
'studio.comp.sample.write': 'Write a note',
|
|
25
|
+
'studio.comp.sample.settings': 'Settings',
|
|
26
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'studio.structure.surface.question': string;
|
|
3
|
+
'studio.structure.surface.help': string;
|
|
4
|
+
'studio.structure.surface.desktop': string;
|
|
5
|
+
'studio.structure.surface.desktopHelp': string;
|
|
6
|
+
'studio.structure.surface.phone': string;
|
|
7
|
+
'studio.structure.surface.phoneHelp': string;
|
|
8
|
+
'studio.structure.surface.first': string;
|
|
9
|
+
'studio.comp.title': string;
|
|
10
|
+
'studio.comp.intro': string;
|
|
11
|
+
'studio.comp.desktop': string;
|
|
12
|
+
'studio.comp.phone': string;
|
|
13
|
+
'studio.comp.reference': string;
|
|
14
|
+
'studio.comp.noReference': string;
|
|
15
|
+
'studio.comp.noPicture': string;
|
|
16
|
+
'studio.comp.approve': string;
|
|
17
|
+
'studio.comp.change': string;
|
|
18
|
+
'studio.comp.approved': string;
|
|
19
|
+
'studio.comp.approvedBy': string;
|
|
20
|
+
'studio.comp.open': string;
|
|
21
|
+
'studio.comp.back': string;
|
|
22
|
+
'studio.comp.sample.notes': string;
|
|
23
|
+
'studio.comp.sample.write': string;
|
|
24
|
+
'studio.comp.sample.settings': string;
|
|
25
|
+
};
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
'studio.structure.surface.question': '¿Qué superficie va primero?',
|
|
3
|
+
'studio.structure.surface.help': 'Las primeras pantallas se dibujan para ella; la otra se deriva de ellas.',
|
|
4
|
+
'studio.structure.surface.desktop': 'Escritorio',
|
|
5
|
+
'studio.structure.surface.desktopHelp': 'La gente la usa sobre todo en un escritorio, en una pantalla ancha.',
|
|
6
|
+
'studio.structure.surface.phone': 'Teléfono',
|
|
7
|
+
'studio.structure.surface.phoneHelp': 'La gente la usa sobre todo en movimiento, con una mano.',
|
|
8
|
+
'studio.structure.surface.first': 'Primero haz el borrador de la estructura; luego elige qué superficie va primero.',
|
|
9
|
+
'studio.comp.title': 'El aspecto, en tres pantallas',
|
|
10
|
+
'studio.comp.intro': 'Las tres pantallas que deciden el aspecto, a ancho completo, junto a las referencias que eligió la marca. Aprueba el aspecto y el agente dibuja cada escena a partir de él.',
|
|
11
|
+
'studio.comp.desktop': 'Dibujado para escritorio, {width} px de ancho.',
|
|
12
|
+
'studio.comp.phone': 'Dibujado para teléfono, {width} px de ancho.',
|
|
13
|
+
'studio.comp.reference': 'Referencia {n}',
|
|
14
|
+
'studio.comp.noReference': 'Aún no hay imagen de referencia: design/references.md no nombra ninguna para esta pantalla.',
|
|
15
|
+
'studio.comp.noPicture': 'Esta pantalla aún no tiene imagen: el agente captura el boceto.',
|
|
16
|
+
'studio.comp.approve': 'Aprobar el aspecto',
|
|
17
|
+
'studio.comp.change': 'Di en el chat qué cambiar; el agente vuelve a dibujar las tres.',
|
|
18
|
+
'studio.comp.approved': 'El aspecto está aprobado.',
|
|
19
|
+
'studio.comp.approvedBy': 'Aprobado por {by}. Cada escena se dibuja para coincidir con él.',
|
|
20
|
+
'studio.comp.open': 'Ver el aspecto',
|
|
21
|
+
'studio.comp.back': 'Volver a la app',
|
|
22
|
+
'studio.comp.sample.notes': 'Tus notas',
|
|
23
|
+
'studio.comp.sample.write': 'Escribir una nota',
|
|
24
|
+
'studio.comp.sample.settings': 'Ajustes',
|
|
25
|
+
};
|
|
@@ -209,5 +209,18 @@ declare const _default: {
|
|
|
209
209
|
'studio.frame.ask.refusedTold': string;
|
|
210
210
|
'studio.frame.ask.refusedWhy': string;
|
|
211
211
|
'studio.frame.ask.refusedNext': string;
|
|
212
|
+
'studio.frame.limit.title': string;
|
|
213
|
+
'studio.frame.limit.kind.secrets': string;
|
|
214
|
+
'studio.frame.limit.kind.settings': string;
|
|
215
|
+
'studio.frame.limit.kind.deploy': string;
|
|
216
|
+
'studio.frame.limit.kind.push': string;
|
|
217
|
+
'studio.frame.limit.kind.publish': string;
|
|
218
|
+
'studio.frame.limit.kind.release': string;
|
|
219
|
+
'studio.frame.limit.next': string;
|
|
220
|
+
'studio.frame.limit.copy': string;
|
|
221
|
+
'studio.frame.limit.copied': string;
|
|
222
|
+
'studio.frame.limit.copyFailed': string;
|
|
223
|
+
'studio.frame.limit.long': string;
|
|
224
|
+
'studio.frame.limit.list': string;
|
|
212
225
|
};
|
|
213
226
|
export default _default;
|
|
@@ -215,4 +215,17 @@ export default {
|
|
|
215
215
|
'studio.frame.ask.refusedTold': '{agent} was told:',
|
|
216
216
|
'studio.frame.ask.refusedWhy': '`{parts}` isn’t allowed here.',
|
|
217
217
|
'studio.frame.ask.refusedNext': 'It goes on without it.',
|
|
218
|
+
'studio.frame.limit.title': 'This can’t be allowed here',
|
|
219
|
+
'studio.frame.limit.kind.secrets': 'Reading a folder of sign-ins or keys',
|
|
220
|
+
'studio.frame.limit.kind.settings': 'Production settings',
|
|
221
|
+
'studio.frame.limit.kind.deploy': 'Deploying',
|
|
222
|
+
'studio.frame.limit.kind.push': 'Pushing with git',
|
|
223
|
+
'studio.frame.limit.kind.publish': 'Publishing a package',
|
|
224
|
+
'studio.frame.limit.kind.release': 'Publishing a release',
|
|
225
|
+
'studio.frame.limit.next': 'Only a person does this. Nothing was run: copy the command and run it in your own terminal when you’re ready.',
|
|
226
|
+
'studio.frame.limit.copy': 'Copy the command',
|
|
227
|
+
'studio.frame.limit.copied': 'Command copied.',
|
|
228
|
+
'studio.frame.limit.copyFailed': 'Couldn’t copy. Select the command and copy it.',
|
|
229
|
+
'studio.frame.limit.long': 'This command was shortened in the chat, so it can’t be copied whole from here.',
|
|
230
|
+
'studio.frame.limit.list': 'Never allowed at any level: folders of sign-ins or keys, production settings, deploys, git push, publishing a package or a release.',
|
|
218
231
|
};
|
|
@@ -204,5 +204,18 @@
|
|
|
204
204
|
"studio.frame.ask.refusedTold": "A {agent} se le dijo:",
|
|
205
205
|
"studio.frame.ask.refusedWhy": "`{parts}` no está permitido aquí.",
|
|
206
206
|
"studio.frame.ask.refusedNext": "Sigue sin ello.",
|
|
207
|
-
"studio.frame.lines.changed": "Cambiado, abrir en la vista previa:"
|
|
207
|
+
"studio.frame.lines.changed": "Cambiado, abrir en la vista previa:",
|
|
208
|
+
"studio.frame.limit.title": "Esto no se puede permitir aquí",
|
|
209
|
+
"studio.frame.limit.kind.secrets": "Leer una carpeta de accesos o claves",
|
|
210
|
+
"studio.frame.limit.kind.settings": "Ajustes de producción",
|
|
211
|
+
"studio.frame.limit.kind.deploy": "Desplegar",
|
|
212
|
+
"studio.frame.limit.kind.push": "Hacer push con git",
|
|
213
|
+
"studio.frame.limit.kind.publish": "Publicar un paquete",
|
|
214
|
+
"studio.frame.limit.kind.release": "Publicar una versión",
|
|
215
|
+
"studio.frame.limit.next": "Solo una persona hace esto. No se ejecutó nada: copia el comando y ejecútalo en tu propia terminal cuando quieras.",
|
|
216
|
+
"studio.frame.limit.copy": "Copiar el comando",
|
|
217
|
+
"studio.frame.limit.copied": "Comando copiado.",
|
|
218
|
+
"studio.frame.limit.copyFailed": "No se pudo copiar. Selecciona el comando y cópialo.",
|
|
219
|
+
"studio.frame.limit.long": "Este comando se acortó en el chat, así que no se puede copiar entero desde aquí.",
|
|
220
|
+
"studio.frame.limit.list": "Nunca se permite en ningún nivel: carpetas de accesos o claves, ajustes de producción, despliegues, git push, publicar un paquete o una versión."
|
|
208
221
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'studio.fresh.title': string;
|
|
3
|
+
'studio.fresh.intro': string;
|
|
4
|
+
'studio.fresh.running': string;
|
|
5
|
+
'studio.fresh.none': string;
|
|
6
|
+
'studio.fresh.take': string;
|
|
7
|
+
'studio.fresh.leave': string;
|
|
8
|
+
'studio.fresh.taken': string;
|
|
9
|
+
'studio.fresh.busy': string;
|
|
10
|
+
'studio.fresh.message': string;
|
|
11
|
+
'studio.fresh.turn': string;
|
|
12
|
+
'studio.fresh.setting.label': string;
|
|
13
|
+
'studio.fresh.setting.help': string;
|
|
14
|
+
'studio.fresh.critique.title': string;
|
|
15
|
+
'studio.fresh.critique.running': string;
|
|
16
|
+
'studio.fresh.critique.done': string;
|
|
17
|
+
'studio.fresh.critique.failed': string;
|
|
18
|
+
};
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// A fresh agent's turns (0.8.43): the review before Save on the planning steps, its setting, and
|
|
2
|
+
// the critique as its own turn after a passing full snapshot.
|
|
3
|
+
export default {
|
|
4
|
+
'studio.fresh.title': 'A fresh look before you save',
|
|
5
|
+
'studio.fresh.intro': 'A second agent read the plan with fresh eyes. Take what helps; Save works either way.',
|
|
6
|
+
'studio.fresh.running': 'A second agent is reading this step with fresh eyes. Save works meanwhile.',
|
|
7
|
+
'studio.fresh.none': 'A second agent read this step with fresh eyes and found nothing to add.',
|
|
8
|
+
'studio.fresh.take': 'Take',
|
|
9
|
+
'studio.fresh.leave': 'Leave',
|
|
10
|
+
'studio.fresh.taken': 'Taken: your agent adds it to the plan',
|
|
11
|
+
'studio.fresh.busy': 'Your agent is still working. Take it again when its turn ends.',
|
|
12
|
+
'studio.fresh.message': 'From the fresh look: {finding}',
|
|
13
|
+
'studio.fresh.turn': '{agent} · fresh look · {seconds, plural, one {# second} other {# seconds}}',
|
|
14
|
+
'studio.fresh.setting.label': 'A fresh look before Save',
|
|
15
|
+
'studio.fresh.setting.help': 'After your agent changes Brief, Plan, Journeys or Structure, a second agent reads the step and lists what to fix. It costs one more turn. It runs with Claude Code only for now; with Codex or OpenCode there is none.',
|
|
16
|
+
'studio.fresh.critique.title': 'The critique',
|
|
17
|
+
'studio.fresh.critique.running': 'The critique is running: a fresh agent reviews the scenes it did not draw.',
|
|
18
|
+
'studio.fresh.critique.done': 'The critique is written in',
|
|
19
|
+
'studio.fresh.critique.failed': 'The critique did not finish. Take the full snapshot again to run it once more.',
|
|
20
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"studio.fresh.title": "Una mirada nueva antes de guardar",
|
|
3
|
+
"studio.fresh.intro": "Un segundo agente leyó el plan con ojos nuevos. Toma lo que ayude; Guardar funciona igual.",
|
|
4
|
+
"studio.fresh.running": "Un segundo agente está leyendo este paso con ojos nuevos. Mientras tanto, Guardar funciona.",
|
|
5
|
+
"studio.fresh.none": "Un segundo agente leyó este paso con ojos nuevos y no encontró nada que añadir.",
|
|
6
|
+
"studio.fresh.take": "Tomar",
|
|
7
|
+
"studio.fresh.leave": "Dejar",
|
|
8
|
+
"studio.fresh.taken": "Tomado: tu agente lo añade al plan",
|
|
9
|
+
"studio.fresh.busy": "Tu agente sigue trabajando. Tómalo de nuevo cuando termine su turno.",
|
|
10
|
+
"studio.fresh.message": "De la mirada nueva: {finding}",
|
|
11
|
+
"studio.fresh.turn": "{agent} · mirada nueva · {seconds, plural, one {# segundo} other {# segundos}}",
|
|
12
|
+
"studio.fresh.setting.label": "Una mirada nueva antes de Guardar",
|
|
13
|
+
"studio.fresh.setting.help": "Cuando tu agente cambia Resumen, Plan, Recorridos o Estructura, un segundo agente lee el paso y enumera qué corregir. Cuesta un turno más. Por ahora solo funciona con Claude Code; con Codex u OpenCode no hay ninguna.",
|
|
14
|
+
"studio.fresh.critique.title": "La crítica",
|
|
15
|
+
"studio.fresh.critique.running": "La crítica está en marcha: un agente nuevo revisa las escenas que no dibujó.",
|
|
16
|
+
"studio.fresh.critique.done": "La crítica está escrita en",
|
|
17
|
+
"studio.fresh.critique.failed": "La crítica no terminó. Toma la captura completa de nuevo para repetirla."
|
|
18
|
+
}
|
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
// product's places'. One catalog, registered once beside the workbench's.
|
|
3
3
|
import { workbenchApprovalCopy } from '@buffcore/contracts/workbench';
|
|
4
4
|
import { mergeCatalogs } from '@buffcore/i18n';
|
|
5
|
+
import compEn from './comp.en.js';
|
|
6
|
+
import compEs from './comp.es.js';
|
|
5
7
|
import drawnEn from './drawn.en.js';
|
|
6
8
|
import drawnEs from './drawn.es.json' with { type: 'json' };
|
|
7
9
|
import frameEn from './frame.en.js';
|
|
8
10
|
import frameEs from './frame.es.json' with { type: 'json' };
|
|
11
|
+
import freshEn from './fresh.en.js';
|
|
12
|
+
import freshEs from './fresh.es.json' with { type: 'json' };
|
|
9
13
|
import laterEn from './later.en.js';
|
|
10
14
|
import laterEs from './later.es.json' with { type: 'json' };
|
|
11
15
|
import levelsEn from './levels.en.js';
|
|
@@ -33,6 +37,7 @@ import workEs from './work.es.json' with { type: 'json' };
|
|
|
33
37
|
const merged = mergeCatalogs([
|
|
34
38
|
workbenchApprovalCopy,
|
|
35
39
|
{ en: structureEn, es: structureEs },
|
|
40
|
+
{ en: compEn, es: compEs },
|
|
36
41
|
{ en: prototypeEn, es: prototypeEs },
|
|
37
42
|
{ en: simpleEn, es: simpleEs },
|
|
38
43
|
{ en: releaseEn, es: releaseEs },
|
|
@@ -40,6 +45,7 @@ const merged = mergeCatalogs([
|
|
|
40
45
|
{ en: saveEn, es: saveEs },
|
|
41
46
|
{ en: drawnEn, es: drawnEs },
|
|
42
47
|
{ en: frameEn, es: frameEs },
|
|
48
|
+
{ en: freshEn, es: freshEs },
|
|
43
49
|
{ en: levelsEn, es: levelsEs },
|
|
44
50
|
{ en: loopEn, es: loopEs },
|
|
45
51
|
{ en: startEn, es: startEs },
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { AgentId, Work } from '@buffcore/contracts/workbench';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
|
+
import { type ReviewSettingProps } from './ReviewSetting.tsx';
|
|
3
4
|
import type { LoopSample } from './types.ts';
|
|
4
5
|
type AgentsSample = Pick<LoopSample, 'product' | 'agents' | 'roles' | 'contained'>;
|
|
5
6
|
type OnSet = (work: Work | 'loop', agent?: AgentId) => void;
|
|
6
|
-
export declare function AgentsPage({ sample, top, onSet, onTab, onAction, onHelp, onChoose, }: {
|
|
7
|
+
export declare function AgentsPage({ sample, top, onSet, onTab, onAction, onHelp, onChoose, review, }: {
|
|
7
8
|
sample: AgentsSample;
|
|
9
|
+
/** The fresh look before Save, with the other agent settings. */
|
|
10
|
+
review?: ReviewSettingProps;
|
|
8
11
|
onTab?: (tab: string) => void;
|
|
9
12
|
top?: ReactNode;
|
|
10
13
|
onSet?: OnSet;
|
|
@@ -12,6 +12,7 @@ import { Place } from '../frame/Place.js';
|
|
|
12
12
|
import { AgentList } from './AgentList.js';
|
|
13
13
|
import { AgentPolicies } from './AgentPolicies.js';
|
|
14
14
|
import { Path } from './parts.js';
|
|
15
|
+
import { ReviewSetting } from './ReviewSetting.js';
|
|
15
16
|
const roleStyle = {
|
|
16
17
|
display: 'flex',
|
|
17
18
|
flexWrap: 'wrap',
|
|
@@ -87,16 +88,16 @@ function RoleLine({ role, sample, first, onSet, }) {
|
|
|
87
88
|
}
|
|
88
89
|
const help = { ...captionText, fontWeight: 'var(--weight-regular)' };
|
|
89
90
|
/** Who does what: a job each, validation by a different agent, the default taking over. */
|
|
90
|
-
function Setup({ sample, onSet, onChoose, }) {
|
|
91
|
+
function Setup({ sample, onSet, onChoose, review, }) {
|
|
91
92
|
const t = useT();
|
|
92
|
-
return (_jsxs(Panel, { flush: true, title: t('studio.loop.agents.tab.setup'), action: _jsxs("span", { style: captionText, children: [t('studio.loop.agents.savedIn'), " ", _jsx(Path, { children: "plan/agents.md" })] }), children: [_jsx("ul", { onFocus: onChoose, style: { listStyle: 'none', margin: 0, padding: 0, display: 'grid' }, children: sample.roles.map((r, i) => (_jsx(RoleLine, { role: r, sample: sample, first: i === 0, onSet: onSet }, r.id))) }), _jsx(AgentPolicies, {})] }));
|
|
93
|
+
return (_jsxs(Panel, { flush: true, title: t('studio.loop.agents.tab.setup'), action: _jsxs("span", { style: captionText, children: [t('studio.loop.agents.savedIn'), " ", _jsx(Path, { children: "plan/agents.md" })] }), children: [_jsx("ul", { onFocus: onChoose, style: { listStyle: 'none', margin: 0, padding: 0, display: 'grid' }, children: sample.roles.map((r, i) => (_jsx(RoleLine, { role: r, sample: sample, first: i === 0, onSet: onSet }, r.id))) }), review && _jsx(ReviewSetting, { ...review }), _jsx(AgentPolicies, {})] }));
|
|
93
94
|
}
|
|
94
95
|
function InstalledAgents({ sample, onSet, onAction, onHelp, }) {
|
|
95
96
|
const t = useT();
|
|
96
97
|
const machine = useMachine(sample.product);
|
|
97
98
|
return (_jsxs(Panel, { title: t('studio.loop.agents.on', { where: machine.short }), children: [_jsx(AgentList, { onHelp: onHelp, onAction: onAction, agents: sample.agents, actions: true, onSet: onSet, contained: sample.contained }), _jsx("p", { style: { ...help, margin: 0 }, children: t('studio.loop.agents.own', { where: machine.short }) })] }));
|
|
98
99
|
}
|
|
99
|
-
export function AgentsPage({ sample, top, onSet, onTab, onAction, onHelp, onChoose, }) {
|
|
100
|
+
export function AgentsPage({ sample, top, onSet, onTab, onAction, onHelp, onChoose, review, }) {
|
|
100
101
|
const t = useT();
|
|
101
102
|
const machine = useMachine(sample.product);
|
|
102
103
|
const chats = t('studio.loop.agents.tab.chats');
|
|
@@ -104,5 +105,5 @@ export function AgentsPage({ sample, top, onSet, onTab, onAction, onHelp, onChoo
|
|
|
104
105
|
['setup', t('studio.loop.agents.tab.setup')],
|
|
105
106
|
['chats', chats],
|
|
106
107
|
] }));
|
|
107
|
-
return (_jsxs(Page, { crumbs: [machine.name], title: t('studio.frame.page.agents'), sub: t('studio.loop.agents.lead'), children: [top, onTab && tabs(undefined), _jsx(Place, { id: "tabs:agents" }), _jsx(InstalledAgents, { sample: sample, onSet: onSet, onAction: onAction, onHelp: onHelp }), _jsx(Setup, { sample: sample, onSet: onSet, onChoose: onChoose }), _jsx(Place, { id: "agents.end" })] }));
|
|
108
|
+
return (_jsxs(Page, { crumbs: [machine.name], title: t('studio.frame.page.agents'), sub: t('studio.loop.agents.lead'), children: [top, onTab && tabs(undefined), _jsx(Place, { id: "tabs:agents" }), _jsx(InstalledAgents, { sample: sample, onSet: onSet, onAction: onAction, onHelp: onHelp }), _jsx(Setup, { sample: sample, onSet: onSet, onChoose: onChoose, review: review }), _jsx(Place, { id: "agents.end" })] }));
|
|
108
109
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useT } from '@buffcore/i18n/react';
|
|
3
|
+
import { Panel } from '../../../components/Panel.js';
|
|
4
|
+
import { captionText } from '../../../components/styles.js';
|
|
5
|
+
import { Path } from './parts.js';
|
|
6
|
+
export function CritiqueNote({ critique }) {
|
|
7
|
+
const t = useT();
|
|
8
|
+
return (_jsxs(Panel, { title: t('studio.fresh.critique.title'), children: [critique.state === 'running' && (_jsx("p", { role: "status", style: { margin: 0 }, children: t('studio.fresh.critique.running') })), critique.state === 'done' && critique.file && (_jsxs("p", { role: "status", style: { margin: 0, overflowWrap: 'anywhere' }, children: [t('studio.fresh.critique.done'), " ", _jsx(Path, { children: critique.file })] })), critique.state === 'failed' && (_jsx("p", { role: "status", style: { margin: 0 }, children: t('studio.fresh.critique.failed') })), critique.seconds !== undefined && (_jsx("p", { style: { ...captionText, fontWeight: 'var(--weight-regular)', margin: 0 }, children: t('studio.fresh.turn', { agent: critique.agent, seconds: critique.seconds }) }))] }));
|
|
9
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { FreshFinding, FreshReview } from '@buffcore/contracts/workbench';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export interface FreshLook {
|
|
4
|
+
review: FreshReview;
|
|
5
|
+
/** The step's agent, by name. */
|
|
6
|
+
agent: string;
|
|
7
|
+
/** A finding whose Take could not be sent: the agent was still working. */
|
|
8
|
+
busy?: string;
|
|
9
|
+
onTake?: (finding: FreshFinding) => void;
|
|
10
|
+
onLeave?: (finding: FreshFinding) => void;
|
|
11
|
+
}
|
|
12
|
+
/** Whether there is anything to show: a review running, findings not left, or a clean read. */
|
|
13
|
+
export declare function freshShown(look: FreshLook | undefined): look is FreshLook;
|
|
14
|
+
export declare function FreshLookPanel({ look }: {
|
|
15
|
+
look: FreshLook;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
/** The findings beside Save on a wide page (3 to 2), stacked on a phone. */
|
|
18
|
+
export declare function BesideSave({ look, save }: {
|
|
19
|
+
look: FreshLook;
|
|
20
|
+
save: ReactNode;
|
|
21
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useT } from '@buffcore/i18n/react';
|
|
3
|
+
import { Button } from '../../../components/Button.js';
|
|
4
|
+
import { Icon } from '../../../components/Icon.js';
|
|
5
|
+
import { Panel } from '../../../components/Panel.js';
|
|
6
|
+
import { bodyText, captionText } from '../../../components/styles.js';
|
|
7
|
+
import { useNarrow } from '../../../use-narrow.js';
|
|
8
|
+
import { NARROW_BELOW } from '../frame/layout.js';
|
|
9
|
+
const control = { minBlockSize: 'var(--control-lg)' };
|
|
10
|
+
/** Whether there is anything to show: a review running, findings not left, or a clean read. */
|
|
11
|
+
export function freshShown(look) {
|
|
12
|
+
const review = look?.review;
|
|
13
|
+
if (!review || review.state === 'failed')
|
|
14
|
+
return false;
|
|
15
|
+
if (review.state === 'running')
|
|
16
|
+
return true;
|
|
17
|
+
return review.findings.length === 0 || review.findings.some((f) => f.answer !== 'left');
|
|
18
|
+
}
|
|
19
|
+
function Finding({ finding, look }) {
|
|
20
|
+
const t = useT();
|
|
21
|
+
return (_jsxs("li", { style: {
|
|
22
|
+
display: 'grid',
|
|
23
|
+
gap: 'var(--space-2)',
|
|
24
|
+
paddingBlockStart: 'var(--space-3)',
|
|
25
|
+
borderBlockStart: 'var(--border-width-hairline) solid var(--border-hairline)',
|
|
26
|
+
}, children: [_jsx("p", { style: { ...bodyText, margin: 0, color: 'var(--text-strong)' }, children: finding.text }), finding.answer === 'taken' ? (_jsxs("p", { role: "status", style: {
|
|
27
|
+
...captionText,
|
|
28
|
+
margin: 0,
|
|
29
|
+
color: 'var(--success-ink)',
|
|
30
|
+
display: 'flex',
|
|
31
|
+
gap: 'var(--space-2)',
|
|
32
|
+
}, children: [_jsx(Icon, { name: "check", size: "var(--icon-sm)" }), t('studio.fresh.taken')] })) : (_jsxs(_Fragment, { children: [_jsxs("span", { style: { display: 'flex', flexWrap: 'wrap', gap: 'var(--space-2)' }, children: [_jsx(Button, { size: "md", variant: "secondary", style: control, disabled: !look.onTake, onClick: () => look.onTake?.(finding), children: t('studio.fresh.take') }), _jsx(Button, { size: "md", variant: "ghost", style: control, disabled: !look.onLeave, onClick: () => look.onLeave?.(finding), children: t('studio.fresh.leave') })] }), look.busy === finding.id && (_jsx("p", { role: "status", style: { ...captionText, margin: 0 }, children: t('studio.fresh.busy') }))] }))] }));
|
|
33
|
+
}
|
|
34
|
+
export function FreshLookPanel({ look }) {
|
|
35
|
+
const t = useT();
|
|
36
|
+
const { review } = look;
|
|
37
|
+
const shown = review.findings.filter((finding) => finding.answer !== 'left');
|
|
38
|
+
const intro = review.state === 'running'
|
|
39
|
+
? t('studio.fresh.running')
|
|
40
|
+
: review.findings.length
|
|
41
|
+
? t('studio.fresh.intro')
|
|
42
|
+
: t('studio.fresh.none');
|
|
43
|
+
return (_jsxs(Panel, { title: t('studio.fresh.title'), children: [_jsx("p", { role: review.state === 'running' ? 'status' : undefined, style: { ...bodyText, margin: 0 }, children: intro }), review.state === 'done' && shown.length > 0 && (_jsx("ul", { style: {
|
|
44
|
+
listStyle: 'none',
|
|
45
|
+
margin: 0,
|
|
46
|
+
padding: 0,
|
|
47
|
+
display: 'grid',
|
|
48
|
+
gap: 'var(--space-3)',
|
|
49
|
+
}, children: shown.map((finding) => (_jsx(Finding, { finding: finding, look: look }, finding.id))) })), review.seconds !== undefined && (_jsx("p", { style: { ...captionText, fontWeight: 'var(--weight-regular)', margin: 0 }, children: t('studio.fresh.turn', { agent: look.agent, seconds: review.seconds }) }))] }));
|
|
50
|
+
}
|
|
51
|
+
/** The findings beside Save on a wide page (3 to 2), stacked on a phone. */
|
|
52
|
+
export function BesideSave({ look, save }) {
|
|
53
|
+
const phone = useNarrow(NARROW_BELOW);
|
|
54
|
+
return (_jsxs("div", { style: {
|
|
55
|
+
display: 'grid',
|
|
56
|
+
gap: 'var(--space-4)',
|
|
57
|
+
alignItems: 'start',
|
|
58
|
+
gridTemplateColumns: phone ? 'minmax(0, 1fr)' : 'minmax(0, 3fr) minmax(0, 2fr)',
|
|
59
|
+
}, children: [_jsx(FreshLookPanel, { look: look }), _jsx("div", { style: { display: 'grid', gap: 'var(--space-4)', minInlineSize: 0 }, children: save })] }));
|
|
60
|
+
}
|