Filter goal refreshes by conversation note

This commit is contained in:
kris
2026-04-07 17:29:42 +08:00
parent 8fc94f1849
commit b06b084438
4 changed files with 64 additions and 13 deletions

View File

@@ -14,7 +14,21 @@ test("RealtimeRefresh supports project-scoped refresh filtering", async () => {
const source = await readWorkspaceFile("src/components/app-runtime.tsx");
assert.match(source, /projectId\?: string/, "expected RealtimeRefresh to accept an optional projectId");
assert.match(source, /payload\.projectId === projectId/, "expected RealtimeRefresh to filter by matching projectId");
assert.match(
source,
/conversationUpdatedNotes\?: string\[]/,
"expected RealtimeRefresh to accept optional conversationUpdatedNotes",
);
assert.match(
source,
/payload\.projectId !== projectId[\s\S]*return false/,
"expected RealtimeRefresh to filter by matching projectId",
);
assert.match(
source,
/payload\.note\)\s*&&\s*!conversationUpdatedNotes\.includes\(payload\.note\)/,
"expected RealtimeRefresh to ignore unmatched conversation.updated notes",
);
});
test("project conversation pages wire project-scoped realtime refresh", async () => {
@@ -36,4 +50,15 @@ test("project conversation pages wire project-scoped realtime refresh", async ()
assert.match(source, /projectId=\{projectId\}/, `expected ${label} page to scope refreshes to the current project`);
assert.match(source, /"conversation\.updated"/, `expected ${label} page to listen to conversation updates`);
}
assert.match(
goalsPage,
/conversationUpdatedNotes=\{\["project_goals\.updated"\]\}/,
"expected goals page to refresh only on project goal markers",
);
assert.match(
versionsPage,
/conversationUpdatedNotes=\{\["project_goals\.updated"\]\}/,
"expected versions page to refresh only on project goal markers",
);
});