Skip to content

Render the post permalink as the whole conversation (#1006) - #1026

Merged
wintermeyer merged 1 commit into
mainfrom
worktree-single-post
Jul 23, 2026
Merged

Render the post permalink as the whole conversation (#1006)#1026
wintermeyer merged 1 commit into
mainfrom
worktree-single-post

Conversation

@wintermeyer

Copy link
Copy Markdown
Owner

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_id denormalization that #1010 introduced: Posts.list_thread/3 fetches 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: 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. 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

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
@wintermeyer
wintermeyer merged commit 4b6d708 into main Jul 23, 2026
1 check passed
@wintermeyer
wintermeyer deleted the worktree-single-post branch July 23, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancements: Render post detail pages like threads in feed

1 participant