Multi-user selection painting #641
matthew-carroll
started this conversation in
Post Mortem
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
WORK IN PROGRESS
Multi-user selection painting was filed in #631.
Remote user selections need to be painted alongside the primary user's selection.
The big picture
Multi-user selection painting was achieved with the following changes:
DocumentComposer, which logically represents all document selections other than the primary user's selection.NonPrimarySelectionStylertoSingleColumnLayoutSelectionStyler, which is responsible for choosing colors for each non-primary selection.StyledSelections instead of a single set of selection styles:ListItemComponentViewModel,BlockquoteComponentViewModel,ParagraphComponentViewModel,ImageComponentViewModel, andHorizontalRuleComponentViewModel.TextComponentto accept a list ofStyledSelections instead of single set of selection styles. Also changeTextComponents widget tree to use aSuperTextWithSelection.multi()instead ofSuperTextWithSelection.single().Experience with the changes
Making the changes was relatively straightforward. The only necessary re-wiring was the replacement of individual properties like
selectionColorwith a list ofStyledSelections, each of which includes theselectionColorand the associatedselection.View model changes were monotonous and nearly identical. Each of the effected view models needed to have their constructor arguments changed to replace individual properties with the list of
StyledSelection. The same change needed to happen to the view models' properties. ThehashCodeand==methods needed to be updated. The==methods needed the introduction ofDeepCollectionEquality()to check list item equality.Beta Was this translation helpful? Give feedback.
All reactions