Jonny · @jonny
590 followers · 1573 posts · Server neuromatch.social

: desired behavior

  • Self replies to OP are shown first, in series, sorted by time posted ascending to preserve threads
  • Self replies do not increment tree depth
  • Posts that are a single child of a parent post do not increment tree depth
  • Tree depth has maximum display depth to not bump everything off the screen, to see greater depth select a deeper post
  • Trees can be collapsed/expanded
  • ... what else

#nestedthreads

Last updated 2 years ago

Jonny · @jonny
514 followers · 1101 posts · Server neuromatch.social

@NicoleCRust I'm gonna make a better threaded interface for our instance after I finish moving :)

#nestedthreads

Last updated 2 years ago

Jonny · @jonny
443 followers · 728 posts · Server neuromatch.social

@jdp23 @liamsora @kichae @futurebird @stopthatgirl7
it certainly doesn't address the problem fully, but I'll be merging this into neuromatch.social to test soon enough: github.com/NeuromatchAcademy/m

It's relatively simple patch that's entirely frontend so hopefully easy to deploy on smaller instances.

Makes a button that lets you request the replies to a given post so you can see them even if no one on your instance follows the poster (ie. your instance wouldn't know about the post because of the pub/sub issues described above).

It works by using the search feature to fetch posts (as @liamsora also discovered):

  • Ask OP server for the context that it knows about, replies and ancestors
  • Submits the URLs for each of the replies to the search endpoint
  • Inserts posts as they are received into the redux store -> into the React component displaying the thread

It currently inserts them in a disordered way because the React component holding a thread is a single-layer component that holds expanded post & ancestors & replies. that's also related to why a thread is completely unreadable (imo) because it's rendered as a flat list rather than as a tree - which is what a thread is. Will be working on making a properly recursive component next.

Once that's done, then it should be possible to iteratively request replies in a smarter way, but that will also require another change in the way the /context endpoint works, which currently takes no arguments for subsetting and has no pagination - so therefore has relatively low hardcoded limits on the amount of replies you can request without being logged in. That will need to change to be able to request a certain depth (currently it gets the entire reply tree and then flattens it into an array) and paginate through results so that eg. you can get all the top-level replies to the request you have open, and then as you open deeper replies you get the replies to that reply, and so on....

(sorry for wall of text sort of got away from me.)

#fetchallreplies #nestedthreads #contextapi #mastodev

Last updated 2 years ago

Jonny · @jonny
395 followers · 504 posts · Server neuromatch.social

OK i'm waiting for a phone call and have a few minutes so let me puzzle about what it would take to make a interface for rather than a flat list of replies until they call me...

#nestedthreads #glitchsoc #mastodev #mastoux

Last updated 2 years ago