Compare commits

..

No commits in common. "22000ad2adc6cba6a21d17a8b814dffd1b1352d6" and "3a3e0b3e27de06e826c6d970c4db26f5317e7155" have entirely different histories.

6 changed files with 100 additions and 140 deletions

View File

@ -43,16 +43,14 @@ interface IntakeStep {
save: (effects: IntakeEffects, answer: IntakeAnswer) => Promise<void>;
}
export type FocusOptionId = "day" | "inbox" | "research" | "crew";
export interface FocusOption {
id: FocusOptionId;
id: string;
letter: string;
label: string;
apps: string[];
}
const FOCUS_FACTS = {
const FOCUS_FACTS: Record<string, Record<FocusOption["id"], string>> = {
en: {
day: "Wants help with day-to-day work first",
inbox: "Wants help with inbox and email first",
@ -65,17 +63,14 @@ const FOCUS_FACTS = {
research: "Möchte zuerst bei Recherche und Schreiben unterstützt werden",
crew: "Möchte eine koordinierte Crew aus Spezialisten-Bots",
},
} as const satisfies Record<string, Record<FocusOptionId, string>>;
};
/** Profile fact text for a focus answer, in the user's locale (defaults to English). */
function isFocusOptionId(id: string): id is FocusOptionId {
return FOCUS_OPTIONS.some((option) => option.id === id);
}
export function focusFactValue(focusId: string, locale: string): string {
if (!isFocusOptionId(focusId)) return focusId;
const key: keyof typeof FOCUS_FACTS = locale.toLowerCase().startsWith("de") ? "de" : "en";
return FOCUS_FACTS[key][focusId];
const id = focusId as FocusOption["id"];
const key = locale.toLowerCase().startsWith("de") ? "de" : "en";
const table = FOCUS_FACTS[key];
return table[id] ?? FOCUS_FACTS.en[id] ?? focusId;
}
export const FOCUS_OPTIONS: FocusOption[] = [

View File

@ -3,9 +3,7 @@ import { captureScreenshot } from "./helpers";
const fixture = "/e2e/fixtures/chart-links.html";
test.describe
.serial("chart links", () => {
test("cannot execute script when clicked or expanded", async ({ page }, testInfo) => {
test("chart links cannot execute script when clicked or expanded", async ({ page }, testInfo) => {
test.setTimeout(120_000);
// ChartCanvas lazy-loads Observable Plot; pay the import cost once before the matrix below.
await page.goto(`${fixture}?${new URLSearchParams({ href: "#details", inspect: "0" })}`);
@ -53,7 +51,7 @@ test.describe
await captureScreenshot(page, testInfo, "chart-with-inert-link");
});
test("retain supported URLs and browser encoding semantics", async ({ page }) => {
test("chart links retain supported URLs and browser encoding semantics", async ({ page }) => {
test.setTimeout(120_000);
await page.route("https://example.test/**", (route) =>
route.fulfill({ body: "Chart destination" }),
@ -61,8 +59,9 @@ test.describe
await page.route("**/e2e/fixtures/java*", (route) =>
route.fulfill({ body: "Chart destination" }),
);
// Each test gets a fresh browser context, so this one pays the cold Plot import too.
await page.goto(`${fixture}?${new URLSearchParams({ href: "#details" })}`);
await expect(page.locator("svg circle").first()).toBeVisible({ timeout: 30_000 });
await expect(page.locator("svg circle").first()).toBeVisible({ timeout: 90_000 });
for (const href of [
"https://example.test/chart?a=1&b=2",
"mailto:chart@example.test",
@ -90,4 +89,3 @@ test.describe
}
}
});
});

View File

@ -1,5 +1,5 @@
import { expect, test } from "@playwright/test";
import { completeOnboarding, routePatchRpc, rpc, signup } from "./helpers";
import { completeOnboarding, rpc, signup } from "./helpers";
test("empty project space offers Start before the main conversation exists", async ({ page }) => {
const stamp = Date.now();
@ -7,41 +7,15 @@ test("empty project space offers Start before the main conversation exists", asy
await completeOnboarding(page);
const side = await rpc<{ id: string }>(page, "spaces/create", { name: "Empty project" });
// spaces/create provisions a main conversation server-side; strip it from bootstrap so the
// shell shows the pre-start empty project UI.
await routePatchRpc(page, "bootstrap", (json) => {
const groups = (json.groups as Array<{ spaceId: string }>).filter(
(group) => group.spaceId !== side.id,
);
const bots = (json.bots as Array<{ spaceId: string }>).filter((bot) => bot.spaceId !== side.id);
const spaces = (
json.spaces as Array<{
id: string;
bots: unknown[];
groups: unknown[];
hasContent: boolean;
}>
).map((space) =>
space.id === side.id ? { ...space, bots: [], groups: [], hasContent: false } : space,
);
return { ...json, groups, bots, spaces };
});
await page.evaluate((spaceId) => {
window.localStorage.setItem("rakazo:space-id", spaceId);
}, side.id);
await page.goto("/app", { waitUntil: "domcontentloaded" });
await page.reload({ waitUntil: "domcontentloaded" });
await expect(page.getByTestId("shell-root")).toHaveAttribute("data-ready", "true", {
timeout: 60_000,
});
const mainStart = page.getByTestId("project-start-main");
await expect(mainStart).toBeVisible({ timeout: 30_000 });
await expect(mainStart).toContainText(/Start|Starten/i);
const projekte = page.locator(".sidebar-projekte");
const sidebarStart = projekte.getByTestId(`project-start-${side.id}`);
const sidebarStart = page.getByTestId(`project-start-${side.id}`);
await expect(sidebarStart).toBeVisible({ timeout: 30_000 });
await expect(sidebarStart).toContainText(/Start|Starten/i);
});

View File

@ -291,7 +291,7 @@ export async function openUserSettings(
await expect(menuTrigger).toBeVisible({ timeout: 30_000 });
await menuTrigger.scrollIntoViewIfNeeded();
await menuTrigger.click();
await page.getByRole("button", { name: /^Settings$|^Einstellungen$/i }).click();
await page.getByRole("button", { name: "Settings", exact: true }).click();
const settings = page.getByTestId("user-settings");
await expect(settings).toBeVisible();
if (section && section !== "general") {

View File

@ -20,9 +20,7 @@ test("the app reloads itself once when a module request aborts while booting", a
await page.goto("/sign-in", { waitUntil: "commit" });
await expect(page.getByRole("heading", { name: "Sign in to evOo" })).toBeVisible({
timeout: 60_000,
});
await expect(page.getByRole("heading", { name: "Sign in to evOo" })).toBeVisible();
expect(counter.aborted).toBe(1);
expect(await page.evaluate(() => sessionStorage.getItem("rakazo:boot-reload"))).toBeNull();
});
@ -32,9 +30,7 @@ test("a lazy route recovers when its module request aborts", async ({ page }) =>
await page.goto("/sign-in");
await expect(page.getByRole("heading", { name: "Sign in to evOo" })).toBeVisible({
timeout: 60_000,
});
await expect(page.getByRole("heading", { name: "Sign in to evOo" })).toBeVisible();
expect(counter.aborted).toBe(1);
expect(
await page.evaluate(() => sessionStorage.getItem("rakazo:module-reload:pages/Auth")),

View File

@ -67,15 +67,12 @@ describe("window chrome", () => {
expect(shell).toContain(
'className="app-drag flex items-center justify-between border-b border-sidebar-border',
);
expect(shell).toContain(
'className="app-no-drag rk-touch-target grid size-control-lg min-h-control-lg min-w-control-lg',
);
expect(shell).toContain('className="app-no-drag grid size-control-lg');
expect(shell).toContain('className="app-no-drag flex min-w-0 items-center gap-3"');
// Ensure header sidebar toggle controls stay clickable (not part of drag region)
expect(
toggles.match(/app-no-drag rk-touch-target .* size-control-lg .* place-items-center/g)
?.length ?? 0,
).toBeGreaterThanOrEqual(1);
toggles.match(/app-no-drag .* size-control-lg .* place-items-center/g)?.length ?? 0,
).toBeGreaterThanOrEqual(2);
});
it("moves window chrome into the conversation header when the bots sidebar is collapsed", () => {