Skip to content

bug(platform): task views show a removed member as a raw user id #3788

Closed

Description

@yannickmonney

P3 · Reproduced locally at e3943c5f5c1e69c39309bb8f5b9cf5e63ce41672.

After a member is removed from the organization, the task dialog, the board card and the list row print that person's raw 32-character user id wherever they would name them:

  • Assignee, Reviewer and Author in the task dialog;
  • the author line of their comment;
  • the Activity lines ("reviewer changed: pTqO7Cn7…", "pTqO7Cn7… created: To do");
  • the board's review chip ("Waiting on pTqO7Cn7…");
  • the accessible name of the avatar image on the board card and in the list row.

The same person reads Former member on Governance → Competences.

Reproduction

  1. Editor A creates a task, assigns it to themself and comments on it. The owner sets Reviewer to A and moves the task to In review.
  2. Remove A: Settings → Members → A's row menu → Delete. The proof calls the same members door directly.
  3. Open the board and the task.

Expected: a readable, localized label for someone who is no longer a member. The app already has one:

Actual: the raw user id in each place listed above. Before the removal, the same views said "Ava Editor" and the chip said "Waiting on Ava Editor".

User impact

An owner who reviews the history, reassigns the work or chases a stuck review sees opaque ids instead of a name or a clear "Former member". Assistive technology gets the id as the avatar's name. The id is not secret, but it tells the reader nothing.

Cause

Suggested acceptance test

Component tests on resolveActor, resolveAssigneeId and TaskModal, with a loaded directory that lacks user X. X should render as Former member (EN/DE/FR) in each of these places:

  • as assignee, reviewer and author;
  • as a comment author;
  • in the "assignee changed" and "reviewer changed" Activity lines;
  • in the board chip;
  • as the avatar's accessible name.

While the directory is still loading, show a skeleton or nothing, never the id.

Evidence: frozen output (proof-f3-former-member.cjs, one fresh organization)

setup: org 5JOuFLcSKYJhndE37PRoOmvrNafASH1b | task by A 200 | A comment 200 {"messageId":"0dc688f8-7ebb-409d-b924-a93bc722acb1","threadId":"45342d8c-72b0-45 | reviewer=A 200 | owner moves it to In review 200 | A userId pTqO7Cn7D9MmBLjW1v2p9yne5Ed1BxOb
fixture: competence granted to A -> 201 {"recordId":"ab1a31cf-c12e-4c57-ba55-280e22ecd31a"}
before dialog details: Status In review Priority No priority Assignee AE Ava Editor Reviewer AE Ava Editor Start date Pick a date Due date Pick a date Repeat Never Labels Labels Dependencies Blocked by None Blocks None Author AE Ava Editor Created September 28, 2026 Watch Archive Delete
before raw ids in the dialog: []
before comment/activity rows: ["AE Ava Editor · a few seconds ago First draft is in the shared folder. Delete","OT Owner t3fm status changed: To do → In review · a few seconds ago","OT Owner t3fm reviewer changed: Ava Editor · a few seconds ago","AE Ava Editor comment added · a few seconds ago","AE Ava Editor created: To do · a few seconds ago"]
before board: review chip = Waiting on Ava Editor | raw ids in text: [] | raw ids in the accessibility tree: ["5JOuFLcSKYJhndE37PRoOmvrNafASH1b"] | card aria: ["- img \"Handover board\"","- button \"Draft the handover note\"","- button \"Assign\":","- img \"Ava Editor\""]
before list view: raw ids in text: [] | in the accessibility tree: ["5JOuFLcSKYJhndE37PRoOmvrNafASH1b"]
owner removed A -> 200
after dialog details: Status In review Priority No priority Assignee PT pTqO7Cn7D9MmBLjW1v2p9yne5Ed1BxOb Reviewer PT pTqO7Cn7D9MmBLjW1v2p9yne5Ed1BxOb Start date Pick a date Due date Pick a date Repeat Never Labels Labels Dependencies Blocked by None Blocks None Author PT pTqO7Cn7D9MmBLjW1v2p9yne5Ed1BxOb Created September 28, 2026 Watch Archive Delete
after raw ids in the dialog: ["pTqO7Cn7D9MmBLjW1v2p9yne5Ed1BxOb"]
after comment/activity rows: ["PT pTqO7Cn7D9MmBLjW1v2p9yne5Ed1BxOb · a few seconds ago First draft is in the shared folder. Delete","OT Owner t3fm status changed: To do → In review · a few seconds ago","OT Owner t3fm reviewer changed: pTqO7Cn7D9MmBLjW1v2p9yne5Ed1BxOb · a few seconds ago","PT pTqO7Cn7D9MmBLjW1v2p9yne5Ed1BxOb comment added · a few seconds ago","PT pTqO7Cn7D9MmBLjW1v2p9yne5Ed1BxOb created: To do · a few seconds ago"]
after board: review chip = Waiting on pTqO7Cn7D9MmBLjW1v2p9yne5Ed1BxOb | raw ids in text: [] | raw ids in the accessibility tree: ["5JOuFLcSKYJhndE37PRoOmvrNafASH1b","pTqO7Cn7D9MmBLjW1v2p9yne5Ed1BxOb"] | card aria: ["- img \"Handover board\"","- button \"Draft the handover note\"","- button \"Assign\":","- img \"pTqO7Cn7D9MmBLjW1v2p9yne5Ed1BxOb\""]
after list view: raw ids in text: [] | in the accessibility tree: ["5JOuFLcSKYJhndE37PRoOmvrNafASH1b","pTqO7Cn7D9MmBLjW1v2p9yne5Ed1BxOb"]
CONTROL Competences page names the removed holder: "er Competence Status Granted Evidence Actions Former member contract-review Revoked 09/28/2026 09/28/2026 by Owner t3fm — " | shows "Former member" = true | raw id shown = false
--- console/http log --- (none)

Control in the same run: Governance → Competences, filtered to Revoked, names the same removed person Former member and shows no id.

Mocked boundary: none. Real SPA, backend and PostgreSQL.

Related

The same removal also leaves the waiting review stuck on the removed person. That is filed as #3789; this one is only about the name.

Deduplication

Searched all 1,072 issues, in every state, for raw or bare ids and for former, removed or deleted members and users, "Former member" and resolveActor. Nothing covers people in the task views. #3044 (closed) was a raw project id in chat. Found by the TALE-70 local audit. No production system, real provider, mailbox or external delivery was used.

Local stack (loopback only)
  • Source: a detached worktree of e3943c5f5c1e69c39309bb8f5b9cf5e63ce41672 (origin/main on 2026-09-28) with bun install --frozen-lockfile. The code named in this issue is unchanged on main e71775a8b (9 commits later), except task-modal.tsx. Its change on main adds a description counter and does not touch the Assignee, Reviewer or Author lines.
  • Databases: PostgreSQL 16.14 (embedded-postgres binaries) with pgvector 0.8.6 on 127.0.0.1; tale_app, and tale_knowledge with vector. No pg_search (not involved).
  • Backend, from services/platform: node --experimental-transform-types --import ./backend/node-loader.mjs backend/main.ts with ROLE=all PORT=3005 SITE_URL=http://localhost:3000 NODE_ENV=development, an empty TALE_CONFIG_DIR, TALE_CONFIG_BUILTIN_DIR=configs/platform/custom, TALE_ALLOW_OPEN_SIGN_UP=true, TALE_DEV_SEED_USER=1, locally generated BETTER_AUTH_SECRET / ENCRYPTION_SECRET_HEX / INSTANCE_SECRET, and no object store. Egress is blocked: NODE_USE_ENV_PROXY=1 HTTP_PROXY=HTTPS_PROXY=http://127.0.0.1:9 NO_PROXY=127.0.0.1,localhost,::1.
  • SPA: bun --bun vite build, then TALE_BACKEND_URL=http://127.0.0.1:3005 bunx --bun vite preview --port 3000 (the production-build E2E serving path; the boot-shell prerender step was skipped).
  • Browser: Chromium 141.0.7390.37 headless, driven by the worktree's playwright-core 1.58.2 with serviceWorkers: 'block', en-US, 1280×900.
  • Fixtures: each proof signs up its own accounts and organization through POST /api/auth/sign-up/email and POST /api/auth/organization/create. Credentials carry fake secrets that nothing tests; no provider, mailbox or other external service is reachable.
  • Replay: T70_ROOT=<dir> node <proof>.cjs, where <dir>/tale is the worktree and <dir>/evidence/ receives the log; adjust the Chromium path in lib.cjs.
probes/proof-f3-former-member.cjs
// PROOF F3: how the task views name a person who is no longer a member. Editor A creates a task, assigns it to
// themself, comments, and is set as Reviewer; the owner removes A; the owner then reads the board card, the
// task dialog (Assignee, Reviewer, Author, comment, Activity), the board card with its review chip (the task waits
// In review on A) and the list row. Control: the same views
// before the removal; Settings > Governance > Competences names the same removed person "Former member".
// Mocked boundary: none (real SPA, backend, Postgres).
const L = require('./lib.cjs'); const T = require('./tasklib.cjs');
const out = [];
const say = (...a) => { const s = a.map((x) => (typeof x === 'string' ? x : JSON.stringify(x))).join(' '); out.push(s); console.log(s); };
const ID = /\b[A-Za-z0-9]{32}\b/g;
async function read(page, s, tag) {
  await L.goto(page, `${T.boardUrl(s)}?task=${s.taskId}`, 2500);
  const dlg = page.getByRole('dialog');
  await dlg.waitFor();
  const txt = (await dlg.innerText()).replace(/\s+/g, ' ');
  const aside = (await dlg.getByRole('complementary').innerText()).replace(/\s+/g, ' ');
  say(`${tag} dialog details:`, aside.slice(0, 400));
  say(`${tag} raw ids in the dialog:`, [...new Set(txt.match(ID) || [])]);
  const comments = await dlg.locator('li').allInnerTexts();
  say(`${tag} comment/activity rows:`, comments.map((c) => c.replace(/\s+/g, ' ').slice(0, 110)));
  await L.shot(page, `f3-${tag}-dialog`);
  await page.keyboard.press('Escape');
  await L.sleep(500);
  const card = (await page.locator('main').innerText()).replace(/\s+/g, ' ');
  const aria = await page.locator('main').ariaSnapshot();
  const cardAria = aria.split('\n').filter((l) => /Draft the handover note|Assign|img/.test(l)).slice(-4);
  say(`${tag} board: review chip =`, await page.locator('[aria-label^="Waiting on"]').first().getAttribute('aria-label').catch(() => 'none'), '| raw ids in text:', [...new Set(card.match(ID) || [])], '| raw ids in the accessibility tree:', [...new Set(aria.match(ID) || [])], '| card aria:', cardAria.map((l) => l.trim()));
  await L.goto(page, `/dashboard/${s.o.orgId}/projects/${s.projectId}/tasks/list`, 2000);
  const list = (await page.locator('main').innerText()).replace(/\s+/g, ' ');
  const laria = await page.locator('main').ariaSnapshot();
  say(`${tag} list view: raw ids in text:`, [...new Set(list.match(ID) || [])], '| in the accessibility tree:', [...new Set(laria.match(ID) || [])]);
  await L.shot(page, `f3-${tag}-list`);
}
(async () => {
  const browser = await L.launch();
  const log = [];
  try {
    const o = await L.freshOrg(browser, 't3fm');
    const a = await L.addMember(browser, o, 'editor', 'Ava Editor');
    const p = await L.api(o.ctx, 'POST', `/api/app/projects?orgId=${o.orgId}`, { name: 'Handover board' });
    // A creates the task, is its assignee, comments, and is its reviewer.
    const t = await L.api(a.ctx, 'POST', `/api/app/tasks?orgId=${o.orgId}`, { projectId: p.body.projectId, title: 'Draft the handover note', status: 'todo', assigneeType: 'user', assigneeId: a.userId });
    const c = await L.api(a.ctx, 'POST', `/api/app/tasks/${t.body.taskId}/comments?orgId=${o.orgId}`, { body: 'First draft is in the shared folder.' });
    const r = await L.api(o.ctx, 'POST', `/api/app/tasks/${t.body.taskId}?orgId=${o.orgId}`, { reviewerUserId: a.userId });
    const ir = await L.api(o.ctx, 'POST', `/api/app/tasks/${t.body.taskId}/status?orgId=${o.orgId}`, { status: 'in_review' });
    say('setup: org', o.orgId, '| task by A', t.status, '| A comment', c.status, JSON.stringify(c.body).slice(0, 80), '| reviewer=A', r.status, '| owner moves it to In review', ir.status, '| A userId', a.userId);
    const g = await L.api(o.ctx, 'POST', `/api/app/governance/competences?orgId=${o.orgId}`, { userId: a.userId, competence: 'contract-review' });
    say('fixture: competence granted to A ->', g.status, JSON.stringify(g.body).slice(0, 80));
    const s = { o, a, projectId: p.body.projectId, taskId: t.body.taskId, title: 'Draft the handover note' };
    const page = await o.ctx.newPage();
    L.watch(page, log, '[O]');
    await read(page, s, 'before');
    const del = await L.api(o.ctx, 'DELETE', `/api/app/members/${a.memberId}?orgId=${o.orgId}`);
    say('owner removed A ->', del.status);
    await read(page, s, 'after');
    await L.goto(page, `/dashboard/${o.orgId}/settings/governance/competences`, 2500);
    await page.getByRole('button', { name: /^Filter/ }).first().click();
    const panel = page.getByRole('dialog', { name: 'Filters' });
    await panel.waitFor();
    const revoked = panel.getByRole('checkbox', { name: /Revoked/ });
    if (!(await revoked.isVisible())) await panel.getByRole('button', { name: /Status/ }).click();
    await revoked.click();
    await L.sleep(800);
    await page.keyboard.press('Escape');
    await L.sleep(500);
    const comp = (await page.locator('main').innerText()).replace(/\s+/g, ' ');
    say('CONTROL Competences page names the removed holder:', JSON.stringify(comp.match(/.{0,60}contract-review.{0,60}/)?.[0] ?? comp.slice(-200)), '| shows "Former member" =', comp.includes('Former member'), '| raw id shown =', comp.includes(a.userId));
    await L.shot(page, 'f3-control-competences-former-member');
  } finally {
    say('--- console/http log ---', log.length ? '' : '(none)');
    for (const l of log) say(l);
    L.fs.writeFileSync(L.path.join(L.ROOT, 'evidence/proof-f3-former-member.log'), out.join('\n') + '\n');
    await browser.close();
  }
})().catch((e) => { console.error(e); process.exit(1); });
probes/tasklib.cjs
// Task-review helpers shared by the task probes: an owner and two editors of one fresh org, each in its own
// browser context (its own session cookies), with an org-wide project holding one task in To do.
const L = require('./lib.cjs');
async function setupReviewOrg(browser, label, opts = {}) {
  const o = await L.freshOrg(browser, label);
  const a = await L.addMember(browser, o, opts.aRole ?? 'editor', 'Ava Editor');
  const b = await L.addMember(browser, o, opts.bRole ?? 'editor', 'Ben Editor');
  const p = await L.api(o.ctx, 'POST', `/api/app/projects?orgId=${o.orgId}`, { name: opts.projectName ?? 'Review board', ...(opts.teamIds ? { teamIds: opts.teamIds } : {}) });
  if (p.status !== 200) throw new Error(`project: ${p.status} ${JSON.stringify(p.body)}`);
  const t = await L.api(o.ctx, 'POST', `/api/app/tasks?orgId=${o.orgId}`, { projectId: p.body.projectId, title: opts.title ?? 'Check the launch brief', status: 'todo' });
  if (t.status !== 200) throw new Error(`task: ${t.status} ${JSON.stringify(t.body)}`);
  return { o, a, b, projectId: p.body.projectId, taskId: t.body.taskId, title: opts.title ?? 'Check the launch brief' };
}
const boardUrl = (s) => `/dashboard/${s.o.orgId}/projects/${s.projectId}/tasks/board`;
/** The bell button's accessible name carries the unread count ("Notifications, 2 unread notifications"). */
async function bell(page) {
  const label = await page.locator('button[aria-label^="Notifications"]').first().getAttribute('aria-label').catch(() => null);
  const m = label && label.match(/(\d+) unread/);
  return m ? Number(m[1]) : 0;
}
/** A user's task notifications in the org, newest first, as `kind:read|UNREAD`. */
async function notes(user, orgId) {
  const r = await L.api(user.ctx, 'GET', `/api/app/collab/notifications?orgId=${orgId}`);
  const list = r.body.rows ?? r.body.items;
  if (!Array.isArray(list)) return [`(unexpected ${r.status}) ${JSON.stringify(r.body).slice(0, 200)}`];
  return list.map((n) => `${n.type}:${n.read ? 'read' : 'UNREAD'}`);
}
/** The review chip(s) on the board ("Waiting on …"), or 'none'. Each proof board holds one task. */
async function chip(page) {
  const c = page.locator('[aria-label^="Waiting on"], [aria-label="Needs review"]');
  const labels = [];
  for (let i = 0; i < (await c.count()); i++) labels.push(await c.nth(i).getAttribute('aria-label'));
  return labels.length ? labels.join(' / ') : 'none';
}
async function openTask(page, s) {
  await L.goto(page, `${boardUrl(s)}?task=${s.taskId}`, 1500);
  await page.getByRole('dialog').waitFor();
}
/** In the open task dialog: pick a reviewer by visible name, or 'clear'. */
async function pickReviewer(page, who) {
  const dlg = page.getByRole('dialog').first();
  await dlg.getByRole('button', { name: 'Reviewer', exact: true }).click();
  const list = page.getByRole('listbox', { name: 'Reviewer' });
  await list.waitFor({ timeout: 5000 });
  if (who === 'clear') {
    await page.getByRole('button', { name: /Clear reviewer/ }).or(page.getByRole('option', { name: /Clear reviewer/ })).first().click();
  } else {
    await list.getByRole('option', { name: new RegExp(`^${who}`) }).first().click();
  }
  await L.sleep(1200);
  return reviewerField(page);
}
/** The text the task dialog shows beside its Reviewer button (the designee's name, or No reviewer). */
async function reviewerField(page) {
  return page.evaluate(() => {
    const btn = document.querySelector('[role="dialog"] button[aria-label="Reviewer"]');
    return btn ? (btn.parentElement.innerText || '').trim() : '(no Reviewer button)';
  });
}
async function pickStatus(page, label) {
  const dlg = page.getByRole('dialog').first();
  await dlg.getByRole('button', { name: /^Status/ }).click();
  await page.getByRole('listbox', { name: 'Status' }).getByRole('option', { name: new RegExp(`^${label}`) }).first().click();
  await L.sleep(1200);
}
module.exports = { reviewerField, setupReviewOrg, boardUrl, bell, notes, chip, openTask, pickReviewer, pickStatus };
probes/lib.cjs
// TALE-70 local audit probe helpers. Local stack only: SPA http://localhost:3000 (vite preview of the
// production build, proxying /api, /events, /dav to the backend on 127.0.0.1:3005). Every probe mints its
// own synthetic organization and accounts through the local sign-up door; nothing else is touched.
const path = require('node:path');
const fs = require('node:fs');
const ROOT = process.env.T70_ROOT || path.join(process.env.HOME, '.cache/t70');
const { chromium } = require(path.join(ROOT, 'tale/node_modules/playwright-core'));
const BASE = 'http://localhost:3000';
const ORIGIN = { origin: BASE };
const PW = 'TaleAudit!Passw0rd';
const SHOTS = path.join(ROOT, 'evidence/shots');

async function launch() {
  return chromium.launch({
    executablePath: '/opt/ms-playwright/chromium-1194/chrome-linux/chrome',
    headless: true,
    args: ['--disable-dev-shm-usage'],
  });
}
async function newContext(browser, opts = {}) {
  return browser.newContext({
    baseURL: BASE,
    serviceWorkers: 'block',
    viewport: opts.viewport ?? { width: 1280, height: 900 },
    locale: opts.locale ?? 'en-US',
    colorScheme: opts.colorScheme ?? 'light',
    reducedMotion: 'reduce',
  });
}
async function api(ctx, method, url, data) {
  const r = await ctx.request.fetch(url, { method, data, headers: ORIGIN });
  const text = await r.text();
  let body = text;
  try { body = JSON.parse(text); } catch { /* keep text */ }
  return { status: r.status(), body };
}
function stamp(label) { return `${label}-${Date.now().toString(36)}`; }

/** A fresh owner with a fresh organization (sign-up + organization/create + set-active). */
async function freshOrg(browser, label, opts = {}) {
  const s = stamp(label);
  const email = `t70-${s}@tale.test`;
  const ctx = await newContext(browser, opts);
  const su = await api(ctx, 'POST', '/api/auth/sign-up/email', { email, password: PW, name: `Owner ${label}` });
  if (su.status !== 200) throw new Error(`sign-up ${email}: ${su.status} ${JSON.stringify(su.body)}`);
  const org = await api(ctx, 'POST', '/api/auth/organization/create', { name: `T70 ${s}`, slug: `t70-${s}` });
  if (org.status !== 200) throw new Error(`org create: ${org.status} ${JSON.stringify(org.body)}`);
  await api(ctx, 'POST', '/api/auth/organization/set-active', { organizationId: org.body.id });
  return { ctx, orgId: org.body.id, email, userId: su.body.user.id, stamp: s, name: `Owner ${label}` };
}
/** A second account added to the owner's organization with `role`, in its own browser context. */
async function addMember(browser, owner, role, name, opts = {}) {
  const email = `t70-${owner.stamp}-${name.toLowerCase().replace(/[^a-z0-9]+/g, '-')}@tale.test`;
  const ctx = await newContext(browser, opts);
  const su = await api(ctx, 'POST', '/api/auth/sign-up/email', { email, password: PW, name });
  if (su.status !== 200) throw new Error(`sign-up ${email}: ${su.status} ${JSON.stringify(su.body)}`);
  const add = await api(owner.ctx, 'POST', `/api/app/members?orgId=${owner.orgId}`, { userId: su.body.user.id, role });
  if (add.status !== 200) throw new Error(`add member ${role}: ${add.status} ${JSON.stringify(add.body)}`);
  await api(ctx, 'POST', '/api/auth/organization/set-active', { organizationId: owner.orgId });
  return { ctx, email, name, userId: su.body.user.id, memberId: add.body.memberId };
}
function watch(page, sink, tag = '') {
  page.on('console', (m) => { if (['error', 'warning'].includes(m.type()) && !BENIGN.some((b) => b.test(m.text()))) sink.push(`${tag}[console.${m.type()}] ${m.text().slice(0, 300)}`); });
  page.on('pageerror', (e) => sink.push(`${tag}[pageerror] ${String(e).slice(0, 300)}`));
  page.on('response', (r) => { if (r.status() >= 400 && r.url().includes('/api/')) sink.push(`${tag}[http ${r.status()}] ${r.request().method()} ${r.url().replace(BASE, '')}`); });
}
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
/** One-line description of document.activeElement. */
const focusedDesc = (page) => page.evaluate(() => {
  const e = document.activeElement;
  if (!e || e === document.body) return 'BODY';
  const name = (e.getAttribute('aria-label') || e.innerText || e.getAttribute('placeholder') || e.value || '').trim().split('\n')[0].slice(0, 60);
  const role = e.getAttribute('role');
  return `${e.tagName.toLowerCase()}${role ? `[role=${role}]` : ''} "${name}"`;
});
async function shot(page, name, opts = {}) {
  fs.mkdirSync(SHOTS, { recursive: true });
  const p = path.join(SHOTS, `${name}.png`);
  await page.screenshot({ path: p, fullPage: opts.fullPage ?? false });
  return p;
}
/** Horizontal overflow of the document and of every element wider than the viewport. */
const overflow = (page) => page.evaluate(() => {
  const vw = document.documentElement.clientWidth;
  const doc = document.documentElement.scrollWidth;
  const wide = [];
  for (const el of document.querySelectorAll('body *')) {
    const r = el.getBoundingClientRect();
    if (r.width > 0 && (r.right > vw + 1) && getComputedStyle(el).position !== 'fixed') {
      // skip descendants of a horizontally scrollable ancestor (a table frame that scrolls on purpose)
      let p = el.parentElement, clipped = false;
      while (p && p !== document.body) {
        const cs = getComputedStyle(p);
        if (/(auto|scroll|hidden|clip)/.test(cs.overflowX)) { clipped = true; break; }
        p = p.parentElement;
      }
      if (!clipped) wide.push(`${el.tagName.toLowerCase()}.${String(el.className).slice(0, 60)} right=${Math.round(r.right)}`);
    }
  }
  return { viewport: vw, scrollWidth: doc, docOverflows: doc > vw + 1, wide: wide.slice(0, 8) };
});
/** Visible toasts (sonner region). */
const toasts = async (page) => (await page.locator('[role="region"] li').allInnerTexts()).map((s) => s.replace(/\s*\n+\s*/g, ' ').trim()).filter(Boolean);
/** Every toast shown since the page loaded (a MutationObserver installed before any script runs). */
const TOAST_RECORDER = () => {
  window.__toasts = [];
  const seen = new WeakSet();
  const scan = () => {
    for (const li of document.querySelectorAll('[role="region"] li')) {
      if (seen.has(li)) continue;
      const text = (li.innerText || '').replace(/\s*\n+\s*/g, ' ').trim();
      if (text) { seen.add(li); window.__toasts.push(text); }
    }
  };
  new MutationObserver(scan).observe(document, { subtree: true, childList: true, characterData: true });
};
async function recordToasts(ctx) { await ctx.addInitScript(TOAST_RECORDER); }
const allToasts = (page) => page.evaluate(() => window.__toasts || []);
// The /events SSE stream keeps the network busy, so never wait for networkidle.
async function goto(page, url, settleMs = 1200) {
  await page.goto(url, { waitUntil: 'domcontentloaded' });
  await page.locator('main').first().waitFor({ timeout: 15000 }).catch(() => {});
  await sleep(settleMs);
}
// Harness artefacts (serviceWorkers: 'block', font preload hints, the route prefetcher's miss note).
const BENIGN = [/Service Worker registration blocked by Playwright/, /Service worker registration failed TypeError: Cannot read properties of undefined \(reading 'waiting'\)/, /was preloaded using link preload but not used/, /\[prefetch\] no 0\.5 row/];
module.exports = { recordToasts, allToasts, launch, newContext, api, freshOrg, addMember, watch, sleep, focusedDesc, shot, overflow, toasts, goto, BASE, ORIGIN, PW, ROOT, SHOTS, fs, path };
/** With a menu open, move keyboard focus with ArrowDown until the focused item matches `re`. */
async function focusMenuItem(page, re) {
  await page.getByRole('menu').waitFor();
  await sleep(150);
  for (let i = 0; i < 12; i++) {
    const cur = await focusedDesc(page);
    if (/menuitem/.test(cur) && re.test(cur)) return cur;
    await page.keyboard.press('ArrowDown');
    await sleep(120);
  }
  throw new Error(`menu item ${re} never took focus`);
}
/** Inside an open dialog, Tab until the focused element matches `re`. */
async function tabTo(page, re, max = 12) {
  for (let i = 0; i < max; i++) {
    const cur = await focusedDesc(page);
    if (re.test(cur)) return cur;
    await page.keyboard.press('Tab');
    await sleep(80);
  }
  throw new Error(`Tab never reached ${re}; at ${await focusedDesc(page)}`);
}
Object.assign(module.exports, { focusMenuItem, tabTo });

Activity

  1. added
    agent-ready
    on Oct 29, 2026
  2. added a commit that references this issue on Oct 30, 2026
    86366f9
  3. added a commit that references this issue on Oct 30, 2026
    0bf915d
  4. added a commit that references this issue on Oct 30, 2026
    992a704
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions