-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
feat(editor): kanban mobile drag and drop #9411
base: canary
Are you sure you want to change the base?
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## canary #9411 +/- ##
==========================================
+ Coverage 51.67% 52.53% +0.85%
==========================================
Files 2152 2152
Lines 97009 97103 +94
Branches 16205 16163 -42
==========================================
+ Hits 50133 51010 +877
+ Misses 45513 44680 -833
- Partials 1363 1413 +50
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Thank you for your pull request! To enhance the development experience and code maintainability, we should consider generalizing the current drag-and-drop functionality to support long-press dragging on mobile devices. At present, the key difference between mobile and PC drag-and-drop is the initiation: long-press on mobile versus click on PC. We can make the code adaptable for both platforms. Previously, the mobile version was set to readonly due to some database issues. Now that these issues have been resolved, we can safely remove this restriction. Moreover, to ensure consistency and maintainability, please avoid adding new test code to Thank you for your efforts and understanding! |
I haven't explicitly implemented the long press thing. I just make all touch events on cards route through the same logic as the desktop version. We are just using pointer events, rather than the web platform's native drag and drop. If we want to emulate the web platform's native long-press drag and drop behaviour, we would need to add extra logic for that. I have chosen not to do this because:
I'm not using the web drag and drop functionality because of 3 and because it's not implemented on mobile Firefox (Which is the browser I use)
That's fantastic news. I will clean that up.
Okay. I'll have another go at that. I noticed in passing that the affine playwright tests take a lot longer per test than the blocksuite ones (I may have picked an unlucky set of tests though, or imagined it). Should I try to write these as vitest tests instead, or is that going to be too much pain? [Sorry for the edit. I pressed the send button by accident] |
979df78
to
89048db
Compare
I apologize for the delayed response; I've been on vacation recently. Regarding the implementation of long-press dragging, this feature is essential for mobile devices as defined by the product design. If it cannot be implemented at the moment, we are open to temporarily not having the drag-and-drop functionality on mobile, which means we won't need to adjust the drag-and-drop feature for mobile devices for now. About the issue of long-press triggering the context menu, perhaps we could listen for the Thank you for your understanding! |
I completely understand. This is the curse of being an open source maintainer: you get a bunch of drive by contributors when everyone is taking time off, and that's exactly when you want to be taking time off.
Thanks for your guidance so far. I have learned a lot already. Do you have design documents that can be shared/screenshotted? I was hoping that I could get away with shipping a half-baked solution to unblock my use-case (sharing a kanban board with my dad, to help me with job hunting). Do I also need to add a drag handle to help with accessibility?
Is it okay for this pointerdown to also not cause the page to scroll? (This is what happens if we have touch-events: none. You need to avoid putting your thumb on a card if you want to start scrolling, because the browser will swallow+ignore your touch of you do) How evergreen can we be about our browser requirements? If long-press is a hard requirement then I'm almost tempted to implement it in terms of For now, I will try implementing the long press behaviour as you suggested. Thanks again for your feedback. |
… don't do anything with it
If you switch to desktop mode, add a kanban board, then switch to touch emulation mode, the pc kanban board now correctly responds to touch-based drag events. Now I just need to wire up the mobile component so that it looks like the pc one.
this was just from looking at 'code --diff */kanban-view.ts'. It might be pointless cargo-culting
103c458
to
ad6282c
Compare
Done. It wasn't as painful as I expected, once I found blocksuite/framework/block-std/src/event/control/pointer.ts |
this is based on toeverything/blocksuite#9048
This PR includes:
This is based on top of toeverything/blocksuite#9044 so it included a basic playwright test. I'm happy to merge this as two separate PRs or close the other one if you prefer.
TODO/known bugs from QAing (some for now, and some for fixing in later issues/PRs):