docs: complete scene 8 chat entry slice

This commit is contained in:
lda
2026-07-12 05:15:56 +07:00 Verified
parent 3158060211
commit d1128c0b49
9 changed files with 60 additions and 28 deletions
@@ -263,15 +263,17 @@ describe("PresentationRoute", () => {
expect(screen.queryByText(/checking reachability/i)).not.toBeInTheDocument();
});
it("keeps Scene 8 local after a healthy target probe", async () => {
it("keeps Scene 8 local with a configured target", async () => {
window.sessionStorage.setItem("lda.workflowConsole.target", "http://127.0.0.1:8765/rpc");
window.location.hash = "#scene/agent-handoff/request";
mockedCallOperation.mockClear();
const { PresentationRoute } = await import("./PresentationRoute.js");
render(<PresentationRoute />);
expect(await screen.findByText(/Live target ready/i)).toBeInTheDocument();
expect(await screen.findByText(/Replay evidence is active/i)).toBeInTheDocument();
expect(screen.getByRole("button", { name: "Send" })).toBeEnabled();
expect(screen.queryByRole("button", { name: "Run prepared workflow" })).not.toBeInTheDocument();
expect(mockedCallOperation).not.toHaveBeenCalled();
});
it("opens Scene 10 approval from the canonical hash", async () => {
@@ -53,7 +53,8 @@ export const PresentationRoute = () => {
const presentationTarget = useMemo(() => resolvePresentationTarget(), []);
const demo = useDemoTimeline(presentationTarget.target, recordEvidence, recording);
const targetStatus = usePresentationTargetStatus(presentationTarget, demo.state);
const isScene8 = state.location.kind === "main" && state.location.sceneId === "agent-handoff";
const targetStatus = usePresentationTargetStatus(presentationTarget, demo.state, !isScene8);
const timelineAgent = useTimelineAgent(demo, {
mode: presentationTarget.mode === "live" ? "live" : "replay",
status: targetStatus,
@@ -154,9 +154,14 @@ describe("projectPreparedAuthoringThread", () => {
});
it("keeps the canonical projection unchanged without a request override", () => {
expect(projectPreparedAuthoringThread("discover")).toEqual(
projectPreparedAuthoringThread("discover"),
);
const firstUser = projectPreparedAuthoringThread("discover")
.find((message) => message.role === "user");
expect(firstUser?.parts).toEqual([
{
type: "text",
text: "We need to author a report workflow for the lda_report scenario. What sources and capabilities are available?",
},
]);
});
it("overrides only the first user request and preserves Discover tool data", () => {
@@ -287,15 +287,15 @@ export const projectPreparedAuthoringThread = (
let requestReplaced = false;
return recording.slice(0, finalPhaseIndex + 1).flatMap((phase) => {
const conversation = phase.conversation.map((turn, index) =>
agentTextMessage(
const conversation = phase.conversation.map((turn, index) => {
const shouldReplaceRequest = requestOverride !== undefined && !requestReplaced && turn.role === "user";
if (shouldReplaceRequest) requestReplaced = true;
return agentTextMessage(
`authoring-${phase.phase}-message-${index}`,
turn.role,
requestOverride !== undefined && !requestReplaced && turn.role === "user"
? (requestReplaced = true, requestOverride)
: turn.text,
),
);
shouldReplaceRequest ? requestOverride : turn.text,
);
});
const groupId = authoringToolGroupId(phase.phase);
const toolParts = phase.commands.flatMap((command, index) => {
const callId = `${groupId}-command-${index}`;
@@ -3030,7 +3030,7 @@
padding: clamp(1.5rem, 4vw, 3.75rem) clamp(1rem, 5vw, 4.5rem);
border: 1px solid var(--authoring-rule, var(--stage-line));
border-radius: 0.35rem;
background: color-mix(in oklch, var(--stage-canvas) 92%, white);
background: var(--authoring-paper, var(--stage-canvas));
box-shadow: 0 1.25rem 3rem color-mix(in oklch, var(--stage-ink) 10%, transparent);
}
@@ -3096,7 +3096,7 @@
resize: vertical;
border-color: var(--authoring-rule, var(--stage-line));
border-radius: 0.2rem;
background: color-mix(in oklch, var(--stage-canvas) 82%, white);
background: color-mix(in oklch, var(--authoring-paper, var(--stage-canvas)) 88%, var(--authoring-muted, var(--text-secondary)));
color: var(--authoring-ink, var(--text-primary));
font: 1.05rem/1.45 var(--font-interface);
}
@@ -14,6 +14,7 @@ const liveActive = (state: DemoTimelineState): boolean =>
export const usePresentationTargetStatus = (
targetState: PresentationTargetState,
demoState: DemoTimelineState,
probeEnabled = true,
): PresentationTargetHealth => {
const [probe, setProbe] = useState<TargetProbeState>(
targetState.mode === "live" ? "checking" : "none",
@@ -27,6 +28,11 @@ export const usePresentationTargetStatus = (
setFailureReason(targetState.reason);
return;
}
if (!probeEnabled) {
setProbe("none");
setFailureReason("deterministic Scene 8 replay");
return;
}
setProbe("checking");
setFailureReason(undefined);
@@ -50,7 +56,17 @@ export const usePresentationTargetStatus = (
return () => {
cancelled = true;
};
}, [targetState]);
}, [probeEnabled, targetState]);
if (!probeEnabled) {
return presentationTargetHealth({
target: null,
probe: "none",
liveActive: false,
replayActive: true,
failureReason: "deterministic Scene 8 replay",
});
}
return presentationTargetHealth({
target: targetState.mode === "live" ? targetState.target : null,