Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Presence First Pass #53

Merged
merged 13 commits into from Mar 9, 2023
Merged

Presence First Pass #53

merged 13 commits into from Mar 9, 2023

Conversation

curran
Copy link
Contributor

@curran curran commented Mar 8, 2023

Closes #16

image

First pass of the feature only.

Summary of changes:

  • Set up ShareDB LocalPresence instance
  • Listen for changes in CodeMirror
  • Broadcast presence using ShareDB API
  • Display the remote presence
  • Tested multiple connections (had to pass the sort arg to Decoration.set to fix this)
  • Tested editing after receiving presence. Had to add a setTimeout before dispatching the change to fix this, so there are not synchronous nested CodeMirror updates. This feels like somewhat of a hack, but not sure a better way.
  • Tested that presence cursors are transformed correctly when editing
  • Tested that presence cursors work across newlines

Current limitations:

  • Everyone's cursor is yellow
  • Does not handle removing presence yet
  • Does not yet support range selections (only the start of the selection is displayed remotely, for now)

@curran curran marked this pull request as ready for review March 8, 2023 17:27
@curran curran requested a review from Anooj-Pai March 8, 2023 17:28
@curran curran changed the title Set up ShareDB Presence Presence Mar 9, 2023
@curran curran changed the title Presence Presence First Pass Mar 9, 2023
Copy link
Collaborator

@Anooj-Pai Anooj-Pai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Everything installs and runs perfectly. May change some styling but great for now!

@Anooj-Pai Anooj-Pai merged commit f174aca into main Mar 9, 2023
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.

Presence cursors
2 participants