Monorepo for Tangled
0

Configure Feed

Select the types of activity you want to include in your feed.

appview/pages: persist timeline tab preference to cookie

Signed-off-by: oppiliappan <me@oppi.li>

authored by

oppiliappan and committed by
Tangled
(Jul 7, 2026, 4:29 PM +0300) 3fc289e5 34096cef

+26 -3
+2 -2
appview/pages/templates/timeline/fragments/timeline.html
··· 7 7 </h3> 8 8 {{ if .LoggedInUser }} 9 9 <div class="btn-group grid grid-cols-2"> 10 - <a href="/timeline" 11 - hx-get="/timeline" 10 + <a href="/timeline?following=false" 11 + hx-get="/timeline?following=false" 12 12 hx-target="#timeline-feed" 13 13 hx-select="#timeline-feed" 14 14 hx-swap="outerHTML"
+24 -1
appview/timeline/timeline.go
··· 16 16 func (t *Timeline) Timeline(w http.ResponseWriter, r *http.Request) { 17 17 user := t.oauth.GetMultiAccountUser(r) 18 18 19 - followingOnly := r.URL.Query().Get("following") == "true" && user != nil 19 + const timelineTabCookie = "timeline-tab" 20 + var followingOnly bool 21 + if _, hasParam := r.URL.Query()["following"]; hasParam { 22 + followingOnly = r.URL.Query().Get("following") == "true" && user != nil 23 + } else if user != nil { 24 + if c, err := r.Cookie(timelineTabCookie); err == nil { 25 + followingOnly = c.Value == "following" 26 + } 27 + } 28 + 29 + if user != nil { 30 + val := "global" 31 + if followingOnly { 32 + val = "following" 33 + } 34 + http.SetCookie(w, &http.Cookie{ 35 + Name: timelineTabCookie, 36 + Value: val, 37 + Path: "/", 38 + MaxAge: 365 * 24 * 60 * 60, 39 + HttpOnly: true, 40 + SameSite: http.SameSiteLaxMode, 41 + }) 42 + } 20 43 21 44 var userDid string 22 45 if user != nil {