Closed choidabom closed 2 months ago
The changes involve a refactoring of user presence management, including the renaming of components, updates to state management through Redux, and the introduction of new functions for enhanced user interaction. The implementation allows for improved navigation by moving the cursor to a user's profile location in the document, thereby enhancing collaborative functionalities.
File | Change Summary |
---|---|
frontend/src/components/headers/UserPresenceList.tsx |
Renamed UserPresence to UserPresenceList , updated props interface, and integrated useSelector for Redux state management. Added navigation functionality. |
frontend/src/hooks/useYorkieDocument.ts |
Updated document state type and added helper functions for managing the Yorkie document and client, including error handling improvements. |
frontend/src/utils/yorkie/yorkieSync.ts |
Added a cursor property to the YorkieCodeMirrorPresenceType to enhance user presence tracking. |
frontend/src/utils/yorkie/remoteSelection.ts |
Enhanced selection handling by computing a new cursor variable included in the presence updates. |
frontend/src/components/headers/DocumentHeader.tsx |
Refactored user presence management by replacing the useList hook with a custom useUserPresence hook, simplifying the component's logic and subscription handling. |
Objective | Addressed | Explanation |
---|---|---|
Add functionality to move cursor to user's profile when clicked (#256) | ✅ |
🐰 In the meadow where changes bloom,
A cursor leaps to find its room.
With profiles clicked, they dance with glee,
In documents shared, oh, how happy we’ll be!
A hop, a skip, in code we trust,
Collaboration flourishes, it's a must! 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@coderabbitai review
What this PR does / why we need it?
This PR introduces a feature that automatically scrolls to a user's corresponding section in the document when that user's profile is clicked. This functionality is intended to streamline collaboration by minimizing the time users spend searching for specific content tied to team members.
Any background context you want to provide?
In collaborative platforms with extensive documentation, such as Figma, enabling users to readily navigate to pertinent sections based on user profiles significantly boosts productivity and fosters more efficient teamwork. This feature is particularly beneficial in lengthy documents where manually locating information can hinder progress.
Note: The scroll navigation feature requires that the user has selected an editor section. If no section is selected, the navigation will not occur.
What are the relevant tickets?
Fixes https://github.com/yorkie-team/codepair/issues/256
Checklist
Summary by CodeRabbit
New Features
Refactor