-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fixed: Drag and Drop Causes Flashing and Disappearing Cards #6065
Conversation
…6001 by setting root to document's viewport
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.
PR Summary
- Modified
useInView
hook to use viewport as root instead ofscrollWrapper
- Fixed issue causing cards to flash and disappear during drag and drop
1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
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.
Hi @rksingh2001, thanks for your PR :) I'm not sure about this fix. I would expect an optimistic rendering issue (there is a concurrency issue between the queries behind each column / the cache is not properly updated).
Let's have a closer look to your fix tomorrow
Sure, @charlesBochet, its still optimistic rendering, its just that the root is now viewport. Although I don't full understand this point -> (there is a concurrency issue between the queries behind each column / the cache is not properly updated). |
Hi @rksingh2001, could you please look into the logic that updates a board card position in DB, because the problem is that now that we have one Apollo request per column, there's something that is not working with optimistic rendering in Apollo cache. Here it shouldn't take so long to update a board card visually (but it's ok if the request is slow) and should be instantaneous, with the help of optimistic rendering. Also we shouldn't try to fix the content of the card disappearing in this issue as it is not our concern here. |
@lucasbordeau "there's something that is not working with optimistic rendering in Apollo cache", can you be a little more specific on what exactly is not working, so I understand better. "Also we shouldn't try to fix the content of the card disappearing in this issue as it is not our concern here." <- I don't understand this part, do we not need to fix #6001? Because then there is no need of this PR. |
I think the label is wrong, I have responded |
@rksingh2001 This issue is quite difficult, sorry for the response delay, I'll help you with that soon ! |
Log
|
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.
@charlesBochet @rksingh2001 This was a tricky bug due to a refetch caused by DELETE directive from Apollo.
I removed the handling of limit (first and last) in the optimistic rendering because it's not required to have an already working optimistic effect in a list, and we can rely on the fetch many return to overwrite incorrect optimistic effect results.
I think my big TODO comment was relevant before the many refactors to have optimistic effect working with fetch more, but since it is now stable, I think we can just remove this entire comment and this part concerning limit also.
It would be difficult to implement an optimistic effect on limit, maybe we want to do it later ? I let you decide @charlesBochet.
Issue was "inView" was setting false due to root being scrollWrapper, instead changed it to viewport.
Fixes: #6001
Screencast from 2024-06-27 22-50-59.webm