Render the post permalink as the whole conversation (#1006) - #1026
Merged
Conversation
Fixes #1006. A single post's page used to show only the post plus one level of direct replies: no root, no ancestors, no siblings, no nested answers. Following a long, branching conversation meant clicking from permalink to permalink. Now every permalink renders the whole thread the way the feed does: the root on top, every visible reply below in chronological order with the connector lines, the permalinked post as the tinted full-mode card, auto-scrolled into view when it has context above it. The data side rides the root_post_id denormalization that PR #1010 just introduced for thread notifications: Posts.list_thread/3 fetches root plus thread in one indexed query (capped at 200), and always unions the permalinked post, its surviving ancestor chain and its direct replies back in - which doubles as the degraded floor once a deleted root has nilified the thread's root links. The chain stays chronological rather than a tree; a reply that does not answer the card directly above it keeps its "Replying to @handle" banner, so branch points read correctly. The agent-format siblings mirror the page: PostDoc gains thread (each entry with its parent pointer) and thread_truncated, and the md/txt renderers replace the one-level Replies section with a Conversation section. The one-level replies/reply_count keys stay for API consumers. An AI agent wrote this text in my name, unreviewed by me. The work behind it is mine; I only delegated the writing. Claude-Session: https://claude.ai/code/session_01S56Mxazh7zDJfk7uEQgpPa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1006.
A post's permalink used to show only the post itself plus one level of direct replies, so following a long, branching conversation meant hopping from permalink to permalink. Now every permalink renders the whole thread the way the feed does: the root on top, every visible reply below in chronological order with connector lines, the permalinked post highlighted as a tinted full-mode card and auto-scrolled into view when it has context above it. A reply that does not answer the card directly above it keeps its "Replying to @handle" banner, which is how branch points stay readable in the linear chain.
Under the hood this builds on the
root_post_iddenormalization that #1010 introduced:Posts.list_thread/3fetches the root plus the whole thread in one indexed query (capped at 200, with a note when cut), and always unions the permalinked post, its surviving ancestor chain and its direct replies back in. That union doubles as the degraded floor once a deleted root has nilified the thread's root links.The agent-format siblings mirror the page:
PostDocgainsthread(each entry with its parent pointer) andthread_truncated, and the md/txt renderers replace the one-level Replies section with a Conversation section. The one-levelreplies/reply_countkeys stay for API consumers. Posts without replies render exactly as before.Tested: new context tests for
list_thread/3(branching, frozen posts, deleted root, cap), controller tests for the conversation page, an extended agent-docs drift test, plus a browser smoke test (rendering, highlight, auto-scroll, live action bars, German render, md/txt/json/xml siblings).An AI agent wrote this text in my name, unreviewed by me. The work behind it is mine; I only delegated the writing.
https://claude.ai/code/session_01S56Mxazh7zDJfk7uEQgpPa