feat(frontend): store lastUserEntry + stepMessages; record user input/choice
This commit is contained in:
@@ -7,6 +7,7 @@ export function WidgetHost({ sessionId }: { sessionId: string | null }) {
|
||||
const pending = useSessionStore((s) => s.pendingWidget);
|
||||
const clearPending = useSessionStore((s) => s.clearPending);
|
||||
const pushToast = useSessionStore((s) => s.pushToast);
|
||||
const setLastUserEntry = useSessionStore((s) => s.setLastUserEntry);
|
||||
if (!pending) return null;
|
||||
const Renderer = resolve(pending.widget);
|
||||
const onRespond = async (r: UiResponse) => {
|
||||
@@ -25,6 +26,10 @@ export function WidgetHost({ sessionId }: { sessionId: string | null }) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
setLastUserEntry({
|
||||
kind: "choice",
|
||||
text: r.text ?? r.choices?.join(", ") ?? r.decision?.type ?? r.control ?? "(choice)",
|
||||
});
|
||||
clearPending();
|
||||
};
|
||||
return <Renderer descriptor={pending} onRespond={onRespond} />;
|
||||
|
||||
Reference in New Issue
Block a user