Skip to content

Conversation

@rebelchris
Copy link
Contributor

@rebelchris rebelchris commented Jan 6, 2026

  • Add @dnd-kit/core, @dnd-kit/sortable, and @dnd-kit/utilities dependencies
  • Implement drag-and-drop sorting for shortcuts list (horizontal layout)
  • Implement drag-and-drop sorting for form inputs (vertical layout)
  • Sorting only enabled for custom links (manual mode)
  • Visual feedback during drag with reduced opacity
  • Changes persist automatically when reordering

🤖 Generated with Claude Code

Solves:
dailydotdev/daily#747

Changes

Events

Did you introduce any new tracking events?

Experiment

Did you introduce any new experiments?

Manual Testing

Caution

Please make sure existing components are not breaking/affected by this PR

Preview domain

https://claude-issue-5246-20260106-1154.preview.app.daily.dev

github-actions bot and others added 2 commits January 6, 2026 11:58
- Add @dnd-kit/core, @dnd-kit/sortable, and @dnd-kit/utilities dependencies
- Implement drag-and-drop sorting for shortcuts list (horizontal layout)
- Implement drag-and-drop sorting for form inputs (vertical layout)
- Sorting only enabled for custom links (manual mode)
- Visual feedback during drag with reduced opacity
- Changes persist automatically when reordering

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Chris Bongers <rebelchris@users.noreply.github.com>
@rebelchris rebelchris requested a review from idoshamun January 6, 2026 13:18
@rebelchris rebelchris requested a review from a team as a code owner January 6, 2026 13:18
@vercel
Copy link

vercel bot commented Jan 6, 2026

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

Project Deployment Review Updated (UTC)
daily-webapp Ready Ready Preview Jan 7, 2026 6:12am
1 Skipped Deployment
Project Deployment Review Updated (UTC)
storybook Ignored Ignored Jan 7, 2026 6:12am

@idoshamun
Copy link
Member

@claude don't we have already a drag and drop sortable functionality somewhere in the app? i'm not sure introducing new packages is needed

@claude
Copy link
Contributor

claude bot commented Jan 6, 2026

Claude finished @idoshamun's task in 1m 3s —— View job


Findings on existing drag-and-drop functionality

  • Search for existing drag-and-drop implementations in the codebase
  • Check for existing drag-and-drop dependencies in package.json files
  • Review the changes in this PR
  • Provide findings and recommendations

Analysis

You're right to question this! The codebase already has drag-and-drop functionality, but it's for a different use case:

Existing drag-and-drop implementation:

  • Location: packages/shared/src/features/fileUpload/hooks/useDragAndDrop.ts
  • Purpose: File upload via drag-and-drop (dragging files from desktop into the app)
  • Used in: CV upload, image upload, file attachments
  • Implementation: Native HTML5 drag-and-drop events (onDragEnter, onDragOver, onDrop)

This PR's drag-and-drop:

  • Purpose: Reordering/sorting items within the UI (horizontal shortcuts list + vertical form inputs)
  • Implementation: @dnd-kit library for sortable lists
  • Use case: User can grab and reorder shortcuts

Key Difference

The existing code handles external drag-and-drop (files from outside the browser), while this PR needs internal sortable lists (reordering items within the UI). These are fundamentally different patterns:

  1. File drop = Accept files from OS → Native HTML5 events are perfect
  2. Sortable list = Reorder items in a list → Requires complex collision detection, animations, keyboard accessibility

Native HTML5 vs Library for Sortable Lists

Building sortable lists with native HTML5 drag-and-drop is significantly more complex:

  • Need to track item positions during drag
  • Handle collision detection (which item is being hovered)
  • Manage visual feedback and animations
  • Support keyboard navigation (accessibility requirement)
  • Handle edge cases (dragging outside bounds, touch devices)

@dnd-kit solves all of this out of the box with accessibility built-in.

Recommendation

The @dnd-kit packages are appropriate here because:

  1. The existing drag-and-drop code serves a different purpose (file uploads)
  2. Building sortable lists from scratch would require ~300+ lines of complex code
  3. @dnd-kit is a well-maintained, accessible solution (8.7k GitHub stars)
  4. Total package size is reasonable: ~35KB gzipped for all 3 packages

However, if you want to minimize dependencies, you could:

  • Use native HTML5 draggable for basic sorting (but lose accessibility features)
  • Build a custom solution (but requires significant development time)

My take: Given daily.dev's startup philosophy of "move fast", using @dnd-kit is the pragmatic choice. The packages are small, widely used, and save development time.


@rebelchris rebelchris merged commit bb9ca35 into main Jan 7, 2026
11 checks passed
@rebelchris rebelchris deleted the claude/issue-5246-20260106-1154 branch January 7, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants