See the discussion on a document
A reader wants to see whether a document is being discussed and scan its threads, so they can decide what is worth opening.

As a reader, I want to see how much discussion a document has and scan its threads, so that I can tell what people think of it and open the conversation that matters to me.

Situation

I am reading a document in the Read tab. I do not need an identity: reading a discussion is open to everyone. I want a glance at the conversation without the page turning into a comment feed.

What I do

    Open a document and look at the line under its byline.

    Scroll to the end of the document, to the part headed "Discussion".

    Read the first threads shown there.

    Tap "See all 36 threads", the comment count under the byline, or the discussion button in the top bar.

    Scroll All comments and pull down to refresh.

What I should see

    When the document has comments, a teal line under the byline reads "1 comment" or "49 comments" and opens All comments.

    The discussion button in the top bar opens All comments whether or not there are comments.

    Under the document, the heading "Discussion" is followed by the same count, for example "49 comments".

    Up to three threads are shown, the one with the newest activity first.

    Each thread shows the author's picture and name, when it was written, the comment text, and "1 reply" or "3 replies" when it has replies.

    When there are more than three threads, a link reads "See all 36 threads".

    A document with no comments says "No comments yet. Start the conversation."

    The "Add a comment" button is always present under the discussion.

    All comments is titled with the count ("49 comments"), or "Discussion" when there are none or the count is not known yet.

    All comments lists every thread, newest activity first, with a thin line between threads.

    Tapping a thread, in either place, opens it.

    Pulling down on All comments reloads the discussion.

When something goes wrong

    If the comments cannot be loaded, the discussion shows one grey sentence in place of the threads, for example "Couldn't reach the server." or "Couldn't load the discussion." The document itself stays readable. There is no Retry button here: I pull down on the document, or on All comments, to ask again.

Not included

    No Retry button on a failed discussion, under the document or in All comments (DiscussSection, All comments).

    I cannot start a comment from All comments; "Add a comment" is only under the document.

    A long comment is shown in full in the list; it is not shortened.

    No sorting, filtering or search of comments, and no comments attached to a single paragraph. See Current limits.

Trace

Story US-DISC-01, status Shipped. These links are kept in step with the traceability matrix and with the "User stories" section of every page listed here.

Design

Page

Part it plays

Document and site home

Where the discussion appears: the bar button, the count under the byline, the section at the end

All comments

The pushed list of every thread on the document

DocDiscussionSlot

The place in the document where the discussion section is drawn

DiscussSection

Heading, count, first three threads, "See all" and "Add a comment"

DiscussThreadRow

One thread as a tappable row with its reply count

DiscussBubble

The root comment inside each row: face, name, time, text

CommentCount

The comment count shown on document rows and cards

Document header and byline

The byline area that carries the brand "N comments" line

Avatar

Author faces in the rows

list and section

The plain refreshable list of All comments

link

Rows and "See all" are links that push screens

progress

The "Loading comments" spinner

Loading, failure and empty states

Loading, failure and empty rules the section follows and where it falls short

States for every screen

The state table for the document discussion and All comments

Lists

Why the thread list is painted and not inset-grouped

Refresh, haptics and progress

Pull to refresh

Navigation bars and their actions

The discussion button in the document bar and the count title

Reading another site in place

Comments follow the site whose document is being read

Reading first

Three threads in place, the rest one tap away

Names, not identifiers

Names and faces lead every row

Representative strings

The exact wording of counts, empty and error lines

Implementation

Page

Part it plays

Discuss: comments

The Discuss package overview

Discuss: screens and components

DiscussSection, DiscussThreadRow and DiscussAllScreen

Discuss: loading and posting

ListComments per document, cache, in-flight dedupe, failures as rows

Discuss: threading logic

summarize: public comments, thread order, reply counts

Discuss: root contract wiring

discussTargets, the discussions resource, the provide block

Read: screens and components

DocScreen: bar button, count line and DocDiscussionSlot

Read: root contract wiring

The reader context server the discussion is asked from

Root declarations: Read and Discuss

The discuss declarations in the root contract

Navigation and routes

The comments route

State, refresh and stale-reply patterns

discussEpoch plus readEpoch drops cached listings on pull to refresh

Seed site read API

The ListComments call

Contract UI tests

The discuss Contract suite against live hyper.media

Bun unit tests

Unit tests for summaries and cache invalidation

Current limits and known gaps

Recorded limits of comments

Code

File

What

discuss.contract L82-120

DiscussSection

discuss.contract L69-80

DiscussThreadRow

discuss.contract L122-150

DiscussAllScreen

read.contract L255-268

DocDiscussionSlot

read.contract L305-308

the discussion button in the document bar

read.contract L335-339

the brand comment count line under the byline

read.contract L113-122

CommentCount

app.contract L107-120

pkg:discuss declarations (discussTargets, discussions)

app.contract L735-742

pkg:discuss provide (discussions and the minute clock)

src/discuss/load.ts L56-104

listComments, normRef, loadDiscussions

src/discuss/logic.ts L165-195

summarize

src/discuss/sources.ts

discussList and the epoch that forgets cached listings

Tests

File

What it checks

discuss.test.contract

discuss: a document with comments shows the summary

discuss.test.contract

discuss: a thread row from the summary opens the thread

src/discuss/__tests__/logic.test.ts

summary: the live hyper.media home count, threads and reply counts; order by latest activity; private comments drop

src/discuss/__tests__/load.test.ts

discussion refresh discards in-flight listings and late old results

Delivery

Delivered by #1470.

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime