feat: refactor conversations page into a workbench layout and implement workspace switching

- Migrate ConversationsPage to use ConversationWorkbench component.
- Create WorkbenchLayout to handle authentication and layout for workbench.
- Add WorkbenchPage to render ConversationWorkbench.
- Implement WorkspaceSwitcher for switching between dashboard and workbench.
- Update AuthProvider to manage authentication for both dashboard and workbench routes.
- Enhance WorkbenchHeader with user menu and workspace switcher.
- Add tests for workspace switcher and auth provider functionality.
- Update translations for workspace labels in English and Chinese.
- Exclude e2e tests from TypeScript compilation.
This commit is contained in:
mlogclub
2026-06-13 11:49:03 +08:00
parent a8755811b5
commit d22805c4af
15 changed files with 1033 additions and 559 deletions
+15
View File
@@ -0,0 +1,15 @@
import assert from "node:assert/strict";
import { readFile } from "node:fs/promises";
import test from "node:test";
const source = await readFile(new URL("./auth-provider.tsx", import.meta.url), "utf8");
test("refreshProfile preserves the stored token when the profile payload omits it", () => {
assert.match(source, /accessToken:\s*profile\.accessToken\s*\|\|\s*stored\.accessToken/);
assert.match(source, /expiresAt:\s*profile\.expiresAt\s*\|\|\s*stored\.expiresAt/);
});
test("refreshProfile only clears session for explicit auth error codes", () => {
assert.match(source, /errorCode\s*===\s*3000\s*\|\|\s*errorCode\s*===\s*3002/);
assert.doesNotMatch(source, /catch\s*\([^)]*\)\s*\{\s*clearSession\(\)/);
});