refactor: stop persisting workspace state in the browser

This commit is contained in:
2026-08-14 17:43:10 +02:00
parent 3978008aed
commit fd3b62ce6f
11 changed files with 101 additions and 310 deletions
+4 -3
View File
@@ -6,6 +6,7 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { server } from "../test/msw";
import { canonicalWorkspaceFixture, workspaceRevisionFixture, workspaceSummaryFixture } from "../test/workspace-fixtures";
import { NewSessionDialog } from "./NewSessionDialog";
import { workspacePreferences } from "../workspaces/preferences";
function renderDialog() {
const onCreated = vi.fn();
@@ -28,7 +29,7 @@ test("the form has only a question field (no workspace/model/provider/thinking)"
expect(screen.queryByLabelText(/thinking/i)).not.toBeInTheDocument();
});
test("submitting includes browser-local migrated preferences and calls onCreated", async () => {
test("submitting includes ephemeral migrated preferences and calls onCreated", async () => {
localStorage.clear();
let body: unknown = null;
server.use(
@@ -71,9 +72,9 @@ test("first-run direct dialog creation waits for registry policy without a mount
const revision = {
id: "psd-clinical", commit: "a".repeat(40), blob: "b".repeat(40), snapshotPath: "/snapshot",
};
localStorage.setItem("thothii.workspace-registry.v1.preferences", JSON.stringify({
workspacePreferences.save({
workspaceId: "psd-clinical", provider: "deepseek", model: "deepseek-v4-pro", thinking: "medium",
}));
});
server.use(
http.get("/api/workspaces", () => {
summaryRequestStarted = true;