In the new design of comment section, 2nd level comments are bundled together based on reply relationships.
We can view the newly added structure as sections within subthreads, or as subthreads of subthreads that are flattened into the same level (level 3 flattened into level 2).
The structure on the left has subthreads with section, so subthreads are lists of comment list. It is more similar with the UI layout.
The structure on the right is fractal, with subthreads having their subthreads. It is more similar with the actually relationship of comments, which is a directed acyclic graph.
With the mental model on the right, we won't need to update our API, since Comment type has comments field. But we need to either resolve in API all remaining comments at level 3, or recursively call child comments of comments on frontend util no more comments are returned.
They both have pros and cons, but I think the right one is more concise and closer to the actual relationship of data.
In the new design of comment section, 2nd level comments are bundled together based on reply relationships.
We can view the newly added structure as sections within subthreads, or as subthreads of subthreads that are flattened into the same level (level 3 flattened into level 2).
The structure on the left has subthreads with section, so subthreads are lists of comment list. It is more similar with the UI layout.
The structure on the right is fractal, with subthreads having their subthreads. It is more similar with the actually relationship of comments, which is a directed acyclic graph.
With the mental model on the right, we won't need to update our API, since
Comment
type hascomments
field. But we need to either resolve in API all remaining comments at level 3, or recursively call child comments of comments on frontend util no more comments are returned.They both have pros and cons, but I think the right one is more concise and closer to the actual relationship of data.