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 |
|---|---|
Where the discussion appears: the bar button, the count under the byline, the section at the end | |
The pushed list of every thread on the document | |
The place in the document where the discussion section is drawn | |
Heading, count, first three threads, "See all" and "Add a comment" | |
One thread as a tappable row with its reply count | |
The root comment inside each row: face, name, time, text | |
The comment count shown on document rows and cards | |
The byline area that carries the brand "N comments" line | |
Author faces in the rows | |
The plain refreshable list of All comments | |
Rows and "See all" are links that push screens | |
The "Loading comments" spinner | |
Loading, failure and empty rules the section follows and where it falls short | |
The state table for the document discussion and All comments | |
Why the thread list is painted and not inset-grouped | |
Pull to refresh | |
The discussion button in the document bar and the count title | |
Comments follow the site whose document is being read | |
Three threads in place, the rest one tap away | |
Names and faces lead every row | |
The exact wording of counts, empty and error lines |
Implementation
Page | Part it plays |
|---|---|
The Discuss package overview | |
DiscussSection, DiscussThreadRow and DiscussAllScreen | |
ListComments per document, cache, in-flight dedupe, failures as rows | |
summarize: public comments, thread order, reply counts | |
discussTargets, the discussions resource, the provide block | |
DocScreen: bar button, count line and DocDiscussionSlot | |
The reader context server the discussion is asked from | |
The discuss declarations in the root contract | |
The comments route | |
discussEpoch plus readEpoch drops cached listings on pull to refresh | |
The ListComments call | |
The discuss Contract suite against live hyper.media | |
Unit tests for summaries and cache invalidation | |
Recorded limits of comments |
Code
File | What |
|---|---|
DiscussSection | |
DiscussThreadRow | |
DiscussAllScreen | |
DocDiscussionSlot | |
the discussion button in the document bar | |
the brand comment count line under the byline | |
CommentCount | |
pkg:discuss declarations (discussTargets, discussions) | |
pkg:discuss provide (discussions and the minute clock) | |
listComments, normRef, loadDiscussions | |
summarize | |
discussList and the epoch that forgets cached listings |
Tests
File | What it checks |
|---|---|
discuss: a document with comments shows the summary | |
discuss: a thread row from the summary opens the thread | |
summary: the live hyper.media home count, threads and reply counts; order by latest activity; private comments drop | |
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