Skip to content

feat(#2051): sort Bluesky/Mastodon replies by interest - #2052

Merged
larspohlmann merged 5 commits into
developfrom
feature/2051-replies-sorted-by-interest
Nov 6, 2026
Merged

larspohlmann merged 5 commits into
developfrom
feature/2051-replies-sorted-by-interest

Conversation

@larspohlmann

Copy link
Copy Markdown
Owner

Closes #2051

The direct replies under a Bluesky or Mastodon post are now ranked by engagement instead of newest first:

likes + 2×reposts + 2×quotes + 3×replies

  • Equal scores fall back to newest first, so a thread nobody engaged with reads as before.
  • A reply whose counts are missing scores 0.
  • Answers inside a thread stay oldest first, so a sub-thread still reads as a conversation. The author's self-reply chain is unchanged.
  • The max-count cut now drops the least interesting replies instead of the oldest.

Design

  • ReplyNode carries the reply's SocialCountsModel, so the builders only parse.
  • ReplyThreadOrder (root service) applies the weights. They are a tuning decision, not part of the counts model (architecture §10).
  • ThreadWalk walks the replies in the order it is given.

Boy-scout: dropped ReplyNode::withReplies, which only a test called (its own commit).

Verification: both suite legs (SQLite, MySQL) pass, plus cs, stan, tramp and PHPMD on the touched files. infection:diff kills 33/33 mutants. PhpStorm reports weak warnings only.

Interest is likes + 2×reposts + 2×quotes + 3×replies: a reply that started
its own conversation says most, sharing takes more than a like. Equal scores
fall back to newest first, so an unengaged thread reads as before; answers
inside a thread stay oldest first so they still read as a conversation.
…nts the reply carries

The weighting is a tuned verdict, so it lives in the root service; the model
keeps the plain counts and the builders only parse them.
@larspohlmann
larspohlmann merged commit 1cb7a32 into develop Nov 6, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sort Bluesky/Mastodon replies by interest

1 participant