Skip to content

Keep a commit's replies when you star it - #121

Merged
simonhamp merged 1 commit into
mainfrom
fix/star-keeps-replies
Oct 28, 2026
Merged

simonhamp merged 1 commit into
mainfrom
fix/star-keeps-replies

Conversation

@simonhamp

Copy link
Copy Markdown
Member

Starring a commit in a feed sometimes made the replies under it disappear.

toggleStar() looked the commit up by id and took the first copy on the screen. That could be the copy inside a quote of it further up, or the copy previewed as a reply under its parent (Latest can show both). Neither copy carries the reply preview the commit's own row has. replaceShownCommit() then put that copy in place of every copy of the commit, so the row lost its thread. It only happened when one of those copies sat above the commit, which is why it seemed random.

The same cause had a second effect. The quoted copy was never updated, so the next tap read its old state and starred the commit again instead of unstarring it. Pastéis went through the same helper.

replaceShownCommit() is now changeShownCommit(), which applies the change (star, unstar, pastel) to each copy where it sits, including copies inside quotes, via a new Commit::withQuotedCommit(). Each copy keeps what only it has.

Two tests in ReplyPreviewTest cover the quote case (including the second tap unstarring) and the previewed-reply case. Both fail on main.

Worth a look: a star on a commit now also rebuilds the row of any commit quoting it, since the quote's copy changes. Quote cards don't draw stars, so nothing looks different there.

Screenshots

Nothing is drawn differently. This only changes which copy of a commit gets updated, so the thread stays where it already was. I haven't reproduced it on a device, since that needs a quoted commit with replies on a local API.

  • No visible change

🤖 Generated with Claude Code

Starring a commit looked it up by id and took the first copy on the
screen, which could be the one inside a quote above it, or the one
previewed as a reply under its parent. Neither carries the replies the
commit's own row shows, and that copy then replaced every copy of the
commit, so the thread under the row went away.

The quoted copy was never updated either, so the next tap read its old
state and starred the commit again instead of unstarring it. Pasteis
went through the same code.

Now the star or pastel is applied to each copy where it is, quotes
included, so each keeps what only it has.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@simonhamp
simonhamp merged commit d9290b4 into main Oct 28, 2026
2 checks passed
@simonhamp
simonhamp deleted the fix/star-keeps-replies branch October 28, 2026 19:29
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.

1 participant