@@ -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}`;
@@ -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(/