F3 SLICE-3/4 review fixes: counted self-writes, persist deletion-to-empty, render all visible editors (#6)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -88,4 +88,22 @@ describe("CoauthorStore", () => {
|
||||
});
|
||||
expect(Object.keys(store.load("d.md")!.anchors)).toEqual([]);
|
||||
});
|
||||
|
||||
it("consumeSelfWrite counts multiple writes to the same sidecar (double-save suppression)", () => {
|
||||
const store = new CoauthorStore(root);
|
||||
store.update("d.md", (a) => {
|
||||
a.anchors["a_t"] = { fingerprint: { text: "t", before: "", after: "", lineHint: 0 } };
|
||||
a.threads.push({ id: "t1", anchorId: "a_t", status: "open", messages: [] });
|
||||
});
|
||||
store.update("d.md", (a) => {
|
||||
a.attributions.push({
|
||||
id: "at1", anchorId: "a_t", author: { kind: "human", id: "ben" },
|
||||
createdAt: "2026-06-10T00:00:00.000Z", updatedAt: "2026-06-10T00:00:00.000Z",
|
||||
});
|
||||
});
|
||||
const p = store.sidecarPath("d.md");
|
||||
expect(store.consumeSelfWrite(p)).toBe(true);
|
||||
expect(store.consumeSelfWrite(p)).toBe(true);
|
||||
expect(store.consumeSelfWrite(p)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user