@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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { FirstSurface } from '@buffcore/contracts/workbench';
|
|
1
2
|
import { type StepDraft } from './SaveStep.tsx';
|
|
2
3
|
export interface StructurePlan {
|
|
3
4
|
rows: readonly {
|
|
@@ -6,8 +7,12 @@ export interface StructurePlan {
|
|
|
6
7
|
who: string;
|
|
7
8
|
place: string;
|
|
8
9
|
main: boolean;
|
|
10
|
+
/** The change that adds this first screen, while its route does not exist yet. */
|
|
11
|
+
planned?: string;
|
|
9
12
|
}[];
|
|
10
13
|
notes: readonly string[];
|
|
14
|
+
/** Which surface comes first; absent, desktop. */
|
|
15
|
+
surface?: FirstSurface;
|
|
11
16
|
}
|
|
12
17
|
export interface StructurePageProps {
|
|
13
18
|
agent: string;
|
|
@@ -21,6 +26,8 @@ export interface StructurePageProps {
|
|
|
21
26
|
problem?: string;
|
|
22
27
|
onStart?: (label: string) => void;
|
|
23
28
|
onNext?: (label: string) => void;
|
|
29
|
+
/** The person's answer to Which surface comes first, kept in the structure file. */
|
|
30
|
+
onSurface?: (surface: FirstSurface) => void;
|
|
24
31
|
}
|
|
25
32
|
/** Structure describes navigation intent; planning chat writes the file, the shared save commits it. */
|
|
26
33
|
export declare function StructurePage(props: StructurePageProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useT } from '@buffcore/i18n/react';
|
|
3
3
|
import { Badge } from '../../../components/Badge.js';
|
|
4
4
|
import { Banner } from '../../../components/Banner.js';
|
|
@@ -8,6 +8,7 @@ import { ReasonButton } from './ReasonButton.js';
|
|
|
8
8
|
import { nextReason, StepNotes } from './SaveStep.js';
|
|
9
9
|
import { StructureFile } from './StructurePreview.js';
|
|
10
10
|
import { StructurePrompts } from './StructurePrompts.js';
|
|
11
|
+
import { SurfaceChoice } from './SurfaceChoice.js';
|
|
11
12
|
/** Structure describes navigation intent; planning chat writes the file, the shared save commits it. */
|
|
12
13
|
export function StructurePage(props) {
|
|
13
14
|
const { agent, structure, draft, progress, problem, onNext } = props;
|
|
@@ -16,5 +17,5 @@ export function StructurePage(props) {
|
|
|
16
17
|
const why = problem ||
|
|
17
18
|
nextReason(draft, t) ||
|
|
18
19
|
(progress !== 'saved' ? t('studio.structure.wait') : undefined);
|
|
19
|
-
return (_jsxs(Page, { crumbs: [t('studio.frame.rail.step', { n: 5 }), t('studio.frame.page.structure')], title: t('studio.structure.title'), sub: t('studio.structure.sub'), actions: _jsx(ReasonButton, { size: "sm", disabled: !onNext, why: why, onClick: () => onNext?.(label), children: label }), children: [_jsx(Badge, { tone: progress === 'saved' ? 'success' : 'neutral', style: { justifySelf: 'start' }, children: t(`studio.structure.state.${progress}`) }), draft && progress !== 'not-started' && _jsx(StepNotes, { draft: draft, agent: agent }), problem && _jsx(Banner, { tone: "error", children: problem }), _jsx(TwoColumns, { main: _jsx(StructurePrompts, { ...props }), side: _jsx(StructureFile, { structure: structure, problem: problem }) })] }));
|
|
20
|
+
return (_jsxs(Page, { crumbs: [t('studio.frame.rail.step', { n: 5 }), t('studio.frame.page.structure')], title: t('studio.structure.title'), sub: t('studio.structure.sub'), actions: _jsx(ReasonButton, { size: "sm", disabled: !onNext, why: why, onClick: () => onNext?.(label), children: label }), children: [_jsx(Badge, { tone: progress === 'saved' ? 'success' : 'neutral', style: { justifySelf: 'start', alignSelf: 'flex-start' }, children: t(`studio.structure.state.${progress}`) }), draft && progress !== 'not-started' && _jsx(StepNotes, { draft: draft, agent: agent }), problem && _jsx(Banner, { tone: "error", children: problem }), _jsx(TwoColumns, { main: _jsxs(_Fragment, { children: [_jsx(SurfaceChoice, { surface: structure?.surface, drafted: !!structure && !problem, onSurface: props.onSurface }), _jsx(StructurePrompts, { ...props })] }), side: _jsx(StructureFile, { structure: structure, problem: problem }) })] }));
|
|
20
21
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useT } from '@buffcore/i18n/react';
|
|
3
3
|
import { Panel } from '../../../components/Panel.js';
|
|
4
|
-
import { bodyText, monoText } from '../../../components/styles.js';
|
|
4
|
+
import { bodyText, captionText, monoText } from '../../../components/styles.js';
|
|
5
5
|
export function StructureFile({ structure, problem, }) {
|
|
6
6
|
const t = useT();
|
|
7
7
|
return (_jsxs(Panel, { title: t('studio.structure.file'), children: [_jsx("code", { translate: "no", style: monoText, children: "plan/structure.md" }), _jsx("p", { style: { margin: 0 }, children: t('studio.structure.fileHelp') }), structure?.rows.length ? (_jsx(StructurePreview, { structure: structure })) : (_jsx("p", { style: { margin: 0 }, children: t(problem ? 'studio.structure.invalid' : 'studio.structure.empty') })), _jsx("p", { style: { ...bodyText, margin: 0 }, children: t('studio.structure.boundary') })] }));
|
|
@@ -12,15 +12,15 @@ function StructurePreview({ structure }) {
|
|
|
12
12
|
...bodyText,
|
|
13
13
|
borderCollapse: 'collapse',
|
|
14
14
|
inlineSize: '100%',
|
|
15
|
-
|
|
16
|
-
overflowWrap: '
|
|
15
|
+
// Words stay whole; a cell too long for a phone scrolls inside the table's own frame.
|
|
16
|
+
overflowWrap: 'break-word',
|
|
17
17
|
}, children: [_jsx("caption", { style: { textAlign: 'start', paddingBlockEnd: 'var(--space-2)' }, children: t('studio.structure.order') }), _jsx("thead", { children: _jsx("tr", { children: ['section', 'screen', 'who', 'place', 'main'].map((key) => (_jsx("th", { scope: "col", style: { textAlign: 'start', padding: 'var(--space-2)' }, children: t(`studio.structure.column.${key}`) }, key))) }) }), _jsx(StructureRows, { rows: structure.rows })] }) }), structure.notes.map((note) => (_jsx("p", { style: { margin: 0 }, children: note }, note)))] }));
|
|
18
18
|
}
|
|
19
19
|
function StructureRows({ rows }) {
|
|
20
20
|
const t = useT();
|
|
21
21
|
return (_jsx("tbody", { children: rows.map((row) => (_jsx("tr", { children: [
|
|
22
22
|
row.section,
|
|
23
|
-
row.screen,
|
|
23
|
+
row.planned ? (_jsxs(_Fragment, { children: [row.screen, _jsx("span", { style: { ...captionText, display: 'block' }, children: t('studio.structure.planned', { change: row.planned }) })] })) : (row.screen),
|
|
24
24
|
row.who,
|
|
25
25
|
row.place,
|
|
26
26
|
t(row.main ? 'studio.structure.yes' : 'studio.structure.no'),
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useT } from '@buffcore/i18n/react';
|
|
2
|
+
import { useLocale, useT } from '@buffcore/i18n/react';
|
|
3
3
|
import { Panel } from '../../../components/Panel.js';
|
|
4
|
+
import { captionText } from '../../../components/styles.js';
|
|
4
5
|
import { ReasonButton } from './ReasonButton.js';
|
|
6
|
+
import { structureAnswers } from './structure-answers.js';
|
|
5
7
|
export function StructurePrompts(props) {
|
|
6
|
-
return (_jsxs(_Fragment, { children: [_jsx(StructureQuestions, {}), _jsx(StructureJourneys, { ...props })] }));
|
|
8
|
+
return (_jsxs(_Fragment, { children: [_jsx(StructureQuestions, { structure: props.structure }), _jsx(StructureJourneys, { ...props })] }));
|
|
7
9
|
}
|
|
8
|
-
|
|
10
|
+
/** Each question with its answer from `plan/structure.md`, or a pointer to the chat. */
|
|
11
|
+
function StructureQuestions({ structure }) {
|
|
9
12
|
const t = useT();
|
|
13
|
+
const { locale } = useLocale();
|
|
14
|
+
const answers = structureAnswers(structure, t, locale);
|
|
10
15
|
return (_jsxs(Panel, { title: t('studio.structure.questions'), children: [_jsx("ul", { style: {
|
|
11
16
|
margin: 0,
|
|
12
17
|
paddingInlineStart: 'var(--space-5)',
|
|
13
18
|
display: 'grid',
|
|
14
19
|
gap: 'var(--space-3)',
|
|
15
|
-
}, children: ['sections', 'main', 'people', 'screens'].map((key) => (
|
|
20
|
+
}, children: ['sections', 'main', 'people', 'screens'].map((key) => (_jsxs("li", { style: { display: 'grid', gap: 'var(--space-1)', minInlineSize: 0 }, children: [_jsx("strong", { style: { color: 'var(--text-strong)' }, children: t(`studio.structure.q.${key}`) }), answers[key].length ? (answers[key].map((answer) => (_jsx("span", { style: { overflowWrap: 'anywhere' }, children: answer }, answer)))) : (_jsx("span", { style: captionText, children: t('studio.structure.a.none') }))] }, key))) }), _jsx("p", { style: { margin: 0 }, children: t('studio.structure.askAgain') })] }));
|
|
16
21
|
}
|
|
17
22
|
function StructureJourneys({ agent, journeys, draft, onStart, structure, problem, }) {
|
|
18
23
|
const t = useT();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FirstSurface } from '@buffcore/contracts/workbench';
|
|
2
|
+
export declare function SurfaceChoice({ surface, drafted, onSurface, }: {
|
|
3
|
+
surface?: FirstSurface;
|
|
4
|
+
/** Whether `plan/structure.md` exists: the answer is kept in it. */
|
|
5
|
+
drafted: boolean;
|
|
6
|
+
onSurface?: (surface: FirstSurface) => void;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useT } from '@buffcore/i18n/react';
|
|
3
|
+
import { Choice } from '../../../components/Choice.js';
|
|
4
|
+
import { Panel } from '../../../components/Panel.js';
|
|
5
|
+
import { bodyText, captionText } from '../../../components/styles.js';
|
|
6
|
+
export function SurfaceChoice({ surface, drafted, onSurface, }) {
|
|
7
|
+
const t = useT();
|
|
8
|
+
return (_jsxs(Panel, { children: [_jsx("p", { style: { ...bodyText, margin: 0 }, children: t('studio.structure.surface.help') }), _jsx(Choice, { label: t('studio.structure.surface.question'), value: surface ?? 'desktop', disabled: !drafted || !onSurface, onChange: (value) => onSurface?.(value), options: [
|
|
9
|
+
{
|
|
10
|
+
value: 'desktop',
|
|
11
|
+
label: t('studio.structure.surface.desktop'),
|
|
12
|
+
help: t('studio.structure.surface.desktopHelp'),
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
value: 'phone',
|
|
16
|
+
label: t('studio.structure.surface.phone'),
|
|
17
|
+
help: t('studio.structure.surface.phoneHelp'),
|
|
18
|
+
},
|
|
19
|
+
] }), !drafted && (_jsx("p", { style: { ...captionText, margin: 0 }, children: t('studio.structure.surface.first') }))] }));
|
|
20
|
+
}
|
|
@@ -4,7 +4,7 @@ type StepReview = Pick<ReviewedSave, 'phase' | 'files' | 'candidates' | 'other'>
|
|
|
4
4
|
/**
|
|
5
5
|
* The one save decision for a step. Planning steps know their own unsaved files from the poll:
|
|
6
6
|
* none listed (or a review that offers none, also after a recovered commit) is clean, and a poll
|
|
7
|
-
* that lists one reopens a finished review. Every step stays unsaved while one of its own files
|
|
7
|
+
* that lists one reopens a finished review; Brand's own list offering none is clean too. Every step stays unsaved while one of its own files
|
|
8
8
|
* is left out of the save or cannot be saved here.
|
|
9
9
|
*/
|
|
10
10
|
export declare function stepState<R extends StepReview>(step: SaveStep, unsaved: readonly string[] | undefined, review: R | undefined, hasContent?: boolean, valid?: boolean): {
|
|
@@ -2,7 +2,7 @@ import { stepOwnsFile } from '@buffcore/contracts/workbench';
|
|
|
2
2
|
/**
|
|
3
3
|
* The one save decision for a step. Planning steps know their own unsaved files from the poll:
|
|
4
4
|
* none listed (or a review that offers none, also after a recovered commit) is clean, and a poll
|
|
5
|
-
* that lists one reopens a finished review. Every step stays unsaved while one of its own files
|
|
5
|
+
* that lists one reopens a finished review; Brand's own list offering none is clean too. Every step stays unsaved while one of its own files
|
|
6
6
|
* is left out of the save or cannot be saved here.
|
|
7
7
|
*/
|
|
8
8
|
export function stepState(step, unsaved, review, hasContent = true, valid = true) {
|
|
@@ -11,13 +11,14 @@ export function stepState(step, unsaved, review, hasContent = true, valid = true
|
|
|
11
11
|
const left = review?.other?.filter(owns) ?? [];
|
|
12
12
|
// Protected or secret step files are never offered, so the review leaves them out.
|
|
13
13
|
const blocked = left.some((file) => !review?.candidates.includes(file));
|
|
14
|
-
const
|
|
15
|
-
(review
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
const offersNone = !!review &&
|
|
15
|
+
['preview', 'changed', 'saved'].includes(review.phase) &&
|
|
16
|
+
!review.files.length &&
|
|
17
|
+
!left.length &&
|
|
18
|
+
!review.candidates.some(owns);
|
|
19
|
+
// Brand has no poll of its own files, but its list (asked for on opening) can offer none.
|
|
20
|
+
const nothing = (planning && (review ? offersNone : unsaved?.some(owns) === false)) ||
|
|
21
|
+
(step === 'brand' && offersNone);
|
|
21
22
|
const saved = hasContent && valid && !left.length && (nothing || review?.phase === 'saved');
|
|
22
23
|
return {
|
|
23
24
|
progress: !hasContent
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { T } from '@buffcore/i18n';
|
|
2
|
+
import type { StructurePlan } from './StructurePage.tsx';
|
|
3
|
+
export type StructureQuestion = 'sections' | 'main' | 'people' | 'screens';
|
|
4
|
+
/**
|
|
5
|
+
* "Your app, in plain words": each question's answer, drawn only from the structure file's rows.
|
|
6
|
+
* No rows (or none that answer it) leaves the question for the chat: an empty list.
|
|
7
|
+
*/
|
|
8
|
+
export declare function structureAnswers(structure: StructurePlan | null | undefined, t: T, locale: string): Record<StructureQuestion, string[]>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const unique = (values) => [...new Set(values)];
|
|
2
|
+
/**
|
|
3
|
+
* "Your app, in plain words": each question's answer, drawn only from the structure file's rows.
|
|
4
|
+
* No rows (or none that answer it) leaves the question for the chat: an empty list.
|
|
5
|
+
*/
|
|
6
|
+
export function structureAnswers(structure, t, locale) {
|
|
7
|
+
const rows = structure?.rows ?? [];
|
|
8
|
+
const list = (values) => new Intl.ListFormat(locale, { style: 'long', type: 'conjunction' }).format(unique(values));
|
|
9
|
+
const main = rows.filter((row) => row.main);
|
|
10
|
+
const people = unique(rows.map((row) => row.who));
|
|
11
|
+
return {
|
|
12
|
+
sections: rows.length ? [list(rows.map((row) => row.section))] : [],
|
|
13
|
+
main: main[0]
|
|
14
|
+
? [
|
|
15
|
+
t('studio.structure.a.main', {
|
|
16
|
+
sections: list(main.map((row) => row.section)),
|
|
17
|
+
first: main[0].section,
|
|
18
|
+
}),
|
|
19
|
+
]
|
|
20
|
+
: [],
|
|
21
|
+
people: people.map((who) => t('studio.structure.a.people', {
|
|
22
|
+
who,
|
|
23
|
+
sections: list(rows.filter((row) => row.who === who).map((row) => row.section)),
|
|
24
|
+
})),
|
|
25
|
+
// Two rows on one section and screen (for two kinds of people) answer once.
|
|
26
|
+
screens: unique(rows.map((row) => row.planned
|
|
27
|
+
? t('studio.structure.a.planned', {
|
|
28
|
+
section: row.section,
|
|
29
|
+
screen: row.screen,
|
|
30
|
+
change: row.planned,
|
|
31
|
+
})
|
|
32
|
+
: t('studio.structure.a.screen', { section: row.section, screen: row.screen }))),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { useT } from '@buffcore/i18n/react';
|
|
2
2
|
import { newChatFor } from '../../app/chat.js';
|
|
3
|
+
import { useFreshLook } from '../../app/fresh.js';
|
|
3
4
|
import { briefHasContent, briefProps } from '../../app/loop.js';
|
|
4
5
|
import { stepWaiting } from '../../app/loop-stage.js';
|
|
5
6
|
import { nextReason } from './SaveStep.js';
|
|
6
|
-
import { usePlanningSave } from './usePlanningSave.js';
|
|
7
|
+
import { useListOnArrival, usePlanningSave, viewerCanBuild } from './usePlanningSave.js';
|
|
7
8
|
function planningStep(page) {
|
|
8
9
|
return page === 'structure'
|
|
9
10
|
? 'structure'
|
|
@@ -28,9 +29,12 @@ export function usePlanningDraft({ state, page, actions, onStep }) {
|
|
|
28
29
|
const writing = state.chats?.some((chat) => chat.title === step && !chat.change && chat.state === 'running') ??
|
|
29
30
|
false;
|
|
30
31
|
const draft = usePlanningSave(state, step, actions, writing);
|
|
32
|
+
const agentName = briefProps(state).product.agent.name;
|
|
33
|
+
const fresh = useFreshLook(actions, step, agentName, onStep && ((text) => onStep(newChatFor(step), text)));
|
|
34
|
+
useListOnArrival(draft, step, state.plan?.unsaved, viewerCanBuild(state));
|
|
31
35
|
const hasContent = planningContent(state, page);
|
|
32
36
|
draft.why = writing
|
|
33
|
-
? t('studio.loop.planning.why.writing', { agent:
|
|
37
|
+
? t('studio.loop.planning.why.writing', { agent: agentName })
|
|
34
38
|
: stepWaiting(state, page)
|
|
35
39
|
? t('studio.loop.planning.why.failed')
|
|
36
40
|
: !hasContent
|
|
@@ -47,5 +51,6 @@ export function usePlanningDraft({ state, page, actions, onStep }) {
|
|
|
47
51
|
: 'prototype';
|
|
48
52
|
const onNext = !draft.why && onStep ? (label) => onStep(newChatFor(next), label) : undefined;
|
|
49
53
|
const send = onStep && ((label) => onStep(newChatFor(step), label));
|
|
54
|
+
draft.fresh = fresh;
|
|
50
55
|
return { step, draft, hasContent, writing, onNext, send };
|
|
51
56
|
}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type StudioState } from '@buffcore/contracts/workbench';
|
|
2
2
|
import type { SaveStep, StudioActions } from '../../app/actions.ts';
|
|
3
3
|
import type { StepDraft } from './SaveStep.tsx';
|
|
4
|
-
/** Every step
|
|
4
|
+
/** Every step saves through the same one-click flow: its files list themselves, then one Save. */
|
|
5
5
|
export declare function usePlanningSave(state: StudioState, step: SaveStep, actions: StudioActions, writing: boolean): StepDraft;
|
|
6
|
+
/** Saving and listing a step's files need the `build` right; a local studio has every right. */
|
|
7
|
+
export declare function viewerCanBuild(state: Pick<StudioState, 'viewer'>): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* One click saves (0.8.42): on a step page, the step's own unsaved files list themselves, ticked,
|
|
10
|
+
* so the person's one Save commits them. A page calls it beside its save; the save hook alone
|
|
11
|
+
* lists nothing until asked, and a viewer without the `build` right is never asked for a list.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useListOnArrival(draft: StepDraft, step: SaveStep, unsaved: readonly string[] | undefined, canBuild: boolean): void;
|
|
14
|
+
/**
|
|
15
|
+
* Brand's one click: the poll has no unsaved-files signal for its design files, so the page asks
|
|
16
|
+
* the server for its list once when it opens, and again when its files change (a new theme
|
|
17
|
+
* fingerprint or a finished turn opens a fresh review). A list offering none reads as saved.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useListOnOpen(draft: StepDraft | undefined, canBuild: boolean): void;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { stepOwnsFile } from '@buffcore/contracts/workbench';
|
|
1
2
|
import { useT } from '@buffcore/i18n/react';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
3
4
|
import { stepState } from './step-state.js';
|
|
4
5
|
import { useReviewedSave } from './useReviewedSave.js';
|
|
5
|
-
/** Every step
|
|
6
|
+
/** Every step saves through the same one-click flow: its files list themselves, then one Save. */
|
|
6
7
|
export function usePlanningSave(state, step, actions, writing) {
|
|
7
8
|
const t = useT();
|
|
8
9
|
const saveWriting = state.chats?.some((chat) => !chat.change && chat.state === 'running') ?? false;
|
|
@@ -34,3 +35,40 @@ export function usePlanningSave(state, step, actions, writing) {
|
|
|
34
35
|
},
|
|
35
36
|
};
|
|
36
37
|
}
|
|
38
|
+
/** Saving and listing a step's files need the `build` right; a local studio has every right. */
|
|
39
|
+
export function viewerCanBuild(state) {
|
|
40
|
+
const rights = state.viewer?.rights;
|
|
41
|
+
return !rights || rights === 'all' || rights.includes('build');
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* One click saves (0.8.42): on a step page, the step's own unsaved files list themselves, ticked,
|
|
45
|
+
* so the person's one Save commits them. A page calls it beside its save; the save hook alone
|
|
46
|
+
* lists nothing until asked, and a viewer without the `build` right is never asked for a list.
|
|
47
|
+
*/
|
|
48
|
+
export function useListOnArrival(draft, step, unsaved, canBuild) {
|
|
49
|
+
const listFiles = canBuild &&
|
|
50
|
+
!!draft.save?.unlisted &&
|
|
51
|
+
!draft.writing &&
|
|
52
|
+
draft.save.state !== 'writing' &&
|
|
53
|
+
!!unsaved?.some((file) => stepOwnsFile(step, file));
|
|
54
|
+
const { onSave } = draft;
|
|
55
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: list once each time it becomes needed.
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (listFiles)
|
|
58
|
+
onSave?.();
|
|
59
|
+
}, [listFiles]);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Brand's one click: the poll has no unsaved-files signal for its design files, so the page asks
|
|
63
|
+
* the server for its list once when it opens, and again when its files change (a new theme
|
|
64
|
+
* fingerprint or a finished turn opens a fresh review). A list offering none reads as saved.
|
|
65
|
+
*/
|
|
66
|
+
export function useListOnOpen(draft, canBuild) {
|
|
67
|
+
const listFiles = canBuild && !!draft?.save?.unlisted && !draft.writing && draft.save.state !== 'writing';
|
|
68
|
+
const onSave = draft?.onSave;
|
|
69
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: list once each time it becomes needed.
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
if (listFiles)
|
|
72
|
+
onSave?.();
|
|
73
|
+
}, [listFiles]);
|
|
74
|
+
}
|
|
@@ -70,10 +70,11 @@ export function usePrototypeRecord(actions, change, run, approving = false, vers
|
|
|
70
70
|
intent.current = { scope: change, record: true };
|
|
71
71
|
if (status.saved)
|
|
72
72
|
await saving.start();
|
|
73
|
-
else if (status.review
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
else if (status.review && ['preview', 'changed', 'refused'].includes(status.review.phase)) {
|
|
74
|
+
// The list shown is what Record saves: one click, its fingerprint checked by the server.
|
|
75
|
+
if (status.review.files.length && !status.review.checking)
|
|
76
|
+
status.review.confirm();
|
|
77
|
+
}
|
|
77
78
|
else {
|
|
78
79
|
setResult({ scope: change });
|
|
79
80
|
await saving.start();
|
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
import type { SaveResult, SaveStep, StudioActions } from '../../app/actions.ts';
|
|
2
2
|
export interface ReviewedSave {
|
|
3
3
|
step?: SaveStep;
|
|
4
|
-
phase: 'loading' | 'preview' | '
|
|
4
|
+
phase: 'loading' | 'preview' | 'changed' | 'saving' | 'refused' | 'unknown' | 'saved' | 'recovery';
|
|
5
5
|
files: readonly string[];
|
|
6
6
|
candidates: readonly string[];
|
|
7
7
|
other?: readonly string[];
|
|
8
8
|
kinds?: SaveResult['kinds'];
|
|
9
9
|
earlierSnapshots?: readonly string[];
|
|
10
|
+
/** The server's fingerprint of the files shown; Save sends it, and only a match commits. */
|
|
10
11
|
fingerprint?: string;
|
|
11
|
-
|
|
12
|
+
/** Asking for a changed list's fingerprint; Save waits for it. */
|
|
13
|
+
checking?: boolean;
|
|
12
14
|
commit?: string;
|
|
13
15
|
refusal?: SaveResult['refused'];
|
|
14
16
|
detail?: string;
|
|
15
17
|
toggle: (file: string) => void;
|
|
16
|
-
review: () => void;
|
|
17
18
|
confirm: () => void;
|
|
18
19
|
reload: () => void;
|
|
19
20
|
}
|
|
20
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* One click saves (0.8.42): the list loads with the step's files ticked and the server's fingerprint
|
|
23
|
+
* of that list; Save sends it. A changed tick asks for the new list's fingerprint before Save works
|
|
24
|
+
* again. When the files changed since, the server answers with the new list ("changed").
|
|
25
|
+
*/
|
|
21
26
|
export declare function useReviewedSave(actions: StudioActions, step: SaveStep, scope: string, writing?: boolean, onSaved?: (saved: SaveResult) => Promise<void>): {
|
|
22
27
|
review: ReviewedSave | undefined;
|
|
23
28
|
start: () => Promise<void>;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { useT } from '@buffcore/i18n/react';
|
|
2
2
|
import { useEffect, useRef, useState } from 'react';
|
|
3
|
-
|
|
3
|
+
const sameFiles = (a, b) => a.length === b.length && a.every((file, index) => file === b[index]);
|
|
4
|
+
/**
|
|
5
|
+
* One click saves (0.8.42): the list loads with the step's files ticked and the server's fingerprint
|
|
6
|
+
* of that list; Save sends it. A changed tick asks for the new list's fingerprint before Save works
|
|
7
|
+
* again. When the files changed since, the server answers with the new list ("changed").
|
|
8
|
+
*/
|
|
4
9
|
export function useReviewedSave(actions, step, scope, writing = false, onSaved) {
|
|
5
10
|
const t = useT();
|
|
6
11
|
const [state, setState] = useState({ scope, visit: {} });
|
|
@@ -15,33 +20,88 @@ export function useReviewedSave(actions, step, scope, writing = false, onSaved)
|
|
|
15
20
|
};
|
|
16
21
|
}, [state.visit]);
|
|
17
22
|
const locked = useRef(false);
|
|
23
|
+
const refreshing = useRef(false);
|
|
24
|
+
const again = useRef(false);
|
|
25
|
+
const selection = useRef([]);
|
|
18
26
|
const visit = state.visit;
|
|
19
27
|
const update = (patch) => setState((current) => (current.visit === visit ? { ...current, ...patch } : current));
|
|
20
|
-
// A failed
|
|
28
|
+
// A failed check or save keeps the person's selection to retry; a failed load lists nothing
|
|
21
29
|
// old (a recovered commit keeps its files).
|
|
22
|
-
const failed = (detail,
|
|
23
|
-
? { phase: 'preview', fingerprint: undefined,
|
|
30
|
+
const failed = (detail, kept) => kept
|
|
31
|
+
? { phase: 'preview', fingerprint: undefined, detail }
|
|
24
32
|
: {
|
|
25
33
|
phase: 'unknown',
|
|
26
34
|
files: state.recovered ? state.files : [],
|
|
27
35
|
candidates: state.recovered ? state.candidates : [],
|
|
28
36
|
fingerprint: undefined,
|
|
29
|
-
reviewed: undefined,
|
|
30
37
|
detail,
|
|
31
38
|
};
|
|
39
|
+
const listed = (answer, phase) => {
|
|
40
|
+
selection.current = answer.preview ?? [];
|
|
41
|
+
return {
|
|
42
|
+
phase,
|
|
43
|
+
files: answer.preview,
|
|
44
|
+
other: answer.other,
|
|
45
|
+
commit: undefined,
|
|
46
|
+
candidates: answer.candidates ?? answer.preview,
|
|
47
|
+
kinds: answer.kinds,
|
|
48
|
+
earlierSnapshots: answer.earlierSnapshots,
|
|
49
|
+
fingerprint: answer.fingerprint,
|
|
50
|
+
refusal: answer.refused,
|
|
51
|
+
detail: undefined,
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
// A changed tick asks for the fingerprint of the new list. One question at a time: ticks made
|
|
55
|
+
// while one is out ask again with the latest list, and only that answer counts.
|
|
56
|
+
const refresh = async (same = 'preview') => {
|
|
57
|
+
if (refreshing.current) {
|
|
58
|
+
again.current = true;
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
refreshing.current = true;
|
|
62
|
+
update({ checking: true });
|
|
63
|
+
try {
|
|
64
|
+
let files;
|
|
65
|
+
let answer;
|
|
66
|
+
do {
|
|
67
|
+
again.current = false;
|
|
68
|
+
files = selection.current;
|
|
69
|
+
if (!files.length)
|
|
70
|
+
return;
|
|
71
|
+
answer =
|
|
72
|
+
step === 'prototype'
|
|
73
|
+
? await actions.save(step, undefined, files, scope)
|
|
74
|
+
: await actions.save(step, undefined, files);
|
|
75
|
+
if (activeVisit.current !== visit)
|
|
76
|
+
return;
|
|
77
|
+
} while (again.current);
|
|
78
|
+
if (answer.preview && answer.fingerprint)
|
|
79
|
+
update(listed(answer, sameFiles(answer.preview, files) ? same : 'changed'));
|
|
80
|
+
else
|
|
81
|
+
update(failed(answer.detail ?? t('studio.save.failed'), files));
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
update(failed(t('studio.save.failed'), selection.current));
|
|
85
|
+
}
|
|
86
|
+
finally {
|
|
87
|
+
refreshing.current = false;
|
|
88
|
+
update({ checking: undefined });
|
|
89
|
+
}
|
|
90
|
+
};
|
|
32
91
|
const request = async (confirm = false, files) => {
|
|
33
|
-
if (locked.current || writing)
|
|
92
|
+
if (locked.current || refreshing.current || writing)
|
|
34
93
|
return;
|
|
35
|
-
if (confirm && (!state.
|
|
94
|
+
if (confirm && (!state.fingerprint || !files?.length))
|
|
36
95
|
return;
|
|
37
96
|
locked.current = true;
|
|
97
|
+
let recheck = false;
|
|
38
98
|
update({
|
|
39
99
|
phase: confirm ? 'saving' : 'loading',
|
|
40
100
|
detail: undefined,
|
|
41
101
|
...(!confirm && !state.recovered ? { commit: undefined } : {}),
|
|
42
102
|
});
|
|
43
103
|
try {
|
|
44
|
-
const proof = confirm ? state.
|
|
104
|
+
const proof = confirm ? state.fingerprint : undefined;
|
|
45
105
|
// Only a prototype save names its change, so main can refuse one that lives in a checkout.
|
|
46
106
|
const answer = step === 'prototype'
|
|
47
107
|
? await actions.save(step, proof, files, scope)
|
|
@@ -57,7 +117,6 @@ export function useReviewedSave(actions, step, scope, writing = false, onSaved)
|
|
|
57
117
|
candidates: undefined,
|
|
58
118
|
commit: undefined,
|
|
59
119
|
fingerprint: undefined,
|
|
60
|
-
reviewed: undefined,
|
|
61
120
|
refusal: undefined,
|
|
62
121
|
detail: undefined,
|
|
63
122
|
recovered: undefined,
|
|
@@ -76,18 +135,12 @@ export function useReviewedSave(actions, step, scope, writing = false, onSaved)
|
|
|
76
135
|
await onSaved?.(answer);
|
|
77
136
|
}
|
|
78
137
|
else if (answer.preview && answer.fingerprint) {
|
|
138
|
+
// A check that changed the files hands back the fingerprint Save sent: ask for the new
|
|
139
|
+
// list's own, so the one Save after "changed" can commit it.
|
|
140
|
+
recheck = confirm && !answer.refused && answer.fingerprint === proof;
|
|
79
141
|
update({
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
other: answer.other,
|
|
83
|
-
commit: undefined,
|
|
84
|
-
candidates: answer.candidates ?? answer.preview,
|
|
85
|
-
kinds: answer.kinds,
|
|
86
|
-
earlierSnapshots: answer.earlierSnapshots,
|
|
87
|
-
fingerprint: answer.fingerprint,
|
|
88
|
-
reviewed: answer.refused || (!confirm && files) ? answer.fingerprint : undefined,
|
|
89
|
-
refusal: answer.refused,
|
|
90
|
-
detail: undefined,
|
|
142
|
+
...listed(answer, answer.refused ? 'refused' : confirm ? 'changed' : 'preview'),
|
|
143
|
+
...(recheck ? { fingerprint: undefined } : {}),
|
|
91
144
|
});
|
|
92
145
|
}
|
|
93
146
|
else
|
|
@@ -99,6 +152,8 @@ export function useReviewedSave(actions, step, scope, writing = false, onSaved)
|
|
|
99
152
|
finally {
|
|
100
153
|
locked.current = false;
|
|
101
154
|
}
|
|
155
|
+
if (recheck)
|
|
156
|
+
await refresh('changed');
|
|
102
157
|
};
|
|
103
158
|
const current = state.scope === scope ? state : { scope, visit: {} };
|
|
104
159
|
const review = current.phase && {
|
|
@@ -110,28 +165,32 @@ export function useReviewedSave(actions, step, scope, writing = false, onSaved)
|
|
|
110
165
|
kinds: current.kinds,
|
|
111
166
|
earlierSnapshots: current.earlierSnapshots,
|
|
112
167
|
fingerprint: current.fingerprint,
|
|
113
|
-
|
|
168
|
+
checking: current.checking,
|
|
114
169
|
commit: current.commit,
|
|
115
170
|
refusal: current.refusal,
|
|
116
171
|
detail: current.detail,
|
|
117
172
|
toggle: (file) => {
|
|
118
173
|
if (locked.current || writing || current.phase === 'saved')
|
|
119
174
|
return;
|
|
175
|
+
const ticked = selection.current.includes(file)
|
|
176
|
+
? selection.current.filter((path) => path !== file)
|
|
177
|
+
: [...selection.current, file];
|
|
178
|
+
// The candidates' order, as the server lists a selection.
|
|
179
|
+
selection.current = (current.candidates ?? ticked).filter((path) => ticked.includes(path));
|
|
120
180
|
update({
|
|
121
181
|
phase: 'preview',
|
|
122
|
-
|
|
182
|
+
fingerprint: undefined,
|
|
123
183
|
refusal: undefined,
|
|
124
|
-
files: current
|
|
125
|
-
? current.files.filter((path) => path !== file)
|
|
126
|
-
: [...(current.files ?? []), file],
|
|
184
|
+
files: selection.current,
|
|
127
185
|
});
|
|
186
|
+
void refresh();
|
|
128
187
|
},
|
|
129
|
-
|
|
130
|
-
if (current.files?.length)
|
|
131
|
-
void request(false, current.files);
|
|
132
|
-
},
|
|
188
|
+
// Without a fingerprint (its question failed), Save asks again first; one already out waits.
|
|
133
189
|
confirm: () => {
|
|
134
|
-
|
|
190
|
+
if (current.fingerprint)
|
|
191
|
+
void request(true, current.files);
|
|
192
|
+
else if (!refreshing.current)
|
|
193
|
+
void refresh();
|
|
135
194
|
},
|
|
136
195
|
reload: () => {
|
|
137
196
|
void request();
|
|
@@ -60,7 +60,7 @@ function Server({ v }) {
|
|
|
60
60
|
const t = useT();
|
|
61
61
|
const tx = useTx();
|
|
62
62
|
const when = useWhen();
|
|
63
|
-
return (_jsxs(Panel, { title: _jsxs(Row, { children: [_jsx(Icon, { name: "circle-check" }), v.name, " ", _jsx(Mono, { children: v.host })] }), action: _jsxs(Row, { children: [_jsx(Badge, { icon: "user", children: t('studio.later.srv.youRun') }), _jsx(Badge, { children: _jsx(Mono, { children: v.version }) })] }), children: [_jsxs("span", { style: muted, children: [_jsx(D, { children: v.at }), " \u00B7 ", t('studio.later.srv.size', v.size)] }), v.off ? (_jsxs(Banner, { tone: "info", title: tx('studio.later.srv.off', { host: v.host }, { time: when.time(v.since ?? '') }), children: [t('studio.later.srv.offLine'), " ", tx('studio.later.srv.last', { version: v.version })] })) : (_jsxs(_Fragment, { children: [_jsx(Status, { v: v }), _jsx(Actions, { v: v })] })), _jsxs(Foot, { children: [t(v.off ? 'studio.later.srv.readThen' : 'studio.later.srv.read'), ' ', _jsx(Mono, { children: `ssh ${v.host} sudo docker compose logs` })] }), _jsx(Place, { id: "card:server", passed: v })] }));
|
|
63
|
+
return (_jsxs(Panel, { title: _jsxs(Row, { children: [_jsx(Icon, { name: "circle-check" }), v.name, " ", _jsx(Mono, { children: v.host })] }), action: _jsxs(Row, { children: [_jsx(Badge, { icon: "user", children: t('studio.later.srv.youRun') }), _jsx(Badge, { children: _jsx(Mono, { children: v.version }) })] }), children: [_jsxs("span", { style: muted, children: [_jsx(D, { children: v.at }), " \u00B7 ", t('studio.later.srv.size', v.size)] }), v.off ? (_jsxs(Banner, { tone: "info", title: tx('studio.later.srv.off', { host: v.host }, { time: when.time(v.since ?? '') }), children: [t('studio.later.srv.offLine'), " ", tx('studio.later.srv.last', { version: v.version })] })) : (_jsxs(_Fragment, { children: [_jsx(Status, { v: v }), _jsx(Actions, { v: v })] })), _jsxs(Foot, { children: [t(v.off ? 'studio.later.srv.readThen' : 'studio.later.srv.read'), ' ', _jsx(Mono, { children: `ssh ${v.host} sudo docker compose logs` })] }), _jsx(Place, { id: "card:server", passed: v, subject: v })] }));
|
|
64
64
|
}
|
|
65
65
|
export function LiveServers({ servers }) {
|
|
66
66
|
const t = useT();
|
|
@@ -27,5 +27,5 @@ function SampleRelease({ release: r, needsRight, onAction, }) {
|
|
|
27
27
|
gap: 'var(--space-4)',
|
|
28
28
|
gridTemplateColumns: 'repeat(auto-fit, minmax(min(22rem,100%), 1fr))',
|
|
29
29
|
alignItems: 'start',
|
|
30
|
-
}, children: [_jsxs(Stack, { children: [_jsx(Measured, { r: r }), _jsx(Where, { onAction: onAction, r: r })] }), _jsxs(Panel, { title: _jsxs(Row, { children: [_jsx(Seal, {}), t('studio.later.rel.gate')] }), children: [_jsxs("p", { style: muted, children: [t('studio.later.rel.gateLine'), " ", _jsx(Mono, { children: "ape deploy" })] }), _jsx(Row, { children: _jsx(RightAction, { onClick: () => onAction?.('rel.approve'), disabled: !onAction, icon: "shield-check", needsRight: needsRight, children: t('studio.later.rel.approve') }) }), _jsx(Place, { id: "approve:release" }), _jsx(Place, { id: "side:release" })] })] })] }));
|
|
30
|
+
}, children: [_jsxs(Stack, { children: [_jsx(Measured, { r: r }), _jsx(Where, { onAction: onAction, r: r })] }), _jsxs(Panel, { title: _jsxs(Row, { children: [_jsx(Seal, {}), t('studio.later.rel.gate')] }), children: [_jsxs("p", { style: muted, children: [t('studio.later.rel.gateLine'), " ", _jsx(Mono, { children: "ape deploy" })] }), _jsx(Row, { children: _jsx(RightAction, { onClick: () => onAction?.('rel.approve'), disabled: !onAction, icon: "shield-check", needsRight: needsRight, children: t('studio.later.rel.approve') }) }), _jsx(Place, { id: "approve:release", subject: { release: r.version } }), _jsx(Place, { id: "side:release" })] })] })] }));
|
|
31
31
|
}
|
|
@@ -26,7 +26,7 @@ function ServerCard({ s, runBy }) {
|
|
|
26
26
|
display: 'grid',
|
|
27
27
|
gap: 'var(--space-1)',
|
|
28
28
|
borderColor: s.state === 'hurt' ? 'var(--error-border)' : undefined,
|
|
29
|
-
}, children: [_jsxs(Row, { style: { justifyContent: 'space-between' }, children: [_jsx("strong", { style: strong, children: s.here ? t('studio.frame.rail.computer') : s.name }), _jsx(Badge, { status: s.state === 'ok' ? 'healthy' : 'down', children: _jsx(Mono, { children: s.version }) })] }), _jsx(Mono, { children: s.host }), _jsx("span", { style: muted, children: s.state === 'hurt' ? t('studio.later.rels.hurt') : s.note ? _jsx(D, { children: s.note }) : null }), runBy && !s.here && _jsx("span", { style: small, children: t('studio.later.rels.youRun') }), _jsx(Place, { id: "card:server", passed: s })] }));
|
|
29
|
+
}, children: [_jsxs(Row, { style: { justifyContent: 'space-between' }, children: [_jsx("strong", { style: strong, children: s.here ? t('studio.frame.rail.computer') : s.name }), _jsx(Badge, { status: s.state === 'ok' ? 'healthy' : 'down', children: _jsx(Mono, { children: s.version }) })] }), _jsx(Mono, { children: s.host }), _jsx("span", { style: muted, children: s.state === 'hurt' ? t('studio.later.rels.hurt') : s.note ? _jsx(D, { children: s.note }) : null }), runBy && !s.here && _jsx("span", { style: small, children: t('studio.later.rels.youRun') }), _jsx(Place, { id: "card:server", passed: s, subject: s })] }));
|
|
30
30
|
}
|
|
31
31
|
export function ServerCards({ servers, runBy, }) {
|
|
32
32
|
const t = useT();
|
|
@@ -56,7 +56,7 @@ function History({ rows, onAction, }) {
|
|
|
56
56
|
}
|
|
57
57
|
function Ready({ ready, onAction, }) {
|
|
58
58
|
const t = useT();
|
|
59
|
-
return (_jsxs(Panel, { title: _jsxs(Row, { children: [_jsx(Seal, {}), t('studio.later.rels.ready', { v: ready.v })] }), children: [_jsxs("p", { style: muted, children: [_jsx(D, { children: ready.what }), " ", t('studio.later.rels.readyLine')] }), _jsx(Row, { children: _jsx(Button, { onClick: () => onAction?.('rels.approve'), disabled: !onAction, icon: "shield-check", children: t('studio.later.rels.approve', { v: ready.v }) }) }), _jsx(Place, { id: "approve:release" })] }));
|
|
59
|
+
return (_jsxs(Panel, { title: _jsxs(Row, { children: [_jsx(Seal, {}), t('studio.later.rels.ready', { v: ready.v })] }), children: [_jsxs("p", { style: muted, children: [_jsx(D, { children: ready.what }), " ", t('studio.later.rels.readyLine')] }), _jsx(Row, { children: _jsx(Button, { onClick: () => onAction?.('rels.approve'), disabled: !onAction, icon: "shield-check", children: t('studio.later.rels.approve', { v: ready.v }) }) }), _jsx(Place, { id: "approve:release", subject: { release: ready.v } })] }));
|
|
60
60
|
}
|
|
61
61
|
function Stores({ stores }) {
|
|
62
62
|
const t = useT();
|