summaryrefslogtreecommitdiff
path: root/internal/api/model
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-07-13 12:26:16 +0200
committerLibravatar GitHub <noreply@github.com>2024-07-13 12:26:16 +0200
commitc83e96b8a740a44f565068d06c4f12eef486b7e5 (patch)
treea49ff113cb373953dfbe85e3406971a4d1a6779b /internal/api/model
parent[bugfix] Fix panic in `isStatusHomeTimelineable` (#3096) (diff)
downloadgotosocial-c83e96b8a740a44f565068d06c4f12eef486b7e5.tar.xz
[chore/frontend] Tweak threading a bit, inform about hidden replies (#3097)
* [chore/frontend] Tweak threading a bit, inform about hidden replies * whoops * round off bottom of replies col-header if no replies visible
Diffstat (limited to 'internal/api/model')
-rw-r--r--internal/api/model/status.go13
-rw-r--r--internal/api/model/statuscontext.go17
2 files changed, 20 insertions, 10 deletions
diff --git a/internal/api/model/status.go b/internal/api/model/status.go
index 00be868f1..a9c668565 100644
--- a/internal/api/model/status.go
+++ b/internal/api/model/status.go
@@ -126,8 +126,17 @@ type WebStatus struct {
// display this status in the web view.
Indent int
- // This status is the first status after
- // the "main" thread, so it and everything
+ // This status is the last visible status
+ // in the main thread, so everything below
+ // can be considered "replies".
+ ThreadLastMain bool
+
+ // This status is the one around which
+ // the thread context was constructed.
+ ThreadContextStatus bool
+
+ // This status is the first visibile status
+ // after the "main" thread, so it and everything
// below it can be considered "replies".
ThreadFirstReply bool
}
diff --git a/internal/api/model/statuscontext.go b/internal/api/model/statuscontext.go
index 205672dc8..f2519c0a3 100644
--- a/internal/api/model/statuscontext.go
+++ b/internal/api/model/statuscontext.go
@@ -29,15 +29,16 @@ type ThreadContext struct {
}
type WebThreadContext struct {
- // Parents in the thread.
- Ancestors []*WebStatus `json:"ancestors"`
-
- // Children in the thread.
- Descendants []*WebStatus `json:"descendants"`
+ // Status around which this
+ // thread ctx was constructed.
+ Status *WebStatus
- // The status around which the ancestors
- // + descendants context was constructed.
- Status *WebStatus `json:"-"`
+ // Ordered slice of statuses
+ // for rendering in template.
+ //
+ // Includes ancestors, target
+ // status, and descendants.
+ Statuses []*WebStatus
// Total length of
// the main thread.