Repository navigation
feat(chat): settle reaction pills on a beat - #1607
Merged
Merged
Conversation
The pill row re-sorted on every reaction update, so under a burst of reactions pills moved and changed width while a thumb was on its way down, and the tap landed on a different pill. ReactionSettler, in :shared:chat, sits between ReactionOrdering and the row. It is gen_reactions.py's Settler, and the 16 `settle` cases in reactions.json replay against it with a fake clock: - Counts and boosts update live; order changes on a 1 s beat, at most 3 adjacent swaps per beat, nearest the top first. Any boost lead or a count lead of 1 passes; ties never move. A pair that swapped can't swap back for 3 s. - A touch on the row holds the beat 1.5 s, extended by further touches and capped 4 s from the first. - Emptied pills leave on the beat; new emoji join at the end. - Each pill reserves room for its count (at least 2 digits) and boost as of the last beat. A value that fits shows at once; one that needs more room, such as 99 to 100, waits for the next beat. ReactionPillRow runs the beat, sizes the count to the reserved digits in tabular figures, and for 450 ms after a beat changes the layout routes a tap to whatever was under it before. That window is ReactionSettler.HIT_GRACE_MS, the one place to change it once it's measured on phones. reactions.json is re-synced from the orchestrator's canonical copy.
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.
The pill row re-sorted on every reaction update, so under a burst of
reactions pills moved and changed width while a thumb was on its way
down, and the tap landed on a different pill.
ReactionSettler, in :shared:chat, sits between ReactionOrdering and the
row. It is gen_reactions.py's Settler, and the 16
settlecases inreactions.json replay against it with a fake clock:
3 adjacent swaps per beat, nearest the top first. Any boost lead or a
count lead of 1 passes; ties never move. A pair that swapped can't
swap back for 3 s.
and capped 4 s from the first.
as of the last beat. A value that fits shows at once; one that needs
more room, such as 99 to 100, waits for the next beat.
ReactionPillRow runs the beat, sizes the count to the reserved digits
in tabular figures, and for 450 ms after a beat changes the layout
routes a tap to whatever was under it before. That window is
ReactionSettler.HIT_GRACE_MS, the one place to change it once it's
measured on phones.
reactions.json is re-synced from the orchestrator's canonical copy.
Spec: code-payments/flipcash-client-orchestrator#28 (Settling section,
settlevectors).