mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-04 04:29:01 +01:00
fix(notifications): stop toasting "changed the title" on task updates
Title edits are routine (often automatic agent titling) and produced noisy "<actor> changed the title" toasts. The server no longer projects titleChanged into toast details, and the UI no longer describes title changes, so a title-only update produces no toast. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7e025ae65f
commit
d5daf1eb05
5 files changed
+16
-4
No files matched your search
@@ -337,7 +337,7 @@ describe("authenticated activity notifications", () => {
|
||||
} });
|
||||
await third;
|
||||
expect(messages[2].payload.taskIdentityChanged).toBe(true);
|
||||
expect(messages[2].payload.notificationDetails).toEqual({ titleChanged: true });
|
||||
expect(messages[2].payload.notificationDetails).toEqual({});
|
||||
if (deploymentMode === "authenticated") expect(JSON.stringify(messages[2].payload)).not.toContain("Secret new title");
|
||||
} finally {
|
||||
socket.terminate();
|
||||
|
||||
@@ -30,9 +30,14 @@ describe("task notification details", () => {
|
||||
|
||||
it("supports older activity without change receipts and rejects unknown enum values", () => {
|
||||
expect(activityToastDetails("issue.updated", { status: "blocked", assigneeAgentId: null, title: "New name" }))
|
||||
.toEqual({ status: "blocked", assignment: "unassigned", titleChanged: true });
|
||||
.toEqual({ status: "blocked", assignment: "unassigned" });
|
||||
expect(activityToastDetails("issue.updated", { status: "private text", priority: "private text", executionRunId: "run-private-id" })).toEqual({});
|
||||
expect(activityToastDetails("issue.updated", { status: "done", changes: {} })).toEqual({});
|
||||
expect(activityToastDetails("issue.updated", null)).toEqual({});
|
||||
});
|
||||
|
||||
it("does not announce title changes", () => {
|
||||
expect(activityToastDetails("issue.updated", { changes: { title: { from: "Old", to: "New" } } })).toEqual({});
|
||||
expect(activityToastDetails("issue.updated", { title: "New name" })).toEqual({});
|
||||
});
|
||||
});
|
||||
@@ -36,7 +36,7 @@ export function activityToastDetails(action: unknown, value: unknown): Record<st
|
||||
const assigned = ["assigneeAgentId", "assigneeUserId"].some(key => typeof next(key) === "string");
|
||||
result.assignment = assigned ? "reassigned" : "unassigned";
|
||||
}
|
||||
if (changed("title")) result.titleChanged = true;
|
||||
// Title edits are routine (often automatic agent titling), so they are never announced.
|
||||
if (changed("description")) result.descriptionChanged = true;
|
||||
return result;
|
||||
}
|
||||
@@ -2475,6 +2475,13 @@ describe("activity toast attribution", () => {
|
||||
expect(build(new QueryClient(), "company", { ...payload, action: "issue.updated", notificationDetails: details }, viewer)).toBeNull();
|
||||
}
|
||||
});
|
||||
it("does not announce title changes", () => {
|
||||
for (const details of [{ titleChanged: true }, { title: "Renamed task" }]) {
|
||||
expect(build(new QueryClient(), "company", { ...payload, action: "issue.updated", notificationDetails: details }, viewer)).toBeNull();
|
||||
}
|
||||
const toast = build(new QueryClient(), "company", { ...payload, action: "issue.updated", notificationDetails: { titleChanged: true, priority: "high" } }, viewer);
|
||||
expect(toast?.body).toBe("Alex Example set priority to high");
|
||||
});
|
||||
it("does not fall back to raw details when the server projected an empty update", () => {
|
||||
expect(build(new QueryClient(), "company", { ...payload, action: "issue.updated", notificationDetails: {}, details: { status: "done" } }, viewer)).toBeNull();
|
||||
});
|
||||
|
||||
@@ -1206,7 +1206,7 @@ function describeIssueUpdate(
|
||||
} else if (details.assignment === "unassigned" || details.assigneeAgentId === null || details.assigneeUserId === null) {
|
||||
changes.push("unassigned the task");
|
||||
}
|
||||
if (details.titleChanged === true || typeof details.title === "string") changes.push("changed the title");
|
||||
// Title edits are routine (often automatic agent titling), so they never toast on their own.
|
||||
if (details.descriptionChanged === true || typeof details.description === "string") changes.push("changed the description");
|
||||
return changes.length > 0 ? changes.join(", ") : null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user