Monorepo for Tangled tangled.org

appview: implement follower and following pages for users #484

merged opened by ptr.pet targeting master from [deleted fork]: followers-following-list
Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:dfl62fgb7wtjj3fcbb72naae/sh.tangled.repo.pull/3lwawsuk3de22
+8 -8
Interdiff #3 #4
appview/db/profile.go

This file has not been changed.

appview/db/timeline.go

This file has not been changed.

appview/pages/funcmap.go

This file has not been changed.

appview/pages/pages.go

This file has not been changed.

appview/pages/templates/timeline.html

This file has not been changed.

appview/pages/templates/user/followers.html

This file has not been changed.

appview/pages/templates/user/following.html

This file has not been changed.

appview/pages/templates/user/fragments/follow.html

This file has not been changed.

appview/pages/templates/user/fragments/followCard.html

This file has not been changed.

appview/pages/templates/user/fragments/profileCard.html

This file has not been changed.

+8 -8
appview/state/profile.go
··· 275 276 profile, err := db.GetProfile(s.db, ident.DID.String()) 277 if err != nil { 278 - log.Printf("getting profile data for %s: %s", ident.DID.String(), err) 279 } 280 281 loggedInUser := s.oauth.GetUser(r) 282 283 followers, err := db.GetFollowers(s.db, ident.DID.String()) 284 if err != nil { 285 - log.Printf("getting followers for %s: %s", ident.DID.String(), err) 286 } 287 followerCards, err := s.makeFollowCards( 288 r.Context(), ··· 291 func(f db.Follow) string { return f.UserDid }, 292 ) 293 if err != nil { 294 - log.Printf("getting follower cards for %s: %s", ident.DID.String(), err) 295 } 296 297 followStatus := db.IsNotFollowing ··· 301 302 followersCount, followingCount, err := db.GetFollowerFollowingCount(s.db, ident.DID.String()) 303 if err != nil { 304 - log.Printf("getting follow stats for %s: %s", ident.DID.String(), err) 305 } 306 307 s.pages.FollowersPage(w, pages.FollowersPageParams{ ··· 327 328 profile, err := db.GetProfile(s.db, ident.DID.String()) 329 if err != nil { 330 - log.Printf("getting profile data for %s: %s", ident.DID.String(), err) 331 } 332 333 loggedInUser := s.oauth.GetUser(r) 334 335 following, err := db.GetFollowing(s.db, ident.DID.String()) 336 if err != nil { 337 - log.Printf("getting following for %s: %s", ident.DID.String(), err) 338 } 339 followingCards, err := s.makeFollowCards( 340 r.Context(), ··· 343 func(f db.Follow) string { return f.SubjectDid }, 344 ) 345 if err != nil { 346 - log.Printf("getting follower cards for %s: %s", ident.DID.String(), err) 347 } 348 349 followStatus := db.IsNotFollowing ··· 353 354 followersCount, followingCount, err := db.GetFollowerFollowingCount(s.db, ident.DID.String()) 355 if err != nil { 356 - log.Printf("getting follow stats for %s: %s", ident.DID.String(), err) 357 } 358 359 s.pages.FollowingPage(w, pages.FollowingPageParams{
··· 275 276 profile, err := db.GetProfile(s.db, ident.DID.String()) 277 if err != nil { 278 + log.Printf("getting profile data followers for %s: %s", ident.DID.String(), err) 279 } 280 281 loggedInUser := s.oauth.GetUser(r) 282 283 followers, err := db.GetFollowers(s.db, ident.DID.String()) 284 if err != nil { 285 + log.Printf("getting followers followers for %s: %s", ident.DID.String(), err) 286 } 287 followerCards, err := s.makeFollowCards( 288 r.Context(), ··· 291 func(f db.Follow) string { return f.UserDid }, 292 ) 293 if err != nil { 294 + log.Printf("getting follow followers cards for %s: %s", ident.DID.String(), err) 295 } 296 297 followStatus := db.IsNotFollowing ··· 301 302 followersCount, followingCount, err := db.GetFollowerFollowingCount(s.db, ident.DID.String()) 303 if err != nil { 304 + log.Printf("getting follow stats followers for %s: %s", ident.DID.String(), err) 305 } 306 307 s.pages.FollowersPage(w, pages.FollowersPageParams{ ··· 327 328 profile, err := db.GetProfile(s.db, ident.DID.String()) 329 if err != nil { 330 + log.Printf("getting profile data following for %s: %s", ident.DID.String(), err) 331 } 332 333 loggedInUser := s.oauth.GetUser(r) 334 335 following, err := db.GetFollowing(s.db, ident.DID.String()) 336 if err != nil { 337 + log.Printf("getting following following for %s: %s", ident.DID.String(), err) 338 } 339 followingCards, err := s.makeFollowCards( 340 r.Context(), ··· 343 func(f db.Follow) string { return f.SubjectDid }, 344 ) 345 if err != nil { 346 + log.Printf("getting follow following cards for %s: %s", ident.DID.String(), err) 347 } 348 349 followStatus := db.IsNotFollowing ··· 353 354 followersCount, followingCount, err := db.GetFollowerFollowingCount(s.db, ident.DID.String()) 355 if err != nil { 356 + log.Printf("getting follow stats following for %s: %s", ident.DID.String(), err) 357 } 358 359 s.pages.FollowingPage(w, pages.FollowingPageParams{
appview/state/router.go

This file has not been changed.

appview/strings/strings.go

This file has not been changed.

History

14 rounds 6 comments
sign up or login to add to the discussion
1 commit
expand
cb75b373
appview: implement follower and following pages for users
expand 0 comments
pull request successfully merged
1 commit
expand
98413d89
appview: implement follower and following pages for users
expand 0 comments
1 commit
expand
118fb342
appview: implement follower and following pages for users
expand 0 comments
1 commit
expand
7a5c931a
appview: implement follower and following pages for users
expand 0 comments
1 commit
expand
773aa964
appview: implement follower and following pages for users
expand 1 comment
  • fixed timeline linking to wrong user (forgot to use subjectHandle instead of userHandle)
  • use ?tab= for followers / following like repo page does
  • fix repos opengraph url from /repos to ?tab=repos
1 commit
expand
ece60a35
appview: implement follower and following pages for users
expand 1 comment
  • added following / follower page links to timeline and follow cards
  • also added followers and following to profile tab switch case
1 commit
expand
a8bcde9d
appview: implement follower and following pages for users
expand 1 comment

using resolve in html instead of resolving handles in go code, and dedupped followers/followingPage into followPage

1 commit
expand
a285cd0f
appview: implement follower and following pages for users
expand 0 comments
1 commit
expand
3c2d8223
appview: implement follower and following pages for users
expand 1 comment

fixed some issues now that i got my dev setup working again

1 commit
expand
90b0a392
appview: implement follower and following pages for users
expand 1 comment

comments from #1 should be addressed now

on top of that changed GetProfiles to return a map instead of array, which seemed easier to do since it internally uses a map anyway and both places it's used in need it as a map

1 commit
expand
0dfc15e9
appview: implement follower and following pages for users
expand 0 comments
1 commit
expand
9643a898
appview: implement follower and following pages for users
expand 0 comments
1 commit
expand
cf9a2ce8
appview: implement follower and following pages for users
expand 1 comment

the pages themselves look pretty good for a start!

  • i'd like to add follower-following count to each item (to make these identical to the profile cards in the timeline)
  • this GetProfile call results in an N+1 query. we have a helper called GetProfiles to help with this, you can get profiles of multiple DIDs in one DB call. db/timeline.go has an example of the same.

overall, i'm loving this stack!

ptr.pet submitted #0
1 commit
expand
cbdbaf6d
appview: implement follower and following pages for users
expand 0 comments