Display AuthorDID when AuthorHandle is missing in annotation card + fix missing resolved handlesUnverified
50ea7de parent: af6a931 modified
internal/server/articles_handler.go +1 -0 | @@ -188,6 +188,7 @@ func (s *Server) handleArticleDetail(w http.ResponseWriter, r *http.Request) { | ||
| 188 | 188 | if err != nil { |
| 189 | 189 | s.logger.Warn("failed to list annotations", "error", err) |
| 190 | 190 | } |
| 191 | + resolveAnnotationHandles(ctx, annotations) | |
| 191 | 192 | |
| 192 | 193 | feed, err := s.dbs.Articles.GetFeed(ctx, article.FeedURL) |
| 193 | 194 | if err != nil { |
| @@ -188,6 +188,7 @@ func (s *Server) handleArticleDetail(w http.ResponseWriter, r *http.Request) { | |||
| 188 | if err != nil { | 188 | if err != nil { |
| 189 | s.logger.Warn("failed to list annotations", "error", err) | 189 | s.logger.Warn("failed to list annotations", "error", err) |
| 190 | } | 190 | } |
| 191 | + resolveAnnotationHandles(ctx, annotations) | ||
| 191 | 192 | ||
| 192 | feed, err := s.dbs.Articles.GetFeed(ctx, article.FeedURL) | 193 | feed, err := s.dbs.Articles.GetFeed(ctx, article.FeedURL) |
| 193 | if err != nil { | 194 | if err != nil { |
modified
internal/tmpl/partials/annotation-card.html +1 -1 | @@ -24,7 +24,7 @@ | ||
| 24 | 24 | {{end}} |
| 25 | 25 | <div class="flex items-center justify-between mt-3 pt-3 border-t border-spot-divider"> |
| 26 | 26 | <div class="flex items-center gap-2 text-xs text-spot-muted"> |
| 27 | - <a href="/profile/{{.annotation.AuthorDID}}" class="hover:text-spot-green transition">{{.annotation.AuthorHandle}}</a> | |
| 27 | + <a href="/profile/{{.annotation.AuthorDID}}" class="hover:text-spot-green transition">{{if .annotation.AuthorHandle}}{{.annotation.AuthorHandle}}{{else}}{{.annotation.AuthorDID}}{{end}}</a> | |
| 28 | 28 | {{if .annotation.CreatedAt.Valid}}<span>·</span><span>{{.annotation.CreatedAt.Time.Format "Jan 2, 2006 15:04"}}</span>{{end}} |
| 29 | 29 | </div> |
| 30 | 30 | {{if eq .annotation.AuthorDID .userDID}} |
| @@ -24,7 +24,7 @@ | |||
| 24 | {{end}} | 24 | {{end}} |
| 25 | <div class="flex items-center justify-between mt-3 pt-3 border-t border-spot-divider"> | 25 | <div class="flex items-center justify-between mt-3 pt-3 border-t border-spot-divider"> |
| 26 | <div class="flex items-center gap-2 text-xs text-spot-muted"> | 26 | <div class="flex items-center gap-2 text-xs text-spot-muted"> |
| 27 | - <a href="/profile/{{.annotation.AuthorDID}}" class="hover:text-spot-green transition">{{.annotation.AuthorHandle}}</a> | 27 | + <a href="/profile/{{.annotation.AuthorDID}}" class="hover:text-spot-green transition">{{if .annotation.AuthorHandle}}{{.annotation.AuthorHandle}}{{else}}{{.annotation.AuthorDID}}{{end}}</a> |
| 28 | {{if .annotation.CreatedAt.Valid}}<span>·</span><span>{{.annotation.CreatedAt.Time.Format "Jan 2, 2006 15:04"}}</span>{{end}} | 28 | {{if .annotation.CreatedAt.Valid}}<span>·</span><span>{{.annotation.CreatedAt.Time.Format "Jan 2, 2006 15:04"}}</span>{{end}} |
| 29 | </div> | 29 | </div> |
| 30 | {{if eq .annotation.AuthorDID .userDID}} | 30 | {{if eq .annotation.AuthorDID .userDID}} |