Cursors Based On Connections Instead Of Users. #4794
Merged
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.
Problem:
We want to see multiplayer cursors for our user if they're on a different instance of the editor.
Fix:
There's two main changes:
colorIndex
to the connection.A lot of the work was mostly just making sure those requirements were satisfied. However one outcome was that as the
colorIndex
value was previously connected to the user for the comment listing it wouldn't make sense to have a colour for the connection and for the user, as they would likely be inconsistent. So the decision was made to remove the colours for comments and their avatars.Commit Details:
MultiplayerCursors
now usesexcludeMyConnection
to get everything but the current connection for the current user.multiplayerColorFromIndex
, thegetConnectionById
function is used to obtain thecolorIndex
for the connection if it exists.MultiplayerUserBar
now usesexcludeMyConnection
to get the connections excluding the current connection used by the current user.comment-hooks.tsx
.colorIndex
fromUserMeta
toConnectionInfo
.