feat: counts on lists of notes, reply cards link to the reply, fix class clash (v2.13.4)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
PhilandClaude Opus 5.5 committed 2026-11-10 14:05:03 -07:00
1 parent 81c730813c
commit 647f6c723b
12 files changed
+181 -37

No files matched your search

+21 -4
View File
@@ -335,9 +335,9 @@ def test_note_page_shows_backfed_responses_quotes_and_counts(app, client, web):
assert "via GoToSocial" in page
assert "1 Quote" in page and "Look at this" in page
# Likes and reposts are a counts line (v2.13.2): named likes plus the silo's anonymous count
assert '<span class="reaction-count">13</span>' in page and "+12 on GoToSocial" in page
assert '<span class="reaction-count">1</span>' in page
assert f'<indie-action class="reaction-elsewhere" do="like" with="{SITE}/note/{note.slug}">' in page
assert '<span class="response-count-n">13</span>' in page and "+12 on GoToSocial" in page
assert '<span class="response-count-n">1</span>' in page
assert f'<indie-action class="response-elsewhere" do="like" with="{SITE}/note/{note.slug}">' in page
assert f'Like on <a href="{COPY}"' in page
assert 'src="/avatars/' in page and 'src="https://cdn.example/a.png"' not in page
@@ -620,5 +620,22 @@ def test_people_who_opt_out_are_counted_not_named(app, client):
assert (s["likes_count"], s["reposts_count"]) == (2, 1)
assert [r["source_url"] for r in rows(app, note.id)] == [like(1).source_url]
page = app.test_client().get(f"/note/{note.slug}").get_data(as_text=True)
assert '<span class="reaction-count">3</span>' in page and "+2 on GoToSocial" in page
assert '<span class="response-count-n">3</span>' in page and "+2 on GoToSocial" in page
assert "Liker 5" not in page and "Quiet" not in page
def test_home_page_shows_counts(app, client):
"""v2.13.4: lists of notes show like, repost and reply counts, linking to the responses"""
note, sid = crossposted(app)
with app.app_context():
quiet = create_note(content="Nobody saw this", published=True)
client.harvest = Harvest([like(1), like(2), reply(3)])
run(app)
with app.app_context():
get_db(app).execute("UPDATE syndications SET likes_count = 1, reposts_count = 2 WHERE id = ?", (sid,))
get_db(app).commit()
page = app.test_client().get("/").get_data(as_text=True)
assert f'href="{SITE}/note/{note.slug}#responses"' in page
assert 'title="3 likes"' in page and 'title="2 reposts"' in page and 'title="1 reply"' in page
assert f"/note/{quiet.slug}#responses" not in page
assert 'id="responses"' in app.test_client().get(f"/note/{note.slug}").get_data(as_text=True)