Staged inline review comments vanish from the diff — only the staged count increments; they must render in-thread at their line #567
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub#567
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What's requested
Staging an inline review comment on the PR conversation diff currently makes the comment disappear: the composer closes, nothing renders in its place, and the only feedback is the staged-count increment on the "Finish review (N staged)" button plus the list inside the FinishReview form. A staged comment must remain visible at its anchor line — in-thread, in place — until the review is submitted.
Evidence (static diagnosis — no local repro, per standing rule)
web/src/pages/Pull.jsxDiffFile(getDrafts, line 355; keys${hunkIdx}:${rowIdx}— Forgejo #560). On submit the composer hands the draft to the page and immediately closes itself:props.onStage({ anchor: d().anchor, body })followed bycloseDraft(draftKey(hi(), ri()))(Pull.jsx:504-507). Deleting the Map entry unmounts the only thing rendered under that row — the composer card is<Show when={... draftAt(hi(), ri())}>(Pull.jsx:494-515), so after staging the row shows nothing.getPending(Pull.jsx:822;stageat 885,unstageat 886). The only surfaces that render it are:Finish review (N staged)(Pull.jsx:1029);threadson submit.DiffFile's inline rendering under each row covers only open composers (draftAt) and posted threads (threadsAt→ThreadCard, Pull.jsx:516-518). There is no staged-draft card, so the comment is invisible at its line from stage until review submit.Proposed fix
ml-14 mt-1 rounded borderinline-card slot thatThreadCardand the composer already use). Do this inside the keyed structure so each staged draft renders at its own line (multiple staged comments per file must all render simultaneously, per #560's keyed-collection model — the staged drafts need their own keyed store parallel togetDrafts, or an equivalent keyed Map entry state).ThreadCard): author, body, plus a visually distinct "staged" chip that distinguishes it from posted comments (apilllike the existingresolved/outdatedpills, in both themes). Plain-text body is fine at first (FinishReview already rendersp.bodyplain — keep the two consistent).remove(same pending-list mutation).ThreadIndex, Pull.jsx:618): index entries for staged comments link to the inline staged card (scroll + flash, thethread-<tid>/flashTididiom), so a reviewer can jump to their own staged comments. Staged comments must be listed in the index alongside posted threads, marked staged.Consistency requirements
DiffFile— the fix should live in the shared seam, not be PR-page-only, or be applied to each renderer).Acceptance criteria
node --test web/test/unit/, per the #560inline-composer-560.test.jsconvention): stage → inline render, edit round-trip, multi-instance.Related
Fixed by #570 (merged): staged inline comments now render as in-thread StagedCards at their anchor line (ThreadCard idiom, staged pill) until submit, with edit round-trip + unstage sharing the one pending-list source of truth, and ThreadIndex listing/linking staged entries. Review also fixed two defects pre-merge: invisible .link controls (the #566 pattern) and same-line re-edit staleness. Verified: 1374 unit tests green (smoke excluded, pre-existing), vite/esbuild green, independent review APPROVED.