F10 #31: render resolved proposals inline at their anchor block
In the F10 review preview, renderReview now emits each pending proposal whose anchor resolves as a cw-proposal block immediately after the current-side block its anchorStart falls in — answering "what is Claude proposing, and where?" by position — instead of appending all proposals as trailing blocks. Proposals in the same block are ordered by anchorStart then id (deterministic, INV-33); a proposal whose anchor doesn't resolve (or precedes all blocks) still trails as a cw-proposal-unanchored block, never dropped (INV-34). This implements the inline-at-anchor placement the graduated F10 Solution Design already specified (coauthoring-interactive-review.md §2/§6.2); the trailing-block behavior shipped in #29 was a recorded v1 deferral. Unit: mid-document placement, two proposals in distinct blocks, same-block ordering determinism, anchored-before-trailing, mixed-set determinism. E2E: the F10 propose test now asserts the proposal renders before the following block (in place); accept still lands + clears. 194 unit + 51 E2E green; typecheck clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -104,6 +104,11 @@ suite("F10 interactive review (host E2E — preview is the single review surface
|
||||
const html = api.trackChangesPreviewController.renderHtmlFor(key);
|
||||
assert.ok(html.includes(`data-proposal-id="${id}"`), "the preview renders the proposal block by id");
|
||||
assert.match(html, /class="cw-actions"/, "the proposal block carries ✓/✗ actions");
|
||||
// #31: the proposal renders INLINE at its anchor (right after T1's block), not
|
||||
// trailing the whole document — so it appears BEFORE the following T2 block.
|
||||
const pIdx = html.indexOf(`data-proposal-id="${id}"`);
|
||||
const t2Idx = html.indexOf("second claude target");
|
||||
assert.ok(t2Idx >= 0 && pIdx < t2Idx, "the proposal renders in place, before the following block (#31)");
|
||||
// INV-10: proposing never touches the document.
|
||||
assert.ok(doc.getText().includes(T1), "document unchanged by propose");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user