-
Notifications
You must be signed in to change notification settings - Fork 11.5k
feat: Add drag & drop reordering for event types #26408
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
base: main
Are you sure you want to change the base?
Conversation
|
@Manas-Kenge is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
|
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details: |
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.
2 issues found across 3 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="apps/web/modules/event-types/views/event-types-listing-view.tsx">
<violation number="1" location="apps/web/modules/event-types/views/event-types-listing-view.tsx:417">
P2: The `handleReorder` callback calls `mutation.mutate` on every order change during drag, which could result in multiple API calls. Consider debouncing the mutation call to only persist the final order after drag ends or after a short delay.</violation>
</file>
<file name="packages/features/package.json">
<violation number="1" location="packages/features/package.json:28">
P2: Consider using a pinned version (`12.23.26`) instead of caret notation (`^12.23.26`) for consistency with other direct dependencies in this file. Caret ranges can lead to different versions being installed across environments/time, making bugs harder to reproduce.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
apps/web/modules/event-types/views/event-types-listing-view.tsx
Outdated
Show resolved
Hide resolved
dhairyashiil
left a 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.
Please address both comments from Cubic, especially the one about package.json
Also, test this behavior on tablet and mobile screens and attach videos showing the results.
There is no reordering of event types with arrows for mobile right now, so I haven't added it for drag & drop either. Should I add it? It works on tablet |
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 3 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="apps/web/modules/event-types/views/event-types-listing-view.tsx">
<violation number="1" location="apps/web/modules/event-types/views/event-types-listing-view.tsx:1022">
P2: Use `htmlFor` instead of `for` in JSX. The `for` keyword is reserved in JavaScript, and React requires `htmlFor` for the HTML `for` attribute. This regression breaks the label-input association and hurts accessibility.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
apps/web/modules/event-types/views/event-types-listing-view.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
dhairyashiil
left a 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.
could you please resolve merge conflicts?
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 3 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="apps/web/modules/event-types/views/event-types-listing-view.tsx">
<violation number="1" location="apps/web/modules/event-types/views/event-types-listing-view.tsx:352">
P2: The `useEffect` that syncs `pages` to `flattenedEventTypes` will overwrite local drag state if the server refetches mid-drag (e.g., on window focus). Consider guarding the sync to skip when there's a pending order:
```javascript
useEffect(() => {
if (!pendingOrderRef.current) {
setFlattenedEventTypes(pages?.flatMap((page) => page.eventTypes) ?? []);
}
}, [pages]);
```</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
|
@dhairyashiil can you review this? |
|
@anikdhabal can you review this pls? |
What does this PR do?
Visual Demo
Screencast.from.2026-01-03.12-47-01.mp4
The lag seen here is due to my laptop, should not affect prod
Screencast.from.2026-01-03.12-48-28.mp4
Mandatory Tasks (DO NOT REMOVE)
Summary by cubic
Adds drag & drop reordering to the Event Types list so users can quickly arrange items. Implements the CAL-3514 requirement and replaces the old up/down controls.
New Features
Dependencies
Written for commit 56de4d6. Summary will update on new commits.