Repository navigation
Keep a commit's replies when you star it - #121
Merged
Merged
Conversation
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]>
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 nowchangeShownCommit(), which applies the change (star, unstar, pastel) to each copy where it sits, including copies inside quotes, via a newCommit::withQuotedCommit(). Each copy keeps what only it has.Two tests in
ReplyPreviewTestcover 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.
🤖 Generated with Claude Code