feat(frontend): sessions list/create + steering + resume + selectors
- NavSessions: left nav listing sessions via listSessions (TanStack Query), clicking resumes via resumeSession and sets active; active item highlighted - NewSessionDialog: ShadCn dialog with question textarea, workspace native select (from listWorkspaces), graceful model field (dropdown when models list is non-empty, free-text input when empty per §9 degradation), optional thinking/provider fields; try/catch surfaces errors inline - SteerInput: text input + button POSTs to postSteer, clears on send, supports Enter key; only shown when a session is active - WorkflowBar: renders 8 phases (F1..F8) with data-active highlighting driven by useSessionStore.currentPhase (new store field + setPhase action) - AppShell: wires all four components; right artifact sidebar now collapsible via a toggle button (useState sidebarOpen); replaces old "Nuova domanda" button with NewSessionDialog trigger - f1-loop.test: updated to drive through the new dialog flow (open → fill question → submit → wait for SSE → respond) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
// frontend/src/shell/WorkflowBar.tsx
|
||||
import { useSessionStore } from "../store/sessionStore";
|
||||
|
||||
const PHASES = [
|
||||
{ id: "F1", name: "Disambiguazione" },
|
||||
{ id: "F2", name: "Schema linking" },
|
||||
{ id: "F3", name: "Esplorazione" },
|
||||
{ id: "F4", name: "Piano SQL" },
|
||||
{ id: "F5", name: "Generazione SQL" },
|
||||
{ id: "F6", name: "Validazione" },
|
||||
{ id: "F7", name: "Revisione" },
|
||||
{ id: "F8", name: "Risultati" },
|
||||
];
|
||||
|
||||
export function WorkflowBar() {
|
||||
const currentPhase = useSessionStore((s) => s.currentPhase);
|
||||
|
||||
return (
|
||||
<nav className="flex gap-1 overflow-x-auto">
|
||||
{PHASES.map((p) => {
|
||||
const isActive = currentPhase === p.id;
|
||||
return (
|
||||
<span
|
||||
key={p.id}
|
||||
data-testid={`phase-${p.id}`}
|
||||
data-active={isActive ? "true" : "false"}
|
||||
className={[
|
||||
"px-2 py-0.5 rounded text-xs whitespace-nowrap",
|
||||
isActive
|
||||
? "bg-primary text-primary-foreground font-bold"
|
||||
: "text-muted-foreground border",
|
||||
].join(" ")}
|
||||
>
|
||||
{p.id}: {p.name}
|
||||
</span>
|
||||
);
|
||||
})}
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user