Monorepo for Tangled tangled.org
2

Configure Feed

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

appview/{issues,pulls}: mark read-on-visit only outside focus mode

notifications are marked as read when the underlying URL is visited.
this now happens only when *outside* focus mode. when inside focus mode,
the notif is only marked as read on hitting the `next` button on the
focus pill.

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

author
oppiliappan
committer
Tangled
date (Jun 15, 2026, 5:28 PM +0300) commit 9fadcd21 parent 0dd991a7 change-id ywulnwwq
+14 -14
+7 -7
appview/issues/issues.go
··· 99 99 } 100 100 101 101 if user != nil { 102 - repoDid := f.RepoDid 103 102 userDid := user.Did 103 + repoDid := f.RepoDid 104 104 issueId := issue.IssueId 105 - go func() { 106 - if err := db.MarkNotificationsReadForIssue(rp.db, userDid, repoDid, issueId); err != nil { 107 - l.Error("failed to mark issue notifications as read", "err", err) 108 - } 109 - }() 110 - 111 105 atUri := issue.AtUri().String() 106 + focusing := pages.BaseParamsFromContext(r.Context()).FocusParams.Focusing 112 107 go func() { 108 + if !focusing { 109 + if err := db.MarkNotificationsReadForIssue(rp.db, userDid, repoDid, issueId); err != nil { 110 + l.Error("failed to mark issue notifications as read", "err", err) 111 + } 112 + } 113 113 if err := db.UpsertRecentLink(rp.db, userDid, models.RecentLinkTypeIssue, atUri); err != nil { 114 114 l.Error("failed to upsert recent link", "err", err) 115 115 }
+7 -7
appview/pulls/single.go
··· 102 102 l = l.With("pull_id", pull.PullId, "pull_owner", pull.OwnerDid) 103 103 104 104 if user != nil { 105 - repoDid := f.RepoDid 106 105 userDid := user.Did 106 + repoDid := f.RepoDid 107 107 pullId := pull.PullId 108 - go func() { 109 - if err := db.MarkNotificationsReadForPull(s.db, userDid, repoDid, pullId); err != nil { 110 - l.Error("failed to mark pull notifications as read", "err", err) 111 - } 112 - }() 113 - 114 108 atUri := pull.AtUri().String() 109 + focusing := pages.BaseParamsFromContext(r.Context()).FocusParams.Focusing 115 110 go func() { 111 + if !focusing { 112 + if err := db.MarkNotificationsReadForPull(s.db, userDid, repoDid, pullId); err != nil { 113 + l.Error("failed to mark pull notifications as read", "err", err) 114 + } 115 + } 116 116 if err := db.UpsertRecentLink(s.db, userDid, models.RecentLinkTypePull, atUri); err != nil { 117 117 l.Error("failed to upsert recent link", "err", err) 118 118 }