diff --git a/internal/gui/assets/i18n.js b/internal/gui/assets/i18n.js index 35fab260c..1cb6e21be 100644 --- a/internal/gui/assets/i18n.js +++ b/internal/gui/assets/i18n.js @@ -4,6 +4,8 @@ // works. {name} slots are filled by t(str, vars). const I18N = { zh: { + "Collapse all": "全部收起", + "Expand all": "全部展开", "Found by magpie: {url}": "magpie 自动找到:{url}", "magpie asked this relay where relays tell a key its balance, and reads it here. If the amount is wrong, put in your own Balance URL and field; magpie looks again each day": "magpie 在中转站常用的余额查询地址问到了这个 key 的余额,就从这里读。数额不对的话,请填上你自己的余额 URL 和字段;magpie 每天会重新找一次", "Put this query in the Balance URL and Balance field, to change it": "把这个地址填进余额 URL 和余额字段,方便修改", @@ -4632,6 +4634,8 @@ const I18N = { "This report is no longer kept: magpie keeps the last 5.": "这份报告已经不在了:magpie 只保留最近 5 份。", }, "zh-TW": { + "Collapse all": "全部收起", + "Expand all": "全部展開", "Found by magpie: {url}": "magpie 自動找到:{url}", "magpie asked this relay where relays tell a key its balance, and reads it here. If the amount is wrong, put in your own Balance URL and field; magpie looks again each day": "magpie 在中轉站常用的餘額查詢位址問到了這個 key 的餘額,就從這裡讀。數額不對的話,請填上你自己的餘額 URL 和欄位;magpie 每天會重新找一次", "Put this query in the Balance URL and Balance field, to change it": "把這個位址填進餘額 URL 和餘額欄位,方便修改", @@ -9245,6 +9249,8 @@ const I18N = { "This report is no longer kept: magpie keeps the last 5.": "這份報告已經不在了:magpie 只保留最近 5 份。", }, ja: { + "Collapse all": "すべて折りたたむ", + "Expand all": "すべて展開", "Found by magpie: {url}": "magpie が自動で見つけました:{url}", "magpie asked this relay where relays tell a key its balance, and reads it here. If the amount is wrong, put in your own Balance URL and field; magpie looks again each day": "magpie はリレーが残高を返す一般的な場所でこのキーの残高を見つけ、ここから読んでいます。金額が違う場合は、残高 URL とフィールドを自分で入力してください。magpie は毎日探し直します", "Put this query in the Balance URL and Balance field, to change it": "このクエリを残高 URL と残高フィールドに入れて、変更できるようにします", @@ -13860,6 +13866,8 @@ const I18N = { "This report is no longer kept: magpie keeps the last 5.": "このレポートはもう残っていません。magpie は最新の 5 件だけを保存します。", }, de: { + "Collapse all": "Alle einklappen", + "Expand all": "Alle ausklappen", "Found by magpie: {url}": "Von magpie gefunden: {url}", "magpie asked this relay where relays tell a key its balance, and reads it here. If the amount is wrong, put in your own Balance URL and field; magpie looks again each day": "magpie hat das Guthaben dieses Schlüssels dort gefunden, wo Relays es üblicherweise angeben, und liest es hier. Stimmt der Betrag nicht, trage eigene Guthaben-URL und -Feld ein; magpie sucht jeden Tag neu", "Put this query in the Balance URL and Balance field, to change it": "Diese Abfrage in Guthaben-URL und Guthaben-Feld übernehmen, um sie zu ändern", diff --git a/internal/gui/assets/plugins/library/i18n.js b/internal/gui/assets/plugins/library/i18n.js index 76525703b..cb871cef3 100644 --- a/internal/gui/assets/plugins/library/i18n.js +++ b/internal/gui/assets/plugins/library/i18n.js @@ -743,8 +743,6 @@ magpie.strings({ "{agent} reads ~/.agents/skills itself, where all of these are kept — it has them whatever is ticked here": "{agent} 会自行读取这些技能所在的 ~/.agents/skills,无论是否勾选都能使用", "It reads {n} of them from ~/.agents/skills itself: a click here leaves those as they are": "其中 {n} 个由它自行从 ~/.agents/skills 读取:在这里点击不会改变它们", "{n} in ~/.agents/skills": "{n} 个在 ~/.agents/skills", - "Collapse all": "全部收起", - "Expand all": "全部展开", "Fold every group": "收起所有分组", "Open every group": "展开所有分组", "Fold every group that matches the filter": "收起所有符合筛选的分组", @@ -1527,8 +1525,6 @@ magpie.strings({ "{agent} reads ~/.agents/skills itself, where all of these are kept — it has them whatever is ticked here": "{agent} 會自行讀取這些技能所在的 ~/.agents/skills,無論是否勾選都能使用", "It reads {n} of them from ~/.agents/skills itself: a click here leaves those as they are": "其中 {n} 個由它自行從 ~/.agents/skills 讀取:在這裡點擊不會改變它們", "{n} in ~/.agents/skills": "{n} 個在 ~/.agents/skills", - "Collapse all": "全部收起", - "Expand all": "全部展開", "Fold every group": "收起所有分組", "Open every group": "展開所有分組", "Fold every group that matches the filter": "收起所有符合篩選的分組", @@ -2310,8 +2306,6 @@ magpie.strings({ "{agent} reads ~/.agents/skills itself, where all of these are kept — it has them whatever is ticked here": "{agent} はこれらがすべて置かれている ~/.agents/skills を自分で読みます — ここでのチェックに関係なく使えます", "It reads {n} of them from ~/.agents/skills itself: a click here leaves those as they are": "そのうち {n} 個は ~/.agents/skills から自分で読みます。ここでのクリックではそれらは変わりません", "{n} in ~/.agents/skills": "{n} 個が ~/.agents/skills に", - "Collapse all": "すべて折りたたむ", - "Expand all": "すべて展開", "Fold every group": "すべてのグループを折りたたむ", "Open every group": "すべてのグループを展開", "Fold every group that matches the filter": "フィルタに一致するすべてのグループを折りたたむ", @@ -3094,8 +3088,6 @@ magpie.strings({ "{agent} reads ~/.agents/skills itself, where all of these are kept — it has them whatever is ticked here": "{agent} liest ~/.agents/skills selbst, wo all diese liegen – es hat sie unabhängig davon, was hier angehakt ist", "It reads {n} of them from ~/.agents/skills itself: a click here leaves those as they are": "{n} davon liest es selbst aus ~/.agents/skills: ein Klick hier lässt diese, wie sie sind", "{n} in ~/.agents/skills": "{n} in ~/.agents/skills", - "Collapse all": "Alle einklappen", - "Expand all": "Alle ausklappen", "Fold every group": "Alle Gruppen einklappen", "Open every group": "Alle Gruppen ausklappen", "Fold every group that matches the filter": "Alle Gruppen einklappen, die zum Filter passen", diff --git a/internal/gui/assets/plugins/routing/client.js b/internal/gui/assets/plugins/routing/client.js index 5ecdfd9d4..87c1a7118 100644 --- a/internal/gui/assets/plugins/routing/client.js +++ b/internal/gui/assets/plugins/routing/client.js @@ -3659,7 +3659,16 @@ function routingPage(part) { // button made again each time is one WebKit may drop a click on const reqLabel = el("span", "label"), replayAll = el("button", "text"); replayAll.onclick = () => replay(listed(), pinned); - reqHead.append(reqLabel, el("span", "grow"), reqNote, purposeTools, metricPick, replayAll); + // every group folded or opened at once (zzzkl on Discord): folds them + // all while any is open + const foldAll = el("button", "text rt-fold-all"); + foldAll.type = "button"; + foldAll.onclick = () => { + if ([...sessionRows.keys()].some((k) => !closedSessions.has(k))) for (const k of sessionRows.keys()) closedSessions.add(k); + else closedSessions.clear(); + steady(renderHist); + }; + reqHead.append(reqLabel, el("span", "grow"), reqNote, purposeTools, metricPick, foldAll, replayAll); // each request's row, kept while what it says is the same: the list // is redrawn on every trace update, and made again whole each time it // was most of what a busy gateway cost the page (#308) @@ -3781,10 +3790,10 @@ function routingPage(part) { for (const g of groups.values()) { let x = sessionRows.get(g.key); if (!x) { - const b = el(g.key ? "button" : "div", "rt-session"), name = el("span", "nm"), dir = el("span", "dir"), meta = el("span", "summary"), cost = el("span", "cost"), arrow = el("span", "arrow"); + const b = el("button", "rt-session"), name = el("span", "nm"), dir = el("span", "dir"), meta = el("span", "summary"), cost = el("span", "cost"), arrow = el("span", "arrow"); b.append(arrow, name, dir, meta, cost); x = { b, name, dir, meta, cost, arrow }; - if (g.key) b.onclick = () => { + b.onclick = () => { if (closedSessions.has(g.key)) closedSessions.delete(g.key); else closedSessions.add(g.key); steady(renderHist); }; @@ -3805,7 +3814,7 @@ function routingPage(part) { } return s; }, { cost: 0, tokens: 0, priced: 0, unpriced: 0, running: 0, completed: 0, prompt: 0, read: 0, cached: 0, decodeMs: 0, decodeOut: 0, timed: 0 }); - setText(x.arrow, g.key ? open ? "▾" : "▸" : ""); + setText(x.arrow, open ? "▾" : "▸"); // Background workers have their own IDs. Label groups made entirely // for one purpose without renaming a chat that also made helper calls. const memory = !byKey && g.r.agent === "codex" && g.rows.every((r) => purposeOf(r.kind) === "kind:memory_consolidation"); @@ -3857,7 +3866,7 @@ function routingPage(part) { setText(x.cost, [total.priced ? "≈" + fmtCost({ cost: total.cost, unpriced: 0 }) + (total.unpriced ? "+" : "") : "", credits].filter(Boolean).join(" · ")); x.cost.hidden = !visibleMetrics.includes("cost") || !total.priced && !credits; x.cost.title = [total.priced ? costNote() : "", credits ? t("What {n} of these requests cost in their plan's credits, as the replies said", { n: g.rows.filter((r) => routeCredits([r])).length }) : ""].filter(Boolean).join("\n"); - if (g.key) x.b.setAttribute("aria-expanded", String(open)); + x.b.setAttribute("aria-expanded", String(open)); els.push(x.b); if (open) els.push(...g.els); } @@ -3929,6 +3938,7 @@ function routingPage(part) { reqRows.clear(); sessionRows.clear(); closedSessions.clear(); + foldAll.hidden = true; renderActs(rs); return; } @@ -3936,7 +3946,13 @@ function routingPage(part) { for (const id of reqRows.keys()) if (!ids.has(id)) reqRows.delete(id); // the requests, with their sessions' heads between them when grouped: // a request's row is made only when it is drawn - listItems = by === "key" ? groupedRows(rs, rs, true) : by === "session" && rs.some((r) => r.session) ? groupedRows(rs, rs) : rs; + const grouped = by === "key" || by === "session" && rs.some((r) => r.session); + listItems = by === "key" ? groupedRows(rs, rs, true) : grouped ? groupedRows(rs, rs) : rs; + const folds = grouped && [...sessionRows.keys()].some((k) => !closedSessions.has(k)), fold = t(folds ? "Collapse all" : "Expand all"); + foldAll.hidden = !grouped || sessionRows.size < 2; + setAttr(foldAll, "title", fold); + setAttr(foldAll, "aria-label", fold); + if (foldAll.dataset.on !== String(folds)) { foldAll.dataset.on = folds; foldAll.replaceChildren(svg(folds ? "m5 3 3 3 3-3M5 13l3-3 3 3" : "m5 6 3-3 3 3M5 10l3 3 3-3", 13, 1.6)); } rowsMoved = false; drawList(); // measuring the rows' lines forces a layout: only when a row was made diff --git a/internal/gui/assets/plugins/routing/routing.css b/internal/gui/assets/plugins/routing/routing.css index ad66132f2..b32062d4a 100644 --- a/internal/gui/assets/plugins/routing/routing.css +++ b/internal/gui/assets/plugins/routing/routing.css @@ -399,6 +399,7 @@ button.rt-session { cursor: pointer; } .rt-purpose.open svg { transform: rotate(180deg); } .rt-metric-pick { display: inline-flex; align-items: center; gap: 3px; height: 24px; margin-left: 6px; } .rt-metric-pick.open svg { transform: rotate(180deg); } +.rt-fold-all { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; margin-left: 2px; } .pop.proto-menu.rt-metric-menu { width: 190px; max-width: calc(100vw - 16px); background: var(--card); } .rt-metric-menu .pm-item { align-items: center; } .rt-metric-menu .pm-tick { height: 13px; width: 13px; border: 1px solid var(--line); border-radius: 3px; } diff --git a/internal/gui/tests/inner-scroll-contain.test.cjs b/internal/gui/tests/inner-scroll-contain.test.cjs index 060018c54..9f6d09bb2 100644 --- a/internal/gui/tests/inner-scroll-contain.test.cjs +++ b/internal/gui/tests/inner-scroll-contain.test.cjs @@ -117,7 +117,7 @@ for (const engine of engines) { await page.locator("#view-routing .rt-req").nth(39).waitFor(); // grouped by session, as the reporter's list was await page.locator("#view-routing .rt-group-by button").nth(1).click(); - assert.equal(await page.locator("#view-routing div.rt-session .nm").textContent(), lang === "zh" ? "未提供会话标识" : "No session ID"); + assert.equal(await page.locator("#view-routing .rt-session", { hasText: lang === "zh" ? "未提供会话标识" : "No session ID" }).locator(".nm").textContent(), lang === "zh" ? "未提供会话标识" : "No session ID"); await page.waitForTimeout(500); await heldAtEnds(page, view, page.locator("#view-routing .rt-reqs").first(), "the requests' list"); await ctx.close(); diff --git a/internal/gui/tests/routing-fold-all.test.cjs b/internal/gui/tests/routing-fold-all.test.cjs new file mode 100644 index 000000000..e01bb84fb --- /dev/null +++ b/internal/gui/tests/routing-fold-all.test.cjs @@ -0,0 +1,140 @@ +// Run with Node's test runner and Playwright on the module path; see README.md. +// zzzkl on Discord: grouped by session, the "No session ID" group couldn't be +// folded while every other group could. Now it folds like the rest, and one +// icon button in the list's head folds every group, or opens them all when +// none is open. Only shown while the list is grouped and has two groups or +// more. In Chromium and WebKit, at 1100 and 420 wide, in every language. +const assert = require("node:assert/strict"); +const fs = require("node:fs/promises"); +const path = require("node:path"); +const { test } = require("node:test"); +const { chromium, webkit } = require("playwright"); +const { reach } = require("./reader.cjs"); + +const assets = path.resolve(__dirname, process.env.MAGPIE_ROUTING_ASSETS || "../assets"); +const now = new Date(); +const day = [now.getFullYear(), now.getMonth() + 1, now.getDate()].map((n) => String(n).padStart(2, "0")).join("-"); +const stamp = (d) => { + const o = -d.getTimezoneOffset(), p = (n) => String(Math.floor(Math.abs(n))).padStart(2, "0"); + return new Date(d.getTime() + o * 60e3).toISOString().slice(0, 19) + (o < 0 ? "-" : "+") + p(o / 60) + ":" + p(o % 60); +}; +function req(id, session) { + const time = stamp(new Date(now.getTime() - (10 - id) * 60e3)); + const seat = { id: "relay", provider: "relay", name: "Relay", who: "Test account", kind: "account", model: "model-a" }; + return { id, seq: id, time, agent: "claude", session, model: "relay/model-a", provider: "relay", cost: 0.01, priced: true, + order: [seat], tries: [{ id: seat.id, model: seat.model, start: time, done: true, status: 200, ms: 4500 }], + done: true, status: 200, ms: 4500, tokens: 2000, ttft: 1200 }; +} +const routes = [req(1, "chat-a"), req(2, ""), req(3, "chat-b"), req(4, "chat-a"), req(5, "")]; + +function serve(lang) { + return async (route) => { + const url = new URL(route.request().url()); + const json = (data) => route.fulfill({ json: data }); + if (url.pathname === "/boot.js") return route.fulfill({ contentType: "text/javascript", body: `window.bootPrefs = {lang:"${lang}",theme:"light",web:true};` }); + if (url.pathname === "/wails/runtime.js") return route.fulfill({ contentType: "text/javascript", body: "export const Window = {};" }); + if (url.pathname === "/api/state") return json({ agents: [{ id: "claude", name: "Claude Code", fields: [] }], profiles: [], settings: { lang, theme: "light" } }); + if (url.pathname === "/api/gateway/trace") { + if (url.searchParams.has("wait")) return new Promise(() => {}); // no live update + return json({ mine: true, now: now.toISOString(), seq: 5, totals: { requests: 5, rerouted: 0, errors: 0 }, routes }); + } + if (url.pathname === "/api/gateway/history") return json({ cut: false, days: [{ day, requests: routes.length }], routes: [] }); + if (url.pathname === "/api/gateway/session-titles") return json({}); + if (url.pathname === "/api/clis") return json({ agents: [], providers: [] }); + if (url.pathname === "/api/groups") return json({ groups: [] }); + if (url.pathname === "/api/providers") return json({ providers: [], gateway: { running: true, window: true } }); + if (url.pathname.startsWith("/api/")) return json({}); + const file = path.join(assets, url.pathname === "/" ? "index.html" : url.pathname); + const contentType = { ".html": "text/html", ".js": "text/javascript", ".css": "text/css", ".svg": "image/svg+xml", ".png": "image/png" }[path.extname(file)]; + try { await route.fulfill({ body: await fs.readFile(file), contentType }); } catch { await route.fulfill({ status: 404, body: "" }); } + }; +} + +const KEYS = ["No session ID", "Collapse all", "Expand all"]; + +for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) { + for (const width of [1100, 420]) { + for (const lang of ["en", "zh", "zh-TW", "ja", "de"]) { + test(`${engine} ${width} ${lang}: every session group folds, the one with no session id too, and all fold at once`, async (t) => { + const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" })); + const page = await browser.newPage({ viewport: { width, height: 800 }, reducedMotion: "reduce" }); + t.after(async () => { + if (process.env.ARTIFACT_DIR) { + await fs.mkdir(process.env.ARTIFACT_DIR, { recursive: true }); + await page.screenshot({ path: path.join(process.env.ARTIFACT_DIR, `${engine}-${width}-${lang}-routing-fold-all.png`) }); + } + await browser.close(); + }); + page.setDefaultTimeout(5000); + page.setDefaultNavigationTimeout(60000); + const errors = []; + page.on("pageerror", (e) => errors.push(e.message)); + await page.route("**/*", serve(lang)); + await page.goto("http://magpie.test/?view=routing"); + const view = page.locator("#view-routing"); + await view.locator(".rt-req").nth(4).waitFor(); + await view.locator(".rt-group-by button").nth(1).click(); + await view.locator(".rt-session").nth(2).waitFor(); + + const w = await page.evaluate((keys) => Object.fromEntries(keys.map((k) => [k, t(k)])), KEYS); + if (lang !== "en") assert.deepEqual(KEYS.filter((k) => w[k] === k), [], `${lang} lacks these`); + const rows = () => view.locator(".rt-req").count(); + const groups = view.locator(".rt-session"); + const bare = groups.filter({ hasText: w["No session ID"] }); + const fold = view.locator(".rt-req-head .rt-fold-all"); + const open = () => groups.evaluateAll((gs) => gs.map((g) => g.getAttribute("aria-expanded"))); + // where the view is scrolled, and the furthest it can be: a fold + // that makes the page shorter than where it was can't stay put + const y = () => view.evaluate((v) => [v.scrollTop, v.scrollHeight - v.clientHeight, document.scrollingElement.scrollTop]); + + // the reporter's case: the group with no session id folds and opens + assert.equal(await groups.count(), 3); + assert.equal(await bare.count(), 1); + assert.equal(await bare.getAttribute("aria-expanded"), "true", "the no-session group can't be folded"); + await reach(page, bare); + await bare.click(); + assert.equal(await bare.getAttribute("aria-expanded"), "false"); + assert.equal(await rows(), 3, "its two requests are still shown"); + await bare.click(); + assert.equal(await rows(), 5); + + // one button folds them all, then opens them all; it says which + await fold.waitFor(); + assert.equal(await fold.getAttribute("aria-label"), w["Collapse all"]); + assert.equal(await fold.getAttribute("title"), w["Collapse all"]); + assert.equal((await fold.textContent()).trim(), "", "the button has words beside its icon"); + const box = await fold.boundingBox(), head = await view.locator(".rt-req-head").boundingBox(); + assert(box.x >= head.x - 1 && box.x + box.width <= head.x + head.width + 1, "the button is out of the head row"); + await reach(page, fold); + const before = await y(); + await fold.click(); + assert.deepEqual(await open(), ["false", "false", "false"]); + assert.equal(await rows(), 0); + assert.equal(await fold.getAttribute("aria-label"), w["Expand all"]); + const [top, most, doc] = await y(); + assert(top === before[0] || top < before[0] && top >= most - 1, `the click scrolled: ${before} to ${[top, most]}`); + assert.equal(doc, before[2], "the click scrolled the window"); + await reach(page, fold); + await fold.click(); + assert.deepEqual(await open(), ["true", "true", "true"]); + assert.equal(await rows(), 5); + // one open is enough for it to fold them all + await reach(page, groups.first()); + await groups.first().click(); + await reach(page, bare); + await bare.click(); + assert.equal(await fold.getAttribute("aria-label"), w["Collapse all"]); + await reach(page, fold); + await fold.click(); + assert.deepEqual(await open(), ["false", "false", "false"]); + + // by request there are no groups, and no button + await reach(page, view.locator(".rt-group-by button").first()); + await view.locator(".rt-group-by button").first().click(); + assert.equal(await rows(), 5); + assert(await fold.isHidden(), "the button shows with no groups"); + assert.deepEqual(errors, []); + }); + } + } +} diff --git a/internal/gui/tests/routing-sessions.test.cjs b/internal/gui/tests/routing-sessions.test.cjs index 041f656de..64fd15cf9 100644 --- a/internal/gui/tests/routing-sessions.test.cjs +++ b/internal/gui/tests/routing-sessions.test.cjs @@ -74,7 +74,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", assert.match(await group.locator(".summary").textContent(), lang === "zh" ? /3 个请求.*6.0k/ : /3 requests.*6.0k/); assert.equal(await group.locator(".cost").textContent(), "≈$0.030+", "partial totals must be marked"); assert.equal(await page.locator("button.rt-session").filter({ hasText: "Claude Code" }).locator(".cost").textContent(), "≈$0.000", "zero price is known"); - assert.equal(await page.locator("div.rt-session .cost").isVisible(), false, "unknown cost is omitted for legacy requests"); + assert.equal(await page.locator(".rt-session", { hasText: lang === "zh" ? "未提供会话标识" : "No session ID" }).locator(".cost").isVisible(), false, "unknown cost is omitted for legacy requests"); assert.equal(await page.locator(".rt-req").count(), 6); await group.click(); @@ -162,7 +162,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", assert.equal(await group("named-memory").locator(".nm").textContent(), "Codex · Named memory"); assert.equal(await group("mixed").locator(".nm").textContent(), "Codex · mixed"); assert.equal(await group("unknown").locator(".nm").textContent(), "Codex · unknown"); - assert.equal(await page.locator("div.rt-session .nm").textContent(), lang === "zh" ? "未提供会话标识" : "No session ID"); + assert.equal(await page.locator(".rt-session", { hasText: lang === "zh" ? "未提供会话标识" : "No session ID" }).locator(".nm").textContent(), lang === "zh" ? "未提供会话标识" : "No session ID"); assert.equal(await page.locator(".rt-session").count(), 7, "separate memory IDs must not merge with each other or the chat"); const memory = group("memory-a"), handle = await memory.elementHandle(); @@ -242,7 +242,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", assert.equal(await group("mixed").locator(".nm").textContent(), "Codex · mixed"); assert.equal(await group("named-chat").locator(".nm").textContent(), "Codex · Chat title"); assert.equal(await group("other-agent").locator(".nm").textContent(), "Claude Code · other-agent"); - assert.equal(await page.locator("div.rt-session .nm").textContent(), lang === "zh" ? "未提供会话标识" : "No session ID"); + assert.equal(await page.locator(".rt-session", { hasText: lang === "zh" ? "未提供会话标识" : "No session ID" }).locator(".nm").textContent(), lang === "zh" ? "未提供会话标识" : "No session ID"); assert.equal(await page.locator(".rt-session").count(), 8, "suggestion workers retain separate session groups"); assert.deepEqual(errors, []); });