Inline thread comments render newest-first, putting the newest reply farthest from the reply textbox #597
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#597
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?
Inline review-thread comments render in wire order (newest-first), so the newest reply appears at the TOP of the thread card — farthest from the reply textbox at the bottom. Chat-style reading (and the app's own established convention) requires oldest at top, newest last, so the newest response sits immediately above the reply box.
What's requested
Thread comments in inline thread cards must render chronologically (oldest first, newest last), consistent with the chronological thread rendering the issue page already standardizes (#225).
Evidence (static code reading; no local reproduction per standing rule)
GET …/pulls/{num}/threads/{tid}deliberately returns comments newest-first —internal/review/threads.go:200-250(GetThreadwalksscanThreadComments' seq-ascending list in reverse; header comment at line 201 says "comments newest-first, after = exclusive upper bound"). This is the #225/#146 wire design and must not change.ThreadCommentsinweb/src/pages/Pull.jsx:915-932rendersgetView()?.commentsin raw wire order inside<For each={getView()?.comments ?? []}>. A thread card therefore shows reply #1 at the bottom and the newest reply at the top, directly above nothing useful — the reply<form>(Pull.jsx:816-821) sits below the list, so the newest response is maximally far from where the user types.web/src/lib/thread-order.js(chronological(), stable ascending-by-seq sort, headless-tested, issue #225) with the documented rule "wire stays newest-first … the render sorts by seq" (docs/features/02_issues.md:518-519,docs/features/08_ui_sdk.md:60).ThreadCommentsnever consumes it.Architecture notes
chronologicalfromweb/src/lib/thread-order.jsin Pull.jsx and renderchronological(getView()?.comments)inThreadComments'<For>. Do not re-implement a sort inline — the helper exists precisely so every surface agrees (also see the skill's note that a stale cache window or SSE refetch can never show wire order).Seqis present on everyThreadComment(internal/review/model.go:128-129, kindreview_thread_comment), so the sort key is always available.more: true(server caps n at 200, default 50), the returned window is the newest n comments; reversing that window yields correct chronological order within the window. If inline cards ever grow an "older comments" pager, it must follow theappendOlderWindow+chronologicalassembly pattern from thread-order.js rather than naive concatenation. Current UI loads a single window, so reversing is sufficient today.ThreadCommentsis the ONLY consumer ofpulls.threads.get().commentsin the SPA (verified by grep overweb/src);PullFiles.jsxonly creates threads. If a second surface for thread comments exists by the time this lands, it must consume the samechronological()helper — that is the consistency requirement.Acceptance criteria
chronological()fromweb/src/lib/thread-order.js; no duplicated sort logic.more: truewindow case and missing-seqfallback behavior.Fixed by #604 (merged): ThreadComments renders chronological(comments) via the shared #225 helper (non-mutating, wire untouched, single-consumer verified); newest reply now sits adjacent above the reply input. Verified: 15/15 new + 1510 full-minus-smoke green, vite/esbuild green, independent review APPROVE.