Repository navigation
fix(app): render replies that live only in YAML endmatter - #145
moiri-gamboni wants to merge 3 commits into
Conversation
A comment rail group is built from the anchor's data-comment-ids, which lists only comments carrying an inline marker. Replies are stored in the endmatter with a `re` pointer and no marker, so they were parsed into the comments map and then filtered out before threading: the reply rendered while it was being composed and disappeared on the next load. Writing a reply through the app's own reply button and reloading reproduces it. Pull each anchored root's descendants back in before building threads.
|
@moiri-gamboni is attempting to deploy a commit to the Lex Team on Vercel. A member of the Team first needs to authorize it. |
The rail fix generalizes: any surface that renders from anchor ids drops replies stored in endmatter, because those ids come from inline markers and an endmatter reply has none. The selection banner reads getSelectionCommentIds, so it had the same hole. Extract the descendant walk as collectAnchoredThreadComments and use it for both, rather than repeating the filter at each call site.
replyToComment anchored the new reply against the id of the card being replied to. An endmatter reply has no inline marker, so the lookup returned null, replyToComment returned early, and clicking Reply on a nested card did nothing at all -- no composer, no error. Walk up to the nearest anchored ancestor for the anchor while keeping the clicked card as the parent, so the reply nests under it rather than being flattened onto the thread root.
|
Pushed two follow-up commits after finding the same root cause on two more surfaces. The original commit fixed the comment rail only, which left the bug half-fixed. Selection banner. Replying to a reply did nothing. Reproduction for the second one, using only the app's own output: reply to any anchored comment through the UI (Roughdraft writes New test in |
Port upstream PR Lex-Inc#145 (7ee81bc, 5483e46, f5048d6) by Moïri Gamboni. Replies stored only in YAML endmatter have no inline anchor, so the rail dropped them and replying to such a reply failed silently. Thread building now pulls an anchored root's descendants in via collectAnchoredThreadComments, and replyToComment walks up to the nearest anchored ancestor for the anchor while keeping the clicked card as the parent. Co-Authored-By: Claude <noreply@anthropic.com>
… bump to 0.1.11-patched.2 Adapts Lex-Inc#149 to a per-watch undici Agent instead of a process-wide singleton: the singleton kept a pooled keep-alive socket to a server that had since restarted, so the next watch in the same process failed with UND_ERR_SOCKET "other side closed". The Agent is now created per watch in both the CLI and the MCP watch tool and closed in a finally. Fixes a pre-existing race in two CLI tests that posted the review event as soon as the watch request had been sent, before the server had registered the waiter; they now poll /api/review-events/status for a watcher first. Documents the new patches, the Lex-Inc#149 adaptation, the merge-conflict notes, and the new "handoff after watcher lost" state in the screenshot guide. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…y in YAML endmatter From Lex-Inc#145, unmerged upstream as of 2026-10-31. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LXZP8LMTVHbkEsmdNZzjyf
Problem
A reply stored in YAML endmatter is written to the file and then never shown. The reviewer types a reply, it appears while the composer is open, and it is gone on the next load — so from the user's side the reply simply vanished.
This is reproducible with Roughdraft's own output, which is what makes it more than a formatting nit:
{#c1}.c2: {body, by, at, re: c1}into the endmatter, with no inline marker — the shape the README and the RFM spec both document for replies.The server agrees the reply is real:
GET /api/review-indexreturns it withkind: "reply"and the correctparentId. Only the rail drops it.Root cause
buildCommentThreadRailItemsbuilds each rail group fromgroup.commentIds, which comes from the anchor element'sdata-comment-ids. That attribute only lists comments carrying an inline marker.Endmatter replies have no inline marker by design, so although
addEndmatterFeedbackparses them into the comments map with the rightparentCommentId, they are filtered out ofvisibleCommentsbeforebuildCommentThreadsever runs. The thread is built from the root alone and the reply is discarded.This looks like an incomplete part of #91, whose description says the review rail "now handles unanchored comments, replies, and suggestion metadata in the endmatter-backed format".
Likely the same root cause as #87, which reports it as a bullet-list rendering problem: "I added a comment which was rendering fine, but then when the model made a reply to that comment, it stopped rendering as a comment in the sidebar." The list is incidental; the reply is the trigger.
Fix
Before building threads, pull each anchored root's descendants back in from the comments map, using the existing
getCommentDescendantIdshelper. Comments already present in the group are skipped, so inline replies are not duplicated, and a group with no anchored roots is unaffected.Tests
packages/app/src/document-comments.test.ts(new): parses a document whose only reply lives in the endmatter and asserts the rail item contains bothc1andc2, plus a second case asserting no duplication when the reply is also anchored inline. The first test fails onmainand passes with the fix.pnpm test— 377 passed.pnpm lintclean.Scope
App-side only, and independent of the open
runWatchtimeout PRs (#121, #122, #126, #139, #144) — no overlapping files.