Yōten: A social tracker for your language learning journey built on the atproto.

feat: add study session comments #1

merged opened by brookjeynes.dev targeting master from bj/2025-09-05/feat/study-session-comments
Labels

None yet.

Participants 1
AT URI
at://did:plc:4mj54vc4ha3lh32ksxwunnbh/sh.tangled.repo.pull/3lza2rhz7il22
+8 -28
Interdiff #1 β†’ #2
internal/server/handlers/router.go

This file has not been changed.

internal/server/handlers/study-session.go

This file has not been changed.

internal/server/views/partials/discussion.templ

This file has not been changed.

internal/server/views/partials/partials.go

This file has not been changed.

internal/server/views/partials/study-session.templ

This file has not been changed.

internal/server/views/study-session.templ

This file has not been changed.

internal/server/views/views.go

This file has not been changed.

+8 -28
internal/db/follow.go
··· 1 1 package db 2 2 3 3 import ( 4 - "database/sql" 5 4 "fmt" 6 - "log" 7 5 "strings" 8 6 "time" 9 7 ) ··· 78 76 return IsSelf 79 77 } 80 78 79 + var follows, isFollowed bool 81 80 query := ` 81 + select 82 + exists(select 1 from follows where user_did = ? and subject_did = ?), 83 + exists(select 1 from follows where user_did = ? and subject_did = ?) 84 + ` 85 + err := e.QueryRow(query, userDid, subjectDid, subjectDid, userDid).Scan(&follows, &isFollowed) 82 - SELECT 83 - -- Count of rows where the user follows the subject 84 - COUNT(CASE WHEN user_did = ? AND subject_did = ? THEN 1 END), 85 - -- Count of rows where the subject follows the user 86 - COUNT(CASE WHEN user_did = ? AND subject_did = ? THEN 1 END) 87 - FROM 88 - follows 89 - WHERE 90 - (user_did = ? AND subject_did = ?) OR (user_did = ? AND subject_did = ?); 91 - ` 92 - 93 - var userFollowsSubject, subjectFollowsUser int 94 - err := e.QueryRow( 95 - query, 96 - userDid, subjectDid, 97 - subjectDid, userDid, 98 - userDid, subjectDid, 99 - subjectDid, userDid, 100 - ).Scan(&userFollowsSubject, &subjectFollowsUser) 101 - 102 86 if err != nil { 103 - if err == sql.ErrNoRows { 104 - return IsNotFollowing 105 - } 106 - log.Printf("failed to query follow status: %v", err) 107 87 return IsNotFollowing 108 88 } 109 89 90 + if follows && isFollowed { 110 - if userFollowsSubject > 0 && subjectFollowsUser > 0 { 111 91 return IsMutual 92 + } else if follows { 112 - } else if userFollowsSubject > 0 { 113 93 return IsFollowing 114 94 } else { 115 95 return IsNotFollowing
api/yoten/cbor_gen.go

This file has not been changed.

api/yoten/feedcomment.go

This file has not been changed.

cmd/gen.go

This file has not been changed.

internal/db/comment.go

This file has not been changed.

internal/db/db.go

This file has not been changed.

internal/server/views/new-study-session.templ

This file has not been changed.

lexicons/feed/comment.json

This file has not been changed.

internal/clients/posthog/posthog.go

This file has not been changed.

internal/consumer/ingester.go

This file has not been changed.

internal/server/app.go

This file has not been changed.

internal/server/handlers/comment.go

This file has not been changed.

internal/server/views/partials/comment.templ

This file has not been changed.

internal/server/views/partials/activity.templ

This file has not been changed.

internal/server/views/partials/resource.templ

This file has not been changed.

internal/server/oauth/handler/handler.go

This file has not been changed.

internal/server/views/partials/edit-comment.templ

This file has not been changed.

internal/db/utils.go

This file has not been changed.

internal/server/views/partials/comment-feed.templ

This file has not been changed.

internal/server/views/partials/reactions.templ

This file has not been changed.

internal/db/notification.go

This file has not been changed.

internal/server/views/friends.templ

This file has not been changed.

internal/server/views/partials/notification.templ

This file has not been changed.

History

3 rounds 0 comments
sign up or login to add to the discussion
8 commits
expand
feat: add study session page
feat: add comment lexicon and db struct
feat: add / delete comments
fix: hx id elements missing #
refactor: renames + deletion of unused code
feat(comments): allow user to edit comment
feat: fetch study session comments
feat: add comment notifications
expand 0 comments
pull request successfully merged
9 commits
expand
feat: add study session page
fix: follow status
feat: add comment lexicon and db struct
feat: add / delete comments
fix: hx id elements missing #
refactor: renames + deletion of unused code
feat(comments): allow user to edit comment
feat: fetch study session comments
feat: add comment notifications
expand 0 comments
10 commits
expand
feat: add study session page
fix: add @ to profile handle
fix: follow status
feat: add comment lexicon and db struct
feat: add / delete comments
fix: hx id elements missing #
refactor: renames + deletion of unused code
feat(comments): allow user to edit comment
feat: fetch study session comments
feat: add comment notifications
expand 0 comments