这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@ccmdi
Copy link
Contributor

@ccmdi ccmdi commented Nov 2, 2025

Description

Keep elevated z-index until optimistic update completes by deferring the removeDraggedEventId call. Events will stay above the grid lines.

Screenshots / Recordings

Add screenshots or recordings here to help reviewers understand your changes.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • UI/UX update
  • Docs update
  • Refactor / Cleanup

Related Areas

  • Authentication
  • Calendar UI
  • Data/API
  • Docs

Testing

  • Manual testing performed
  • Cross-browser testing (if UI changes)
  • Mobile responsiveness verified (if UI changes)

Checklist

  • I’ve read the CONTRIBUTING guide
  • My code works and is understandable and follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in complex areas
  • I have updated the documentation
  • Any dependent changes are merged and published

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.

  • Bug Fixes
    • Use Tailwind classes in DragAwareWrapper to set z-99999 while dragging (via cn), ensuring events stay on top.
    • Add z-20 to the time indicator background to fix stacking with grid lines.

Written for commit 85805c7. Summary will update automatically on new commits.

@vercel
Copy link

vercel bot commented Nov 2, 2025

@ccmdi is attempting to deploy a commit to the analogdotnow Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link

coderabbitai bot commented Nov 2, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a 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;
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 2, 2025

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) =&gt; {
-    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

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a 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)) {
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 5, 2025

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>
Fix with Cubic

@vercel
Copy link

vercel bot commented Nov 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
analog Ready Ready Preview Comment Nov 14, 2025 4:45pm

@JeanMeijer JeanMeijer self-requested a review November 5, 2025 02:20
@JeanMeijer JeanMeijer changed the title fix(web): prevent events from appearing behind grid lines after drag fix(web): resolve z-index issue causing events to appear behind grid lines after drag Nov 14, 2025
@JeanMeijer JeanMeijer changed the title fix(web): resolve z-index issue causing events to appear behind grid lines after drag fix(web): resolve events to appear behind grid lines after drag Nov 14, 2025
@JeanMeijer JeanMeijer merged commit 26e5aa8 into analogdotnow:main Nov 14, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants