From 40da0e24f6d9e5befcfaaaa0bd9f44b313e0ebab Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Sun, 1 Nov 2026 11:01:18 -0600 Subject: [PATCH] =?UTF-8?q?fix(aggregator):=20author=20pickers=20on=20dema?= =?UTF-8?q?nd=20=E2=80=94=20/program=2044=20MB=20->=20~0.7=20MB,=20/board?= =?UTF-8?q?=2012.9=20MB=20(#1179)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every card on the list pages inlined a full author picker: 5 standing identities plus one `, ) .join(""); +} + +export function commentFormHtml(objectRef: string, opts: CommentFormOpts): string { + const ghRefs = opts.githubRefs ?? []; + const authorOptions = authorOptionsHtml(opts.identities); const ghTarget = ghRefs.length ? `` : ""; @@ -711,7 +763,7 @@ export function commentFormHtml(objectRef: string, opts: CommentFormOpts): strin ? `` : ""; return `
- +
@@ -896,18 +948,13 @@ export function cardCommentHtml( const list = comments?.length ? comments.map((c) => dashCommentHtml(c)).join("") : `

No comments on this card yet.

`; - const authorOptions = opts.identities - .map( - (i) => - ``, - ) - .join(""); + const authorOptions = authorOptionsHtml(opts.identities); const ghBox = ghRef ? `` : `No GitHub issue on this card — the comment stays internal.`; return `
💬 Comments for the orchestrator${comments?.length ? ` (${comments.length})` : ""}${list} - +
${ghBox}
`; @@ -976,13 +1023,7 @@ export function quickBarHtml(objectRef: string, tier: "needs-drew" | "needs-orch } function authorSelectHtml(identities: AuthorIdentity[]): string { - const options = identities - .map( - (i) => - ``, - ) - .join(""); - return `
`; + return `
`; } interface AFormSpec { diff --git a/pm-stack/aggregator/src/server.ts b/pm-stack/aggregator/src/server.ts index 8e00564e68..31aec37400 100644 --- a/pm-stack/aggregator/src/server.ts +++ b/pm-stack/aggregator/src/server.ts @@ -497,6 +497,14 @@ async function handler(req: Request): Promise { const prov = () => source.provenance(); const provDetail = () => source.provenanceDetail?.(); + // --- Author identities for the on-demand picker (#1179) ------------------ + // List pages render author pickers with the standing identities only; + // the full standing + per-session list is fetched once, on first use. + if (req.method === "GET" && path === "/api/author-identities") { + const records = await source.registry().catch(() => []); + return json({ identities: identitiesFromRecords(records) }); + } + // --- Dashboard comment writes (#906 §2) -------------------------------- if (req.method === "POST" && path === "/api/comments") { try { diff --git a/pm-stack/aggregator/test/author-picker-1179.test.ts b/pm-stack/aggregator/test/author-picker-1179.test.ts new file mode 100644 index 0000000000..bdfb49f697 --- /dev/null +++ b/pm-stack/aggregator/test/author-picker-1179.test.ts @@ -0,0 +1,133 @@ +import { afterAll, beforeAll, describe, expect, test } from "bun:test"; +import { spawn, type Subprocess } from "bun"; +import { mkdtemp } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { authorOptionsHtml, cardCommentHtml, commentFormHtml, statusRequestHtml } from "../src/render.ts"; +import { STANDING_IDENTITIES, type AuthorIdentity } from "../src/registry.ts"; +import { FIXTURE_REGISTRY } from "../src/sources/fixtures.ts"; + +// #1179: list pages were quadratic in the session-registry size -- +// every card's author picker inlined one '); + expect(html).toContain("Muse"); + expect(html).toContain("Orchestrator (orchestration-pass) (agent)"); + expect(html).not.toContain("ses_fake"); + expect(html.match(/