-
-
Notifications
You must be signed in to change notification settings - Fork 187
fix(web): resolve events to appear behind grid lines after drag #408
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
Conversation
|
@ccmdi is attempting to deploy a commit to the analogdotnow Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
1 issue found across 1 file
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="apps/web/src/components/calendar/event/draggable-event.tsx">
<violation number="1" location="apps/web/src/components/calendar/event/draggable-event.tsx:203">
Deferring removeDraggedEventId to the layout effect means any drag that exits via moveEvent’s early-return paths (month view without rows, day view all-day events, etc.) never clears the drag flag because item.event.start/end don’t change and the effect doesn’t rerun. That leaves the event stuck with the elevated dragged z-index.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
| const onDragEnd = (_e: PointerEvent, info: PanInfo) => { | ||
| removeDraggedEventId(item.event.id); | ||
| // Mark that we just finished dragging - will remove drag state after optimistic update | ||
| justFinishedDragging.current = true; |
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.
Deferring removeDraggedEventId to the layout effect means any drag that exits via moveEvent’s early-return paths (month view without rows, day view all-day events, etc.) never clears the drag flag because item.event.start/end don’t change and the effect doesn’t rerun. That leaves the event stuck with the elevated dragged z-index.
Prompt for AI agents
Address the following comment on apps/web/src/components/calendar/event/draggable-event.tsx at line 203:
<comment>Deferring removeDraggedEventId to the layout effect means any drag that exits via moveEvent’s early-return paths (month view without rows, day view all-day events, etc.) never clears the drag flag because item.event.start/end don’t change and the effect doesn’t rerun. That leaves the event stuck with the elevated dragged z-index.</comment>
<file context>
@@ -198,7 +199,9 @@ export function DraggableEvent({
const onDragEnd = (_e: PointerEvent, info: PanInfo) => {
- removeDraggedEventId(item.event.id);
+ // Mark that we just finished dragging - will remove drag state after optimistic update
+ justFinishedDragging.current = true;
+
// Do not reset transform immediately to avoid flashback to original
</file context>
✅ Addressed in c886126
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.
Reviewed changes from recent commits (found 1 issue).
1 issue found across 1 file
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="apps/web/src/components/calendar/event/draggable-event.tsx">
<violation number="1" location="apps/web/src/components/calendar/event/draggable-event.tsx:228">
When moveEvent returns false (no optimistic update), the event keeps the dragged offset because top/left never reset, leaving it stuck in the wrong position. Please reset the motion values before clearing the drag state.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
|
|
||
| moveEvent(deltaY, columnOffset); | ||
| // If moveEvent returned early without updating, clear drag state immediately | ||
| if (!moveEvent(deltaY, columnOffset)) { |
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.
When moveEvent returns false (no optimistic update), the event keeps the dragged offset because top/left never reset, leaving it stuck in the wrong position. Please reset the motion values before clearing the drag state.
Prompt for AI agents
Address the following comment on apps/web/src/components/calendar/event/draggable-event.tsx at line 228:
<comment>When moveEvent returns false (no optimistic update), the event keeps the dragged offset because top/left never reset, leaving it stuck in the wrong position. Please reset the motion values before clearing the drag state.</comment>
<file context>
@@ -222,7 +224,13 @@ export function DraggableEvent({
- moveEvent(deltaY, columnOffset);
+ // If moveEvent returned early without updating, clear drag state immediately
+ if (!moveEvent(deltaY, columnOffset)) {
+ dragEndPending.current = false;
+ removeDraggedEventId(item.event.id);
</file context>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
c886126 to
f68af30
Compare
Description
Keep elevated z-index until optimistic update completes by deferring the
removeDraggedEventIdcall. Events will stay above the grid lines.Screenshots / Recordings
Add screenshots or recordings here to help reviewers understand your changes.
Type of Change
Related Areas
Testing
Checklist
Notes
(Optional) Add anything else you'd like to share.
By submitting, I confirm I understand and stand behind this code. If AI was used, I’ve reviewed and verified everything myself.
Summary by cubic
Keeps dragged events above grid lines by applying explicit z-index classes during drag and adjusting timeline indicator stacking.
Written for commit 85805c7. Summary will update automatically on new commits.