Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,7 @@ compatibility changes must include
`npm --prefix web run test:release-resilience`, normally through that workflow.
Documentation changes run `node scripts/check-docs.mjs`. Keep deterministic
logic in Rust tests or Vitest and browser workflows in Playwright; all fixtures
remain synthetic and public-safe.
remain synthetic and public-safe. In Playwright, fixed accessible names and
visible text use `exact: true`; multiple accepted labels use anchored regular
expressions. Use substring matching only for intentional containment checks,
expressed explicitly through a regular expression or `hasText`.
5 changes: 3 additions & 2 deletions docs/community/architecture/document-processing.md
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,9 @@ Submission remains contextual:

State is centralized in a global task center opened from the application header.
Desktop uses a right-side drawer; small screens use a full-screen route or
sheet. The badge counts the current user's queued and running jobs and surfaces
failed work without adding job lifecycle to the preview component.
sheet. The badge counts active jobs and surfaces failures completed since this
user last opened the center. That browser-local acknowledgement only clears the
indicator; it does not remove durable job history or artifacts.

“Global” is a presentation location, not a global Job bounded context. The
first view reads Document Processing summaries. Other contexts may later
Expand Down
6 changes: 4 additions & 2 deletions docs/community/architecture/frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,10 @@ TanStack Query owns the account-scoped job list, capability projection, and
mutations. Active jobs refresh every two seconds; an open idle drawer refreshes
every fifteen seconds; a closed drawer with only terminal work stops polling.
Changing accounts changes the query key and closes/reset the drawer, so stale
work cannot cross an identity boundary. Component state owns only presentation
choices and transient download/cancel errors.
work cannot cross an identity boundary. An account-keyed browser timestamp
remembers which failed jobs have already been viewed; it affects only the header
indicator. Component state owns presentation choices and transient
download/cancel errors.

## Optional frontend features

Expand Down
4 changes: 1 addition & 3 deletions web/scripts/headless-ai-runtime.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -924,9 +924,7 @@ async function verifyBrowserBoundary(projectId, provider) {
await page.locator('.ai-composer [name="prompt"]').fill("Verify locale propagation.");
await page.locator('[data-action="send-prompt"]').click();
await page
.getByText("Mock provider turn 8 completed.", {
exact: false
})
.getByText(/Mock provider turn 8 completed\./)
.waitFor({ timeout: 10_000 });
}

Expand Down
6 changes: 3 additions & 3 deletions web/scripts/headless-collab-git.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ async function registerOrLogin(email, password, displayName) {

async function login(page, email, password) {
await page.goto(`${baseUrl}/signin`, { waitUntil: "domcontentloaded", timeout: 60000 });
await page.getByPlaceholder("Email").fill(email);
await page.getByPlaceholder("Password").fill(password);
await page.getByPlaceholder("Email", { exact: true }).fill(email);
await page.getByPlaceholder("Password", { exact: true }).fill(password);
await page.getByRole("button", { name: /^(Continue|Sign in)$/ }).last().click();
await page.getByRole("heading", { name: "Projects" }).waitFor({ timeout: 30000 });
await page.getByRole("heading", { name: "Projects", exact: true }).waitFor({ timeout: 30000 });
}

async function openWorkspace(page, projectId) {
Expand Down
6 changes: 3 additions & 3 deletions web/scripts/headless-full-project-load-regression.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ function buildLargeSvg(targetBytes, color) {

async function loginUi(page, email, password) {
await page.goto(`${baseUrl}/signin`, { waitUntil: "domcontentloaded", timeout: 60000 });
await page.getByPlaceholder("Email").fill(email);
await page.getByPlaceholder("Password").fill(password);
await page.getByPlaceholder("Email", { exact: true }).fill(email);
await page.getByPlaceholder("Password", { exact: true }).fill(password);
await page.getByRole("button", { name: /^(Continue|Sign in)$/ }).last().click();
await page.getByRole("heading", { name: /Projects|项目/ }).waitFor({ timeout: 60000 });
await page.getByRole("heading", { name: /^(Projects|项目)$/ }).waitFor({ timeout: 60000 });
}

async function openWorkspace(page, projectId) {
Expand Down
6 changes: 3 additions & 3 deletions web/scripts/headless-large-project-performance.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ async function ensureLargeProject(sessionToken) {

async function loginUi(page) {
await page.goto(`${baseUrl}/signin`, { waitUntil: "domcontentloaded", timeout: 120000 });
await page.getByPlaceholder("Email").fill(userEmail);
await page.getByPlaceholder("Password").fill(userPassword);
await page.getByPlaceholder("Email", { exact: true }).fill(userEmail);
await page.getByPlaceholder("Password", { exact: true }).fill(userPassword);
await page.getByRole("button", { name: /^(Continue|Sign in)$/ }).last().click();
await page.getByRole("heading", { name: /Projects|项目/ }).waitFor({ timeout: 60000 });
await page.getByRole("heading", { name: /^(Projects|项目)$/ }).waitFor({ timeout: 60000 });
}

function createMetricCollector(page, cdp) {
Expand Down
76 changes: 0 additions & 76 deletions web/scripts/headless-preview-position-restore.mjs

This file was deleted.

10 changes: 5 additions & 5 deletions web/scripts/headless-revision-collab-regression.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ async function registerOrLogin(email, password, displayName) {

async function login(page, email, password) {
await page.goto(`${baseUrl}/signin`, { waitUntil: "domcontentloaded", timeout: 60000 });
const projectsHeading = page.getByRole("heading", { name: "Projects" });
const emailInput = page.getByPlaceholder("Email");
const projectsHeading = page.getByRole("heading", { name: "Projects", exact: true });
const emailInput = page.getByPlaceholder("Email", { exact: true });
await emailInput.fill(email);
await page.getByPlaceholder("Password").fill(password);
await page.getByPlaceholder("Password", { exact: true }).fill(password);
await page.getByRole("button", { name: /^(Continue|Sign in)$/ }).last().click();
await projectsHeading.waitFor({ timeout: 30000 });
}
Expand Down Expand Up @@ -134,7 +134,7 @@ async function main() {
throw new Error(`expected one marker after typing; got ${count}`);
}

await pageA.getByRole("button", { name: "Revisions" }).click();
await pageA.getByRole("button", { name: "Revisions", exact: true }).click();
await pageA.locator(".history-item").first().waitFor({ timeout: 10000 });
await pageA.locator(".history-item").first().click();
await pageA.waitForFunction(
Expand All @@ -146,7 +146,7 @@ async function main() {
await pageA.screenshot({ path: revisionShot, fullPage: true });
artifacts.push(revisionShot);

await pageA.getByRole("button", { name: "Revisions" }).click();
await pageA.getByRole("button", { name: "Revisions", exact: true }).click();
await pageA.waitForFunction(
(needle) => (document.querySelector(".cm-content")?.textContent || "").includes(needle),
marker,
Expand Down
10 changes: 5 additions & 5 deletions web/scripts/headless-revision-panel.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ async function registerOrLogin(email, password, displayName) {

async function login(page, email, password) {
await page.goto(`${baseUrl}/signin`, { waitUntil: "domcontentloaded", timeout: 60000 });
await page.getByPlaceholder("Email").fill(email);
await page.getByPlaceholder("Password").fill(password);
await page.getByPlaceholder("Email", { exact: true }).fill(email);
await page.getByPlaceholder("Password", { exact: true }).fill(password);
await page.getByRole("button", { name: /^(Continue|Sign in)$/ }).last().click();
await page.getByRole("heading", { name: "Projects" }).waitFor({ timeout: 30000 });
await page.getByRole("heading", { name: "Projects", exact: true }).waitFor({ timeout: 30000 });
}

async function main() {
Expand Down Expand Up @@ -107,7 +107,7 @@ async function main() {
await page.screenshot({ path: liveShot, fullPage: true });
artifacts.push(liveShot);

await page.getByRole("button", { name: "Revisions" }).click();
await page.getByRole("button", { name: "Revisions", exact: true }).click();
await page.locator(".history-item").first().waitFor({ timeout: 10000 });
await page.locator(".history-item").nth(1).click();
await page.waitForFunction(
Expand All @@ -124,7 +124,7 @@ async function main() {
await page.screenshot({ path: revisionShot, fullPage: true });
artifacts.push(revisionShot);

await page.getByRole("button", { name: "Revisions" }).click();
await page.getByRole("button", { name: "Revisions", exact: true }).click();
await page.waitForFunction(
() => (document.querySelector(".cm-content")?.textContent || "").includes("Version B"),
undefined,
Expand Down
Loading