@buffcore/admin-shell 0.8.41 → 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/admin.js +2 -1
- package/dist/components/Button.d.ts +2 -2
- package/dist/components/Button.js +7 -2
- package/dist/components/DeviceFrame.d.ts +6 -1
- package/dist/components/DeviceFrame.js +2 -2
- package/dist/components/look.d.ts +5 -0
- package/dist/components/look.js +5 -0
- package/dist/console-settings.js +4 -1
- package/dist/design-fonts.d.ts +5 -0
- package/dist/design-fonts.js +20 -0
- package/dist/prototype/PageLook.js +3 -2
- package/dist/prototype/create.d.ts +3 -1
- package/dist/prototype/create.js +0 -1
- package/dist/prototype/page.d.ts +19 -2
- package/dist/prototype/page.js +20 -2
- package/dist/prototype/shown.js +1 -1
- package/dist/prototype/viewer.d.ts +2 -0
- package/dist/prototype/viewer.js +6 -2
- 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 +28 -1
- package/dist/workbench/app/StudioApp.js +29 -20
- package/dist/workbench/app/actions.d.ts +10 -1
- package/dist/workbench/app/actions.js +9 -2
- package/dist/workbench/app/ask-card.d.ts +10 -0
- package/dist/workbench/app/ask-card.js +34 -0
- package/dist/workbench/app/chat-session.d.ts +34 -0
- package/dist/workbench/app/chat.d.ts +39 -0
- package/dist/workbench/app/frame.js +4 -2
- package/dist/workbench/app/fresh.d.ts +63 -0
- package/dist/workbench/app/fresh.js +66 -0
- package/dist/workbench/app/host-part-loader.d.ts +5 -2
- package/dist/workbench/app/host-part-module.d.ts +17 -0
- package/dist/workbench/app/host-part-module.js +55 -0
- package/dist/workbench/app/host-parts.d.ts +2 -11
- package/dist/workbench/app/host-parts.js +53 -67
- package/dist/workbench/app/level-choice.d.ts +3 -0
- package/dist/workbench/app/mount.d.ts +4 -1
- package/dist/workbench/app/mount.js +2 -2
- package/dist/workbench/app/panel-cards.d.ts +3 -3
- package/dist/workbench/app/panel-cards.js +3 -2
- package/dist/workbench/app/places.d.ts +18 -3
- package/dist/workbench/app/places.js +14 -2
- 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/scene-address.d.ts +10 -0
- package/dist/workbench/app/scene-address.js +14 -0
- package/dist/workbench/app/studio-post.js +1 -0
- package/dist/workbench/app/test/loop-fixture.d.ts +35 -8
- package/dist/workbench/app/usePrototypeUi.js +14 -0
- package/dist/workbench/app/useStudio.d.ts +43 -1
- package/dist/workbench/app/useStudio.js +8 -1
- package/dist/workbench/host-theme.d.ts +3 -0
- package/dist/workbench/host-theme.js +14 -0
- package/dist/workbench/index.d.ts +1 -0
- package/dist/workbench/index.js +1 -0
- package/dist/workbench/studio/frame/HostRailEntries.d.ts +3 -0
- package/dist/workbench/studio/frame/HostRailEntries.js +15 -0
- package/dist/workbench/studio/frame/HostSide.d.ts +6 -0
- package/dist/workbench/studio/frame/HostSide.js +31 -0
- package/dist/workbench/studio/frame/LevelChip.js +2 -1
- package/dist/workbench/studio/frame/LevelChoices.js +24 -8
- package/dist/workbench/studio/frame/LimitCard.d.ts +5 -0
- package/dist/workbench/studio/frame/LimitCard.js +26 -0
- package/dist/workbench/studio/frame/NeverAskSetting.d.ts +7 -0
- package/dist/workbench/studio/frame/NeverAskSetting.js +24 -0
- package/dist/workbench/studio/frame/PanelList.js +5 -2
- package/dist/workbench/studio/frame/PanelMessage.js +3 -0
- package/dist/workbench/studio/frame/PanelNotice.js +2 -1
- package/dist/workbench/studio/frame/PanelScenes.d.ts +5 -0
- package/dist/workbench/studio/frame/PanelScenes.js +38 -0
- package/dist/workbench/studio/frame/PermissionAskCard.d.ts +18 -0
- package/dist/workbench/studio/frame/PermissionAskCard.js +60 -0
- package/dist/workbench/studio/frame/PermissionAskFold.d.ts +12 -0
- package/dist/workbench/studio/frame/PermissionAskFold.js +54 -0
- package/dist/workbench/studio/frame/Place.d.ts +6 -2
- package/dist/workbench/studio/frame/Place.js +13 -5
- package/dist/workbench/studio/frame/SettingsSheet.js +6 -1
- package/dist/workbench/studio/frame/StudioRail.js +2 -1
- package/dist/workbench/studio/frame/panelControls.d.ts +17 -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 +39 -0
- package/dist/workbench/studio/i18n/frame.en.js +39 -0
- package/dist/workbench/studio/i18n/frame.es.json +40 -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/i18n/levels.en.d.ts +5 -0
- package/dist/workbench/studio/i18n/levels.en.js +5 -0
- package/dist/workbench/studio/i18n/levels.es.json +6 -1
- package/dist/workbench/studio/i18n/loop.en.d.ts +4 -0
- package/dist/workbench/studio/i18n/loop.en.js +4 -0
- package/dist/workbench/studio/i18n/loop.es.json +4 -0
- package/dist/workbench/studio/i18n/save.en.d.ts +1 -3
- package/dist/workbench/studio/i18n/save.en.js +13 -15
- package/dist/workbench/studio/i18n/save.es.json +14 -16
- package/dist/workbench/studio/i18n/structure.en.d.ts +6 -0
- package/dist/workbench/studio/i18n/structure.en.js +6 -0
- package/dist/workbench/studio/i18n/structure.es.d.ts +6 -0
- package/dist/workbench/studio/i18n/structure.es.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 +4 -3
- package/dist/workbench/studio/loop/PrototypeScenes.js +1 -2
- package/dist/workbench/studio/loop/PrototypeSimplePage.js +15 -7
- package/dist/workbench/studio/loop/PrototypeSnapshot.d.ts +3 -0
- package/dist/workbench/studio/loop/PrototypeSnapshot.js +7 -2
- package/dist/workbench/studio/loop/ReviewSetting.d.ts +6 -0
- package/dist/workbench/studio/loop/ReviewSetting.js +14 -0
- package/dist/workbench/studio/loop/ReviewedSave.d.ts +1 -1
- package/dist/workbench/studio/loop/ReviewedSave.js +2 -10
- package/dist/workbench/studio/loop/SaveStep.d.ts +3 -0
- package/dist/workbench/studio/loop/SaveStep.js +3 -1
- package/dist/workbench/studio/loop/ServedBrand.js +3 -3
- package/dist/workbench/studio/loop/ServedPlanning.js +1 -1
- package/dist/workbench/studio/loop/StructurePage.d.ts +7 -0
- package/dist/workbench/studio/loop/StructurePage.js +3 -2
- package/dist/workbench/studio/loop/StructurePreview.js +4 -4
- package/dist/workbench/studio/loop/StructurePrompts.js +9 -4
- package/dist/workbench/studio/loop/SurfaceChoice.d.ts +7 -0
- package/dist/workbench/studio/loop/SurfaceChoice.js +20 -0
- package/dist/workbench/studio/loop/step-state.d.ts +1 -1
- package/dist/workbench/studio/loop/step-state.js +9 -8
- package/dist/workbench/studio/loop/structure-answers.d.ts +8 -0
- package/dist/workbench/studio/loop/structure-answers.js +34 -0
- package/dist/workbench/studio/loop/usePlanningDraft.js +7 -2
- package/dist/workbench/studio/loop/usePlanningSave.d.ts +16 -2
- package/dist/workbench/studio/loop/usePlanningSave.js +40 -2
- package/dist/workbench/studio/loop/usePrototypeRecord.js +5 -4
- package/dist/workbench/studio/loop/useReviewedSave.d.ts +9 -4
- package/dist/workbench/studio/loop/useReviewedSave.js +89 -30
- package/dist/workbench/studio/run/LiveServers.js +1 -1
- package/dist/workbench/studio/run/ReleasePage.js +1 -1
- package/dist/workbench/studio/run/ReleasesPage.js +2 -2
- package/dist/workbench/studio/run/ServedRelease.js +1 -1
- package/dist/workbench/studio/work/work-test-data.d.ts +9 -4
- package/package.json +6 -6
- package/vite.d.ts +6 -1
- package/vite.js +78 -5
|
@@ -34,5 +34,11 @@ declare const _default: {
|
|
|
34
34
|
'studio.structure.state.saved': string;
|
|
35
35
|
'studio.structure.next': string;
|
|
36
36
|
'studio.structure.wait': string;
|
|
37
|
+
'studio.structure.planned': string;
|
|
38
|
+
'studio.structure.a.none': string;
|
|
39
|
+
'studio.structure.a.main': string;
|
|
40
|
+
'studio.structure.a.people': string;
|
|
41
|
+
'studio.structure.a.screen': string;
|
|
42
|
+
'studio.structure.a.planned': string;
|
|
37
43
|
};
|
|
38
44
|
export default _default;
|
|
@@ -34,4 +34,10 @@ export default {
|
|
|
34
34
|
'studio.structure.state.saved': 'Guardado',
|
|
35
35
|
'studio.structure.next': 'Está bien. Haz el prototipo',
|
|
36
36
|
'studio.structure.wait': 'Revisa y guarda la estructura antes de hacer el prototipo.',
|
|
37
|
+
'studio.structure.planned': 'planificada, {change}',
|
|
38
|
+
'studio.structure.a.none': 'Responde esto en el chat',
|
|
39
|
+
'studio.structure.a.main': '{sections} quedan siempre a mano; {first} va primero.',
|
|
40
|
+
'studio.structure.a.people': '{who}: {sections}',
|
|
41
|
+
'studio.structure.a.screen': '{section} empieza en {screen}',
|
|
42
|
+
'studio.structure.a.planned': '{section} empezará en {screen} (planificada, {change})',
|
|
37
43
|
};
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { FirstSurface } from '@buffcore/contracts/workbench';
|
|
2
|
+
import type { DesignResult } from './useDesignApproval.ts';
|
|
3
|
+
export interface CompScreen {
|
|
4
|
+
key: string;
|
|
5
|
+
title: string;
|
|
6
|
+
/** Object addresses of the screen's pictures, light and dark, once read. */
|
|
7
|
+
light?: string;
|
|
8
|
+
dark?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface PrototypeCompProps {
|
|
11
|
+
surface: FirstSurface;
|
|
12
|
+
width: number;
|
|
13
|
+
screens: readonly CompScreen[];
|
|
14
|
+
/** Reference pictures' addresses, in `design/references.md`'s order: screen n beside the nth. */
|
|
15
|
+
references: readonly (string | undefined)[];
|
|
16
|
+
approved: boolean;
|
|
17
|
+
/** Who approved it (git's user.email), once approved. */
|
|
18
|
+
approvedBy?: string;
|
|
19
|
+
needsRight?: 'approve';
|
|
20
|
+
result?: DesignResult;
|
|
21
|
+
onApprove?: () => void;
|
|
22
|
+
/** Back to the app, when the person opened an approved comp. */
|
|
23
|
+
onClose?: () => void;
|
|
24
|
+
}
|
|
25
|
+
export declare function PrototypeComp(props: PrototypeCompProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useT } from '@buffcore/i18n/react';
|
|
3
|
+
import { ActionBar } from '../../../components/ActionBar.js';
|
|
4
|
+
import { Badge } from '../../../components/Badge.js';
|
|
5
|
+
import { Button } from '../../../components/Button.js';
|
|
6
|
+
import { bodyText, captionText } from '../../../components/styles.js';
|
|
7
|
+
import { useNarrow } from '../../../use-narrow.js';
|
|
8
|
+
import { NARROW_BELOW, useDarkMode } from '../frame/layout.js';
|
|
9
|
+
import { RightAction } from '../frame/RightAction.js';
|
|
10
|
+
const frame = {
|
|
11
|
+
display: 'block',
|
|
12
|
+
inlineSize: '100%',
|
|
13
|
+
border: 'var(--border-width-hairline) solid var(--border-hairline)',
|
|
14
|
+
borderRadius: 'var(--radius-panel)',
|
|
15
|
+
boxSizing: 'border-box',
|
|
16
|
+
};
|
|
17
|
+
/** The page's own title, as a page heading draws it. */
|
|
18
|
+
const heading = {
|
|
19
|
+
margin: 0,
|
|
20
|
+
fontFamily: 'var(--font-display)',
|
|
21
|
+
fontSize: 'var(--font-size-heading-3)',
|
|
22
|
+
lineHeight: 'var(--line-height-heading-3)',
|
|
23
|
+
fontWeight: 'var(--weight-heading)',
|
|
24
|
+
letterSpacing: 'var(--tracking-tight)',
|
|
25
|
+
color: 'var(--text-strong)',
|
|
26
|
+
overflowWrap: 'anywhere',
|
|
27
|
+
};
|
|
28
|
+
export function PrototypeComp(props) {
|
|
29
|
+
const { screens, references, approved, surface, width } = props;
|
|
30
|
+
const t = useT();
|
|
31
|
+
const phone = useNarrow(NARROW_BELOW);
|
|
32
|
+
const dark = useDarkMode();
|
|
33
|
+
return (_jsxs("section", { "data-prototype-comp": true, "aria-labelledby": "prototype-comp-title", style: { display: 'grid', gap: 'var(--space-6)', padding: 'var(--space-4)', minWidth: 0 }, children: [_jsxs("header", { style: { display: 'grid', gap: 'var(--space-2)' }, children: [_jsx("h2", { id: "prototype-comp-title", style: heading, children: t('studio.comp.title') }), _jsx("p", { style: { ...bodyText, margin: 0, color: 'var(--text-muted)' }, children: t('studio.comp.intro') }), _jsx("p", { style: { ...captionText, margin: 0 }, children: t(surface === 'phone' ? 'studio.comp.phone' : 'studio.comp.desktop', { width }) })] }), screens.map((screen, i) => (_jsxs("section", { "aria-label": screen.title, style: {
|
|
34
|
+
display: 'grid',
|
|
35
|
+
gap: 'var(--space-4)',
|
|
36
|
+
gridTemplateColumns: phone ? 'minmax(0, 1fr)' : 'minmax(0, 2fr) minmax(0, 1fr)',
|
|
37
|
+
}, children: [_jsxs("div", { style: { display: 'grid', gap: 'var(--space-2)', minWidth: 0, alignContent: 'start' }, children: [_jsx("strong", { style: { ...bodyText, color: 'var(--text-strong)' }, children: screen.title }), _jsx(ScreenPicture, { screen: screen, dark: dark })] }), _jsxs("div", { style: { display: 'grid', gap: 'var(--space-2)', alignContent: 'start' }, children: [_jsx("span", { style: captionText, children: t('studio.comp.reference', { n: i + 1 }) }), references[i] ? (_jsx("img", { src: references[i], alt: t('studio.comp.reference', { n: i + 1 }), style: frame })) : (_jsx(ReferencePlaceholder, { variant: i, label: t('studio.comp.noReference') }))] })] }, screen.key))), _jsx(CompActions, { ...props, approved: approved })] }));
|
|
38
|
+
}
|
|
39
|
+
function ScreenPicture({ screen, dark }) {
|
|
40
|
+
const t = useT();
|
|
41
|
+
const src = (dark && screen.dark) || screen.light || screen.dark;
|
|
42
|
+
if (src)
|
|
43
|
+
return _jsx("img", { src: src, alt: screen.title, style: frame });
|
|
44
|
+
return (_jsx("div", { role: "img", "aria-label": t('studio.comp.noPicture'), style: { ...frame, aspectRatio: '16 / 10', background: 'var(--surface-sunken)' } }));
|
|
45
|
+
}
|
|
46
|
+
function CompActions({ approved, approvedBy, needsRight, result, onApprove, onClose, }) {
|
|
47
|
+
const t = useT();
|
|
48
|
+
return (_jsx(ActionBar, { secondary: onClose && (_jsx(Button, { variant: "ghost", size: "lg", onClick: onClose, children: t('studio.comp.back') })), status: _jsx("span", { style: captionText, children: approved
|
|
49
|
+
? t('studio.comp.approvedBy', { by: approvedBy ?? '' })
|
|
50
|
+
: (result?.output ?? t('studio.comp.change')) }), primary: approved ? (_jsx(Badge, { tone: "success", children: t('studio.comp.approved') })) : (_jsx(RightAction, { size: "lg", icon: "shield-check", needsRight: needsRight, loading: result?.busy, disabled: !onApprove, onClick: onApprove, children: t('studio.comp.approve') })) }));
|
|
51
|
+
}
|
|
52
|
+
/** A neutral stand-in where `design/references.md` names no picture: shapes, never a product. */
|
|
53
|
+
function ReferencePlaceholder({ variant, label }) {
|
|
54
|
+
const tones = ['var(--brand-tint)', 'var(--info-tint)', 'var(--success-tint)'];
|
|
55
|
+
return (_jsxs("div", { role: "img", "aria-label": label, "data-comp-placeholder": true, style: {
|
|
56
|
+
...frame,
|
|
57
|
+
aspectRatio: '4 / 3',
|
|
58
|
+
position: 'relative',
|
|
59
|
+
overflow: 'hidden',
|
|
60
|
+
background: tones[variant % tones.length],
|
|
61
|
+
}, children: [_jsx("div", { style: {
|
|
62
|
+
position: 'absolute',
|
|
63
|
+
insetInlineStart: '12%',
|
|
64
|
+
insetBlockStart: '18%',
|
|
65
|
+
width: '46%',
|
|
66
|
+
height: '58%',
|
|
67
|
+
background: 'var(--surface-card, var(--surface-panel))',
|
|
68
|
+
borderRadius: 'var(--radius-panel)',
|
|
69
|
+
} }), _jsx("div", { style: {
|
|
70
|
+
position: 'absolute',
|
|
71
|
+
insetInlineEnd: '10%',
|
|
72
|
+
insetBlockEnd: '14%',
|
|
73
|
+
width: '30%',
|
|
74
|
+
aspectRatio: '1',
|
|
75
|
+
background: 'var(--surface-pressed)',
|
|
76
|
+
borderRadius: 'var(--radius-pill)',
|
|
77
|
+
} })] }));
|
|
78
|
+
}
|
|
@@ -7,6 +7,12 @@ import type { PrototypeChecks } from './PrototypeVersionBar.tsx';
|
|
|
7
7
|
import { type ProtoView } from './protoView.ts';
|
|
8
8
|
import type { LoopMoment, LoopSample } from './types.ts';
|
|
9
9
|
export type PrototypeSample = Pick<LoopSample, 'product' | 'proto' | 'journeys' | 'choices'>;
|
|
10
|
+
/** The comp (`PrototypeComp`): shown in the app's place while `open`, else its summary below. */
|
|
11
|
+
export interface CompSlot {
|
|
12
|
+
open: boolean;
|
|
13
|
+
view: ReactNode;
|
|
14
|
+
summary?: ReactNode;
|
|
15
|
+
}
|
|
10
16
|
export interface PrototypePageProps {
|
|
11
17
|
appUrl?: string;
|
|
12
18
|
home?: PrototypeAppProps;
|
|
@@ -15,6 +21,7 @@ export interface PrototypePageProps {
|
|
|
15
21
|
};
|
|
16
22
|
title?: ReactNode;
|
|
17
23
|
reviewPanel?: ReactNode;
|
|
24
|
+
comp?: CompSlot;
|
|
18
25
|
snapshot?: PrototypeSnapshotProps;
|
|
19
26
|
onConsoleRetry?: () => void;
|
|
20
27
|
sample: PrototypeSample;
|
|
@@ -5,6 +5,7 @@ import { IsolatedFrames } from '../../../components/frame-isolation.js';
|
|
|
5
5
|
import { Page } from '../../../components/Page.js';
|
|
6
6
|
import { Loading } from '../../../components/states.js';
|
|
7
7
|
import { captionText } from '../../../components/styles.js';
|
|
8
|
+
import { HostSide } from '../frame/HostSide.js';
|
|
8
9
|
import { Place } from '../frame/Place.js';
|
|
9
10
|
import { Row } from '../work/parts.js';
|
|
10
11
|
import { hasRuleSigners } from './ApprovalSignatures.js';
|
|
@@ -30,9 +31,9 @@ export function PrototypePage(props) {
|
|
|
30
31
|
return (_jsx(PrototypeSimplePage, { ...props, view: view, preview: _jsx(PrototypeApp, { ...props.home, preview: { roles: sample.journeys, device: view.device, onDevice: props.onDevice } }) }));
|
|
31
32
|
const approve = canApprove(view);
|
|
32
33
|
const legacyHref = !props.home ? prototypeAddress(props.appUrl)?.href : undefined;
|
|
33
|
-
return (_jsxs(Page, { boundedHeader: !!props.home, crumbs: [prototypeCrumb(sample, view, t)].filter(Boolean), title: props.title ?? t('studio.frame.page.prototype'), sub: t(props.home ? 'studio.prototype.intro' : 'studio.loop.proto.lead', {
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
return (_jsx(HostSide, { subject: { change: sample.proto.change.id, version: view.version }, children: _jsxs(Page, { boundedHeader: !!props.home, crumbs: [prototypeCrumb(sample, view, t)].filter(Boolean), title: props.title ?? t('studio.frame.page.prototype'), sub: t(props.home ? 'studio.prototype.intro' : 'studio.loop.proto.lead', {
|
|
35
|
+
name: sample.product.name,
|
|
36
|
+
}), actions: !props.home && (approve || legacyHref) ? (_jsxs(Row, { children: [legacyHref && (_jsx("a", { href: legacyHref, target: "_blank", rel: "noopener noreferrer", style: { color: 'var(--brand-ink)' }, children: t('studio.loop.proto.open') })), approve && _jsx(ApproveBlock, { view: view, onApprove: onApprove })] })) : undefined, children: [props.home && _jsx("style", { children: PROTOTYPE_HOME_LAYOUT }), props.home ? (_jsxs(IsolatedFrames, { reason: t('studio.prototype.status.blocked'), children: [_jsx("span", { "data-prototype-draft": true, title: t('studio.prototype.draft'), style: captionText, children: t('studio.prototype.draft') }), props.comp?.open && props.comp.view, _jsx("div", { hidden: props.comp?.open || undefined, style: { display: props.comp?.open ? 'none' : 'contents' }, children: _jsx(PrototypeApp, { ...props.home }) }), !props.comp?.open && props.comp?.summary, _jsx(PrototypeReview, { ...props, view: view, snapshotOk: (props.home.snapshotReady ?? props.home.running) && props.home.source !== 'missing' }), _jsx(PrototypeScenes, { ...props, view: view })] })) : (_jsxs(_Fragment, { children: [_jsx(DesignLevel, { level: props.level === null ? undefined : (props.level ?? 'guide'), needsRight: !!view.needsRight, named: hasRuleSigners(view.signatures) }), _jsx(ApproveWhy, { view: view }), _jsx(PrototypeReview, { ...props, view: view })] })), _jsx(Place, { id: "approve:prototype" })] }) }));
|
|
36
37
|
}
|
|
37
38
|
function prototypeCrumb(sample, view, t) {
|
|
38
39
|
const { proto } = sample;
|
|
@@ -2,7 +2,6 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { useT } from '@buffcore/i18n/react';
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
import { useLayout } from '../frame/layout.js';
|
|
5
|
-
import { Place } from '../frame/Place.js';
|
|
6
5
|
import { CanvasBar } from './CanvasBar.js';
|
|
7
6
|
import { ControlReason } from './ControlReason.js';
|
|
8
7
|
import { Canvas, Parts } from './ProtoCanvas.js';
|
|
@@ -26,7 +25,7 @@ function JourneyColumn(props) {
|
|
|
26
25
|
const journeys = sample.journeys.flatMap((role) => role.journeys);
|
|
27
26
|
const chosen = journeys.find((journey) => journey.id === view.journey) ?? journeys[0];
|
|
28
27
|
const show = !view.live || journeys.some((journey) => journey.steps.length > 0);
|
|
29
|
-
return (
|
|
28
|
+
return (_jsx(ControlReason, { style: { flex: '1 1 14rem', maxWidth: narrow ? undefined : '18rem' }, disabled: show && (!props.onJourney || !props.onPlayer || !chosen?.steps.length), children: show && (_jsx(ProtoJourneys, { ...props, step: view.step, journey: view.journey, playing: view.playing })) }));
|
|
30
29
|
}
|
|
31
30
|
export function PrototypeScenes(props) {
|
|
32
31
|
const t = useT();
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useT } from '@buffcore/i18n/react';
|
|
3
3
|
import { visuallyHidden } from '../../../components/field.js';
|
|
4
4
|
import { IsolatedFrames } from '../../../components/frame-isolation.js';
|
|
5
|
+
import { HostSide } from '../frame/HostSide.js';
|
|
5
6
|
import { usePrototypeNarrow } from '../frame/layout.js';
|
|
6
7
|
import { Place } from '../frame/Place.js';
|
|
7
8
|
import { Compare } from './ProtoCompare.js';
|
|
@@ -15,6 +16,7 @@ export function PrototypeSimplePage(props) {
|
|
|
15
16
|
const t = useT();
|
|
16
17
|
const { view, sample, preview, home, onCompare, onPair } = props;
|
|
17
18
|
const focus = usePrototypeFocus(usePrototypeNarrow());
|
|
19
|
+
const comp = props.comp?.open && !view.compare;
|
|
18
20
|
const showProblems = home && !view.reviewOnly && props.snapshot?.reply?.status === 'failed'
|
|
19
21
|
? () => {
|
|
20
22
|
const problems = focus.root.current?.querySelector(`#${snapshotProblemsId}`);
|
|
@@ -22,17 +24,23 @@ export function PrototypeSimplePage(props) {
|
|
|
22
24
|
problems?.scrollIntoView({ block: 'start' });
|
|
23
25
|
}
|
|
24
26
|
: undefined;
|
|
25
|
-
return (_jsx(IsolatedFrames, { reason: t('studio.prototype.status.blocked'), children: _jsx(PrototypeFocus, { value: focus, children: _jsxs("div", { ref: focus.root, style: { display: 'contents' }, children: [_jsxs("section", { "data-prototype-simple": true, style: {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
return (_jsx(IsolatedFrames, { reason: t('studio.prototype.status.blocked'), children: _jsx(PrototypeFocus, { value: focus, children: _jsxs("div", { ref: focus.root, style: { display: 'contents' }, children: [_jsx(HostSide, { subject: { change: sample.proto.change.id, version: view.version }, children: _jsxs("section", { "data-prototype-simple": true, style: {
|
|
28
|
+
display: 'grid',
|
|
29
|
+
// The comp is a page of its own length; the app fills the first screen.
|
|
30
|
+
gridTemplateRows: comp
|
|
31
|
+
? 'auto auto'
|
|
32
|
+
: 'auto minmax(calc(var(--width-margin) * .6), 1fr)',
|
|
33
|
+
blockSize: comp ? undefined : '100%',
|
|
34
|
+
minBlockSize: 'calc(var(--width-margin) + var(--control-lg))',
|
|
35
|
+
}, children: [_jsx("h1", { id: prototypeHeadingId, tabIndex: -1, style: visuallyHidden, children: props.title ?? t('studio.frame.page.prototype') }), _jsx(PrototypeVersionBar, { ...props, checks: props.simple?.checks, onProblems: showProblems }), comp && props.comp?.view, _jsx("div", { hidden: view.compare || props.comp?.open || undefined, style: {
|
|
36
|
+
display: view.compare || props.comp?.open ? 'none' : 'grid',
|
|
37
|
+
minBlockSize: 0,
|
|
38
|
+
}, children: preview }), view.compare && _jsx(PrototypeComparison, { sample, view, onCompare, onPair })] }) }), home && (_jsxs("div", { style: {
|
|
31
39
|
display: 'grid',
|
|
32
40
|
padding: 'var(--space-4)',
|
|
33
41
|
gap: 'var(--space-3)',
|
|
34
42
|
minInlineSize: 0,
|
|
35
|
-
}, children: [_jsx(PrototypeReview, { ...props, snapshotOk: (home.snapshotReady ?? home.running) && home.source !== 'missing' }), _jsx(PrototypeScenes, { ...props }), _jsx(Place, { id: "approve:prototype" })] }))] }) }) }));
|
|
43
|
+
}, children: [!props.comp?.open && props.comp?.summary, _jsx(PrototypeReview, { ...props, snapshotOk: (home.snapshotReady ?? home.running) && home.source !== 'missing' }), _jsx(PrototypeScenes, { ...props }), _jsx(Place, { id: "approve:prototype" })] }))] }) }) }));
|
|
36
44
|
}
|
|
37
45
|
function PrototypeComparison({ sample, view, onCompare, onPair, }) {
|
|
38
46
|
const dismiss = usePrototypePanel('compare', () => onCompare?.(view.version, view.version));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { FreshCritique } from '@buffcore/contracts/workbench';
|
|
1
2
|
import { type SnapshotReply } from '../../app/prototype-snapshot.ts';
|
|
2
3
|
import type { RecordResult } from './usePrototypeRecord.ts';
|
|
3
4
|
export interface PrototypeSnapshotProps {
|
|
@@ -16,6 +17,8 @@ export interface PrototypeSnapshotProps {
|
|
|
16
17
|
onStart: () => void;
|
|
17
18
|
onStop: () => void;
|
|
18
19
|
onRecord: () => void;
|
|
20
|
+
/** The critique a fresh agent writes after a passing full snapshot. */
|
|
21
|
+
critique?: FreshCritique;
|
|
19
22
|
}
|
|
20
23
|
/** The approved manual path, with source and execution supplied by the container. */
|
|
21
24
|
export declare function PrototypeSnapshot(props: PrototypeSnapshotProps): import("react").JSX.Element;
|
|
@@ -6,6 +6,7 @@ import { Panel } from '../../../components/Panel.js';
|
|
|
6
6
|
import { Loading } from '../../../components/states.js';
|
|
7
7
|
import { captionText } from '../../../components/styles.js';
|
|
8
8
|
import { snapshotMatches, snapshotReadFailure, } from '../../app/prototype-snapshot.js';
|
|
9
|
+
import { CritiqueNote } from './CritiqueNote.js';
|
|
9
10
|
import { RecordFeedback } from './RecordFeedback.js';
|
|
10
11
|
import { SnapshotProblems } from './SnapshotProblems.js';
|
|
11
12
|
const stack = { display: 'grid', gap: 'var(--space-3)', minInlineSize: 0 };
|
|
@@ -49,7 +50,7 @@ export function PrototypeSnapshot(props) {
|
|
|
49
50
|
? sourceMissing
|
|
50
51
|
? 'studio.loop.snapshot.addChange'
|
|
51
52
|
: 'studio.loop.snapshot.empty'
|
|
52
|
-
: snapshotReadFailure(props.failure)) }))), reply?.source.dirty && !linked && (_jsx("p", { role: "status", children: t('studio.loop.snapshot.status.unsaved') })), saveNeeded && (_jsx(Button, { variant: props.quiet ? 'secondary' : undefined, size: "lg", style: button, disabled: running || record.busy, onClick: onSave, children: t('studio.loop.snapshot.save') })), _jsx(RecordFeedback, { result: record })] }), _jsxs(Panel, { title: t('studio.loop.snapshot.take'), children: [result && (_jsx("p", { role: "status", style: { margin: 0 }, children: t('studio.loop.snapshot.result', { count: result.scenes }) })), running && (_jsx("p", { role: "status", style: { margin: 0 }, children: t(reply?.status === 'running' && reply.progress?.total !== undefined
|
|
53
|
+
: snapshotReadFailure(props.failure)) }))), reply?.source.dirty && !linked && (_jsx("p", { role: "status", children: t('studio.loop.snapshot.status.unsaved') })), saveNeeded && !listing(record) && (_jsx(Button, { variant: props.quiet ? 'secondary' : undefined, size: "lg", style: button, disabled: running || record.busy, onClick: onSave, children: t('studio.loop.snapshot.save') })), _jsx(RecordFeedback, { result: record })] }), _jsxs(Panel, { title: t('studio.loop.snapshot.take'), children: [result && (_jsx("p", { role: "status", style: { margin: 0 }, children: t('studio.loop.snapshot.result', { count: result.scenes }) })), running && (_jsx("p", { role: "status", style: { margin: 0 }, children: t(reply?.status === 'running' && reply.progress?.total !== undefined
|
|
53
54
|
? 'studio.loop.snapshot.progress'
|
|
54
55
|
: 'studio.loop.snapshot.status.running', {
|
|
55
56
|
done: reply?.progress?.done ?? 0,
|
|
@@ -71,9 +72,13 @@ export function PrototypeSnapshot(props) {
|
|
|
71
72
|
record.busy ||
|
|
72
73
|
!!record.why ||
|
|
73
74
|
record.recorded ||
|
|
74
|
-
(!!record.review && record.review.phase !== 'saved'), loading: record.busy, "aria-describedby": "prototype-record-reason", onClick: onRecord, children: t('studio.loop.proto.recordVersion') })] }), _jsxs(Panel, { title: t('studio.loop.snapshot.approve'), children: [_jsx("p", { style: { margin: 0 }, children: t('studio.loop.snapshot.approval') }), reused?.map(({ scene, commit }) => (_jsxs("p", { style: { margin: 0, overflowWrap: 'anywhere' }, children: [_jsx("span", { translate: "no", children: scene }), ' ', _jsx(Chip, { size: "sm", children: t('studio.loop.snapshot.reused', { commit: commit.slice(0, 12) }) })] }, scene))), withoutApi?.map((scene) => (_jsxs("p", { style: { margin: 0, overflowWrap: 'anywhere' }, children: [_jsx("span", { translate: "no", children: scene }), ' ', _jsx(Chip, { size: "sm", children: t('studio.loop.snapshot.noApi') })] }, scene)))] })] }));
|
|
75
|
+
(!!record.review && record.review.phase !== 'saved'), loading: record.busy, "aria-describedby": "prototype-record-reason", onClick: onRecord, children: t('studio.loop.proto.recordVersion') })] }), _jsxs(Panel, { title: t('studio.loop.snapshot.approve'), children: [_jsx("p", { style: { margin: 0 }, children: t('studio.loop.snapshot.approval') }), reused?.map(({ scene, commit }) => (_jsxs("p", { style: { margin: 0, overflowWrap: 'anywhere' }, children: [_jsx("span", { translate: "no", children: scene }), ' ', _jsx(Chip, { size: "sm", children: t('studio.loop.snapshot.reused', { commit: commit.slice(0, 12) }) })] }, scene))), withoutApi?.map((scene) => (_jsxs("p", { style: { margin: 0, overflowWrap: 'anywhere' }, children: [_jsx("span", { translate: "no", children: scene }), ' ', _jsx(Chip, { size: "sm", children: t('studio.loop.snapshot.noApi') })] }, scene)))] }), props.critique && _jsx(CritiqueNote, { critique: props.critique })] }));
|
|
75
76
|
}
|
|
76
77
|
function Identity({ source }) {
|
|
77
78
|
const t = useT();
|
|
78
79
|
return (_jsxs("dl", { style: { ...stack, margin: 0, gap: 'var(--space-1)', overflowWrap: 'anywhere' }, children: [_jsx("dt", { style: captionText, children: t('studio.loop.snapshot.checkout') }), _jsx("dd", { translate: "no", style: { margin: 0 }, children: source.checkout }), _jsx("dt", { style: captionText, children: t('studio.loop.snapshot.commit') }), _jsx("dd", { translate: "no", style: { margin: 0 }, children: source.commit })] }));
|
|
79
80
|
}
|
|
81
|
+
/** The file list's own Save stands in for the panel's while the list shows. */
|
|
82
|
+
function listing(record) {
|
|
83
|
+
return ['loading', 'preview', 'changed', 'refused', 'saving'].includes(record.review?.phase ?? '');
|
|
84
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Settings › Agents: the fresh look before Save, on by default. Kept in plan/agents.md with the
|
|
3
|
+
// other agent settings; off, no second agent reads the planning steps.
|
|
4
|
+
import { useT } from '@buffcore/i18n/react';
|
|
5
|
+
import { SettingRow } from '../../../components/SettingRow.js';
|
|
6
|
+
import { Switch } from '../../../components/Switch.js';
|
|
7
|
+
export function ReviewSetting({ on, onChange }) {
|
|
8
|
+
const t = useT();
|
|
9
|
+
const label = t('studio.fresh.setting.label');
|
|
10
|
+
return (_jsx("div", { style: {
|
|
11
|
+
padding: '0 var(--space-5)',
|
|
12
|
+
borderBlockStart: 'var(--border-width-hairline) solid var(--border-hairline)',
|
|
13
|
+
}, children: _jsx(SettingRow, { first: true, label: label, help: t('studio.fresh.setting.help'), children: _jsx(Switch, { on: on, label: label, onChange: onChange, disabled: !onChange, touchTarget: true }) }) }));
|
|
14
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReviewedSave } from './useReviewedSave.ts';
|
|
2
|
-
/** The same
|
|
2
|
+
/** The same one-click save for every studio step: the files shown, ticked, and one Save. */
|
|
3
3
|
export declare function ReviewedSaveView({ save }: {
|
|
4
4
|
save: ReviewedSave;
|
|
5
5
|
}): import("react").JSX.Element;
|
|
@@ -15,7 +15,7 @@ const button = {
|
|
|
15
15
|
paddingBlock: 'var(--space-2)',
|
|
16
16
|
};
|
|
17
17
|
const code = { ...monoText, overflowWrap: 'anywhere' };
|
|
18
|
-
/** The same
|
|
18
|
+
/** The same one-click save for every studio step: the files shown, ticked, and one Save. */
|
|
19
19
|
export function ReviewedSaveView({ save }) {
|
|
20
20
|
const t = useT();
|
|
21
21
|
const completed = ['saved', 'recovery'].includes(save.phase);
|
|
@@ -25,13 +25,5 @@ export function ReviewedSaveView({ save }) {
|
|
|
25
25
|
gridTemplateColumns: 'repeat(auto-fit, minmax(min(100%, calc(var(--space-6) * 18)), 1fr))',
|
|
26
26
|
}, children: [_jsxs(Panel, { title: t(completed ? 'studio.save.savedFiles' : 'studio.save.title'), children: [!completed && _jsx("span", { children: t('studio.save.count', { count: save.files.length }) }), !completed && (_jsx("p", { style: { margin: 0 }, children: t(save.step === 'prototype'
|
|
27
27
|
? 'studio.save.prototypeSelectionRule'
|
|
28
|
-
: 'studio.save.selectionRule') })), _jsx(ReviewedSaveFiles, { save: save }), save.fingerprint && (_jsxs(_Fragment, { children: [_jsx("span", { children: t('studio.save.identity') }), _jsx("code", { translate: "no", style: code, children: save.fingerprint })] })), save.
|
|
29
|
-
save.reviewed === save.fingerprint &&
|
|
30
|
-
save.files.length
|
|
31
|
-
? save.confirm
|
|
32
|
-
: save.review, children: t(save.phase === 'reviewed' &&
|
|
33
|
-
save.reviewed === save.fingerprint &&
|
|
34
|
-
save.files.length
|
|
35
|
-
? 'studio.save.confirm'
|
|
36
|
-
: 'studio.save.review') })] }))] })), save.detail && (_jsx("p", { role: "status", style: { margin: 0, whiteSpace: 'pre-wrap' }, children: save.detail }))] }));
|
|
28
|
+
: 'studio.save.selectionRule') })), _jsx(ReviewedSaveFiles, { save: save }), save.fingerprint && (_jsxs(_Fragment, { children: [_jsx("span", { children: t('studio.save.identity') }), _jsx("code", { translate: "no", style: code, children: save.fingerprint })] })), save.commit && (_jsx("code", { translate: "no", style: code, children: save.commit }))] }), !completed && (_jsx(Panel, { title: t('studio.save.excluded'), children: _jsx("p", { style: { margin: 0 }, children: t('studio.save.excludeNote') }) }))] }), save.phase === 'recovery' && (_jsxs(_Fragment, { children: [_jsx("p", { style: { margin: 0 }, children: t('studio.save.recoveryNote') }), _jsx(Button, { size: "lg", style: button, onClick: save.reload, children: t('studio.save.reload') })] })), save.phase === 'refused' && (_jsxs(Panel, { title: t('studio.save.hook'), children: [save.refusal?.file && (_jsx("code", { translate: "no", style: code, children: savePathLabel(save.refusal.file) })), _jsx("p", { style: { margin: 0, whiteSpace: 'pre-wrap' }, children: save.refusal?.reason }), _jsx("p", { style: { margin: 0 }, children: t('studio.save.retryNote') }), _jsx(Button, { size: "lg", style: button, onClick: save.confirm, children: t('studio.save.retry') })] })), ['preview', 'changed'].includes(save.phase) && (_jsxs(_Fragment, { children: [!save.files.length && _jsx("p", { style: { margin: 0 }, children: t('studio.save.empty') }), !save.files.length && (_jsx(Button, { size: "lg", style: button, onClick: save.reload, children: t('studio.save.reload') })), save.checking && (_jsx("p", { role: "status", style: { margin: 0 }, children: t('studio.save.checking') })), _jsx(Button, { size: "lg", style: button, disabled: !save.files.length || !!save.checking, onClick: save.confirm, children: t('studio.save.confirm') })] }))] })), save.detail && (_jsx("p", { role: "status", style: { margin: 0, whiteSpace: 'pre-wrap' }, children: save.detail }))] }));
|
|
37
29
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { T } from '@buffcore/i18n';
|
|
2
|
+
import { type FreshLook } from './FreshLookPanel.tsx';
|
|
2
3
|
import type { ReviewedSave } from './useReviewedSave.ts';
|
|
3
4
|
export interface StepSave {
|
|
4
5
|
state: 'unsaved' | 'saved' | 'writing' | 'saving' | 'unknown';
|
|
@@ -22,6 +23,8 @@ export interface StepDraft {
|
|
|
22
23
|
why?: string;
|
|
23
24
|
writing?: boolean;
|
|
24
25
|
error?: string;
|
|
26
|
+
/** A fresh agent's findings, beside Save (and beside the saved step on Autopilot). */
|
|
27
|
+
fresh?: FreshLook;
|
|
25
28
|
}
|
|
26
29
|
/** Every path in the review card's collapsed, scrolling list; the summary says what they are. */
|
|
27
30
|
export declare function FileNames({ files, summary }: {
|
|
@@ -4,6 +4,7 @@ import { Badge } from '../../../components/Badge.js';
|
|
|
4
4
|
import { Banner } from '../../../components/Banner.js';
|
|
5
5
|
import { Icon } from '../../../components/Icon.js';
|
|
6
6
|
import { bodyText, captionText, monoText, panelSurface } from '../../../components/styles.js';
|
|
7
|
+
import { BesideSave, freshShown } from './FreshLookPanel.js';
|
|
7
8
|
import { ReasonButton } from './ReasonButton.js';
|
|
8
9
|
import { ReviewedSaveView } from './ReviewedSave.js';
|
|
9
10
|
import { fileList, fileSummary } from './ReviewedSaveFiles.js';
|
|
@@ -73,7 +74,8 @@ export function WritingNote({ agent }) {
|
|
|
73
74
|
}
|
|
74
75
|
/** A step page's drafted notes, under its header: writing first, then the save. */
|
|
75
76
|
export function StepNotes({ draft, agent }) {
|
|
76
|
-
|
|
77
|
+
const save = draft.review ? (_jsx(ReviewedSaveView, { save: draft.review })) : (draft.save && _jsx(SaveStep, { save: draft.save, agent: agent, onSave: draft.onSave }));
|
|
78
|
+
return (_jsxs(_Fragment, { children: [draft.writing && _jsx(WritingNote, { agent: agent }), freshShown(draft.fresh) ? _jsx(BesideSave, { look: draft.fresh, save: save }) : save, draft.error && _jsx(Banner, { tone: "error", children: draft.error })] }));
|
|
77
79
|
}
|
|
78
80
|
function saveReason(save, agent, t) {
|
|
79
81
|
if (save.state === 'writing')
|
|
@@ -8,7 +8,7 @@ import { useIconUpload } from '../../app/useIcon.js';
|
|
|
8
8
|
import { BrandChangedCard, brandFrom } from './BrandApproval.js';
|
|
9
9
|
import { BrandPage } from './BrandPage.js';
|
|
10
10
|
import { useDesignApproval } from './useDesignApproval.js';
|
|
11
|
-
import { usePlanningSave } from './usePlanningSave.js';
|
|
11
|
+
import { useListOnOpen, usePlanningSave, viewerCanBuild } from './usePlanningSave.js';
|
|
12
12
|
export function ServedBrand(props) {
|
|
13
13
|
const { state, onStep, actions, iconSrc } = props;
|
|
14
14
|
const t = useT();
|
|
@@ -16,8 +16,7 @@ export function ServedBrand(props) {
|
|
|
16
16
|
const picked = direction ?? (state.plan?.brandChanged ? state.plan.theme : undefined);
|
|
17
17
|
const brand = productBrand(brandProps(state, t, picked), state, t);
|
|
18
18
|
const writing = state.chats?.some((chat) => !chat.change && chat.state === 'running') ?? false;
|
|
19
|
-
const
|
|
20
|
-
const upload = useIconUpload(!rights || rights === 'all' || rights.includes('build') ? actions.uploadIcon : undefined);
|
|
19
|
+
const upload = useIconUpload(viewerCanBuild(state) ? actions.uploadIcon : undefined);
|
|
21
20
|
const icon = brand.icon && {
|
|
22
21
|
...brand.icon,
|
|
23
22
|
src: iconSrc,
|
|
@@ -85,6 +84,7 @@ function BrandStep(props) {
|
|
|
85
84
|
const level = state.effectiveLevel;
|
|
86
85
|
const applied = state.plan?.theme === brand.brandPick.id;
|
|
87
86
|
const approval = brandApproval(state, brand);
|
|
87
|
+
useListOnOpen(approval ? undefined : draft, viewerCanBuild(state));
|
|
88
88
|
return (_jsxs(_Fragment, { children: [_jsx(BrandChangedCard, { changed: state.plan?.brandChanged }), _jsx(BrandPage, { sample: brand, icon: icon, level: level ?? null, picked: brand.brandPick.id, onPick: onPick, sub: applied
|
|
89
89
|
? brand.directions.find((item) => item.id === brand.brandPick.id)?.description
|
|
90
90
|
: t('studio.loop.brand.applying'), approvalPending: !applied, needsRight: missingApproval(state.viewer, 'approve:brand'), approvalWhy: !state.plan?.themeFingerprint ? t('studio.loop.brand.whyColors') : undefined, draft: approval ? undefined : draft, approval: approval, approvedBy: approval?.name, approvalResult: signing.result, ...brandHandlers(props, signing, applied && draft.save?.state === 'saved', t) })] }));
|
|
@@ -12,7 +12,7 @@ export function ServedPlanning(props) {
|
|
|
12
12
|
const planning = usePlanningDraft(props);
|
|
13
13
|
const { step, draft, onNext, send } = planning;
|
|
14
14
|
if (step === 'structure')
|
|
15
|
-
return (_jsx(StructurePage, { agent: briefProps(state).product.agent.name, structure: state.plan?.structure, problem: state.plan?.structure?.problem, journeys: state.plan?.journeys ?? [], progress: draft.progress ?? 'not-started', draft: draft, onStart: send, onNext: onNext }));
|
|
15
|
+
return (_jsx(StructurePage, { agent: briefProps(state).product.agent.name, structure: state.plan?.structure, problem: state.plan?.structure?.problem, journeys: state.plan?.journeys ?? [], progress: draft.progress ?? 'not-started', draft: draft, onStart: send, onNext: onNext, onSurface: props.actions.chooseSurface }));
|
|
16
16
|
if (step === 'brief')
|
|
17
17
|
return _jsx(ServedBrief, { ...props, ...planning });
|
|
18
18
|
if (step === 'plan')
|