-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[WEB-2166] chore: smoother drag experience in the document editor #5296
Conversation
WalkthroughThe recent updates enhance the drag-and-drop functionality in the editor by modernizing the codebase through arrow function syntax, improving semantic HTML usage, and refining CSS styles. Key adjustments include converting several traditional functions to arrow functions for better scoping and readability, introducing class-based styling for the drop cursor, and enhancing the visual representation of drag handles and selected nodes, ultimately improving both functionality and aesthetics. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant DragHandle
participant EditorView
participant Node
User->>DragHandle: Click to drag
DragHandle->>EditorView: Initiate drag
EditorView->>Node: Update position
Node->>EditorView: Confirm position update
EditorView->>User: Show updated layout
Poem
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? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
web/public/sw.js.map
is excluded by!**/*.map
Files selected for processing (3)
- packages/editor/src/core/extensions/drag-drop.tsx (13 hunks)
- packages/editor/src/core/extensions/extensions.tsx (1 hunks)
- packages/editor/src/styles/drag-drop.css (5 hunks)
Additional comments not posted (15)
packages/editor/src/styles/drag-drop.css (7)
6-7
: LGTM! Improved drag handle styling.The increased width, added aspect-ratio, and consolidated transition properties enhance the visual and interactive aspects of the drag handle.
Also applies to: 13-18
29-29
: LGTM! Improved class naming.The class name change from
.hidden
to.drag-handle-hidden
improves clarity regarding its purpose.
71-88
: LGTM! Enhanced selected node styling.The addition of the
--horizontal-offset
variable and modifications to the::after
pseudo-element provide a more dynamic and visually appealing representation of selected nodes.
91-91
: LGTM! Improved task list item styling.The changes targeting
ProseMirror-selectednode
withdata-checked
attribute improve the visual representation of selected task list items.
96-96
: LGTM! Improved unordered list item styling.The changes targeting
ProseMirror-selectednode
in unordered lists improve the visual representation of selected unordered list items.
106-117
: LGTM! Improved ordered list item styling.The changes targeting
ProseMirror-selectednode
in ordered lists and adjusting margins for items after the 9th and 99th improve the visual representation of selected ordered list items.
117-117
: LGTM! Enhanced image styling.The changes adding transition and hover effects for images enhance the visual feedback when interacting with images.
packages/editor/src/core/extensions/extensions.tsx (1)
76-76
: LGTM! Improved drop cursor styling.The change to use a
class
attribute for thedropcursor
property ties the styling to a CSS framework or custom styling rules, improving maintainability and consistency.packages/editor/src/core/extensions/drag-drop.tsx (7)
Line range hint
31-54
:
LGTM! Improved function syntax and semantic meaning.The refactoring to arrow function syntax and updates to HTML elements for semantic meaning improve consistency, readability, and semantic meaning of the code.
56-64
: LGTM! Improved function syntax.The refactoring to arrow function syntax improves consistency and readability of the code.
Line range hint
66-99
:
LGTM! Improved function syntax.The refactoring to arrow function syntax improves consistency and readability of the code.
101-108
: LGTM! Improved function syntax.The refactoring to arrow function syntax improves consistency and readability of the code.
110-117
: LGTM! Improved function syntax.The refactoring to arrow function syntax improves consistency and readability of the code.
Line range hint
119-133
:
LGTM! Improved function syntax.The refactoring to arrow function syntax improves consistency and readability of the code.
Line range hint
135-404
:
LGTM! Improved function syntax and event handling.The refactoring to arrow function syntax improves consistency and readability of the code. The event handling logic remains intact and clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- web/next.config.js (1 hunks)
Additional comments not posted (1)
web/next.config.js (1)
9-9
: LGTM! Disabling PWA in development mode is a good practice.The addition of the
disable
property to thenext-pwa
configuration ensures that PWA features are disabled during development, which can help avoid potential issues with local testing and debugging.
Improvements:
Media:
Screen.Recording.2024-08-05.at.13.10.07.mov
Screen.Recording.2024-08-05.at.13.07.13.mov
Plane issue: WEB-2166
Summary by CodeRabbit
New Features
Bug Fixes
Style