Limit feed recommendations and fix dismiss articleUnverified
1aed63a parent: b6dcf3d modified
internal/server/feeds_handler.go +1 -1 | @@ -26,7 +26,7 @@ func (s *Server) handleFeeds(w http.ResponseWriter, r *http.Request) { | ||
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | allSubs, _ := s.db.ListSubscriptions(r.Context(), user.DID, "", 1000, 0) |
| 29 | - feedRecs, _ := s.engine.GetFeedRecommendations(r.Context(), user.DID, 10) | |
| 29 | + feedRecs, _ := s.engine.GetFeedRecommendations(r.Context(), user.DID, 6) | |
| 30 | 30 | peopleRecs, _ := s.engine.GetPeopleRecommendations(r.Context(), user.DID, 5) |
| 31 | 31 | |
| 32 | 32 | if len(feedRecs) > 0 { |
| @@ -26,7 +26,7 @@ func (s *Server) handleFeeds(w http.ResponseWriter, r *http.Request) { | |||
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | allSubs, _ := s.db.ListSubscriptions(r.Context(), user.DID, "", 1000, 0) | 28 | allSubs, _ := s.db.ListSubscriptions(r.Context(), user.DID, "", 1000, 0) |
| 29 | - feedRecs, _ := s.engine.GetFeedRecommendations(r.Context(), user.DID, 10) | 29 | + feedRecs, _ := s.engine.GetFeedRecommendations(r.Context(), user.DID, 6) |
| 30 | peopleRecs, _ := s.engine.GetPeopleRecommendations(r.Context(), user.DID, 5) | 30 | peopleRecs, _ := s.engine.GetPeopleRecommendations(r.Context(), user.DID, 5) |
| 31 | 31 | ||
| 32 | if len(feedRecs) > 0 { | 32 | if len(feedRecs) > 0 { |
modified
internal/tmpl/partials/recommendation-article-card.html +1 -1 | @@ -15,7 +15,7 @@ | ||
| 15 | 15 | {{if .Summary}}<p class="text-sm text-spot-secondary mt-2 line-clamp-2">{{plainText .Summary}}</p>{{end}} |
| 16 | 16 | </div> |
| 17 | 17 | <div class="shrink-0 pt-1"> |
| 18 | - <button hx-post="/articles/dismiss" hx-swap="none" hx-include="#dismiss-{{.ArticleID}}" | |
| 18 | + <button hx-post="/articles/dismiss" hx-target="closest article" hx-swap="delete" hx-include="#dismiss-{{.ArticleID}}" | |
| 19 | 19 | class="text-[10px] text-spot-secondary hover:text-spot-text uppercase tracking-button transition flex items-center gap-1"> |
| 20 | 20 | <input type="hidden" name="article_url" value="{{.URL}}" id="dismiss-{{.ArticleID}}"> |
| 21 | 21 | <svg class="w-3 h-3" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/></svg> |
| @@ -15,7 +15,7 @@ | |||
| 15 | {{if .Summary}}<p class="text-sm text-spot-secondary mt-2 line-clamp-2">{{plainText .Summary}}</p>{{end}} | 15 | {{if .Summary}}<p class="text-sm text-spot-secondary mt-2 line-clamp-2">{{plainText .Summary}}</p>{{end}} |
| 16 | </div> | 16 | </div> |
| 17 | <div class="shrink-0 pt-1"> | 17 | <div class="shrink-0 pt-1"> |
| 18 | - <button hx-post="/articles/dismiss" hx-swap="none" hx-include="#dismiss-{{.ArticleID}}" | 18 | + <button hx-post="/articles/dismiss" hx-target="closest article" hx-swap="delete" hx-include="#dismiss-{{.ArticleID}}" |
| 19 | class="text-[10px] text-spot-secondary hover:text-spot-text uppercase tracking-button transition flex items-center gap-1"> | 19 | class="text-[10px] text-spot-secondary hover:text-spot-text uppercase tracking-button transition flex items-center gap-1"> |
| 20 | <input type="hidden" name="article_url" value="{{.URL}}" id="dismiss-{{.ArticleID}}"> | 20 | <input type="hidden" name="article_url" value="{{.URL}}" id="dismiss-{{.ArticleID}}"> |
| 21 | <svg class="w-3 h-3" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/></svg> | 21 | <svg class="w-3 h-3" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/></svg> |