Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add collapsable threads and tweak "thread replies" appearance #7488

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

vcarl
Copy link

@vcarl vcarl commented Jan 18, 2025

"Thread view" for replies hasn't quite hit the mark for me — there's a lot of vertical screenspace reserved for controls and link embeds, which leaves room for improvement in my eyes on "skimmability". If I'm reading the replies, I'm usually looking for broad-strokes.

This makes a couple of changes:

  • Moves controls (like/repost/reply/menu) to the side of thread replies
  • Tightens margins to compensate for reduced horizontal space
  • Never collapses text under "shor more" links
  • Never shows embeds for thread replies
  • Adds a long-press interaction on any thread reply to collapse that post and all descendents

I'm opening this as a draft PR because there are some bugs I want to sort out before calling it fully ready, specifically

  • Linear view collapses as well, which was not my intention
  • "never collapse text" is not scoped to only thread view, which was my intention.

Here's a before/after comparison See later comment for updated screenshot

And here's a recording of the collapse experience

Screen.Recording.2025-01-18.at.4.46.43.PM.mov

Comment on lines +263 to +270
for (let val of skeleton.replies) {
if (!isThreadPost(val)) continue
if (collapsedCIDs.has(val.post.cid) || set.has(val.post.cid)) {
val.replies?.forEach(r => {
isThreadPost(r) && set.add(r.post.cid)
})
}
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This traverses the tree of posts any time a post is collapsed, which may not be efficient enough in production

@vcarl
Copy link
Author

vcarl commented Jan 19, 2025

Updated to tighten up some details, like de-emphasizing the post meta when collapsed (and removing the link+hovercard so the only interaction is "expand"). Not gonna lie, I'm addicted to this experience already, I find it a massive improvement for my own usage
Screenshot 2025-01-18 at 10 22 23 PM

@vcarl vcarl marked this pull request as ready for review January 19, 2025 03:24
@futurGH
Copy link
Contributor

futurGH commented Jan 19, 2025

Might be easier to get this merged if you split the thread collapsing and actions rework into separate PRs

@vcarl
Copy link
Author

vcarl commented Jan 19, 2025

That's fair, but I do like how it currently preserves positioning of the controls between states, as a bonus on top of the additional post density. Can appreciate others may not see the density as an advantage, happy to split if it becomes a point of debate

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.

2 participants