gui: the tray panel's Hide accounts covers its model picker too (#2509, PaulT on Discord)
With Hide accounts on, the panel's agent model picker (Hermes Agent's, CODEX group: "GPT-6-Astra via magpie <address>") showed the Codex account's address. In the panel the mask covered #view-agents only, and the picker (#pop), menus and dialogs sit outside it, at the body. The panel now masks the whole body, as its comment already said. The window masks Routing and Usage as before. Its picker names no account, so it needs no change. Every picker shares this one #pop and #list, so this covers every agent's picker in the panel. The TUI has no Hide accounts setting. Run, at8b84dc902in its own worktree: - account-mask.test.cjs: a picker row holding an address, its text and its tooltip, is masked and comes back on unmask. chromium+webkit, en+zh: 4/4 pass. With the app.js change reverted it is 4/4 red. - Every GUI file that opens the panel or masks (226 files, 3441 tests, chromium+webkit, every language): 13 red under load (avg ~130-250). Rerun one file at a time, 4 files stay red, and they are red the same way on origin/main63be47717: provider-advanced-fold (#2552), usage-fold (#2163), model-id-space (#2536) and rest-try-now (filed now as #2564). None of them uses the panel's mask. - Go: gofmt -l clean; go vet -tags nogui on darwin, linux and windows ok. For the full go test -timeout 45m ./... run, see the next commit.
This commit is contained in:
@@ -23354,8 +23354,10 @@ window.noteAccounts = noteAccounts;
|
||||
let masked = false, chosen = null;
|
||||
try { chosen = localStorage.getItem("magpie.maskEmails"); masked = chosen === "1"; } catch {}
|
||||
// the pages it hides on: Routing's and Usage's, each with its button; in
|
||||
// the tray panel, the whole of it, as the window's setting says
|
||||
const targets = mode === "panel" ? [["#view-agents", null]] : [["#view-routing", "#rtMask"], ["#view-usage", "#usageMask"]];
|
||||
// the tray panel, the whole of it, as the window's setting says: its
|
||||
// model picker, menus and dialogs too, which sit outside its view (PaulT
|
||||
// on Discord: a Codex account's address in the picker stayed in sight)
|
||||
const targets = mode === "panel" ? [["body", null]] : [["#view-routing", "#rtMask"], ["#view-usage", "#usageMask"]];
|
||||
const pages = targets.map(([v, b]) => {
|
||||
const view = $(v), btn = b && $(b);
|
||||
if (!view) return () => {};
|
||||
|
||||
@@ -122,9 +122,23 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
await panel.waitForFunction(() => [...document.querySelectorAll("#panelQuota .pq-user .pii")].some((e) => e.dataset.raw === "李雷"));
|
||||
const pq = await panel.evaluate(() => [...document.querySelectorAll("#panelQuota .pq-card")].map((c) => ({ text: c.querySelector(".pq-user").textContent, title: c.title })));
|
||||
for (const c of pq) assert.ok(!/李雷|138\*|dev\.one|Lee\b/.test(c.text + c.title), JSON.stringify(c));
|
||||
// and its model picker, which sits outside the panel's view: a Codex
|
||||
// account's address beside its model (PaulT on Discord)
|
||||
await panel.evaluate(() => {
|
||||
const li = document.createElement("li");
|
||||
li.id = "pickRow";
|
||||
li.textContent = "GPT-6-Astra via magpie dev.one@example.com";
|
||||
li.title = "dev.one@example.com";
|
||||
document.querySelector("#pop #list").append(li);
|
||||
});
|
||||
await panel.waitForFunction(() => document.querySelector("#pickRow .pii")?.dataset.raw === "dev.one@example.com");
|
||||
const row = await panel.evaluate(() => ({ text: document.querySelector("#pickRow").textContent, title: document.querySelector("#pickRow").title }));
|
||||
assert.ok(!/dev\.one/.test(row.text + row.title), JSON.stringify(row));
|
||||
await btn.click();
|
||||
assert.equal((await btn.textContent()).trim(), w.hide);
|
||||
await panel.waitForFunction(() => !document.querySelector("#panelQuota .pii"));
|
||||
await panel.waitForFunction(() => !document.querySelector("#pickRow .pii"));
|
||||
assert.equal(await panel.locator("#pickRow").textContent(), "GPT-6-Astra via magpie dev.one@example.com");
|
||||
assert.ok(await panel.evaluate(() => [...document.querySelectorAll("#panelQuota .pq-user")].some((e) => e.textContent === "李雷")));
|
||||
// and back as they were in the window
|
||||
assert.equal(await page.locator("#sample").textContent(), "李雷 checked in · Sleeper Lee · ZCode");
|
||||
|
||||
Reference in New Issue
Block a user