Skip to content

Add draggable handle to color picker modal#324

Merged
tracygardner merged 1 commit intomainfrom
claude/add-colour-picker-drag-handle-zC7rM
Feb 26, 2026
Merged

Add draggable handle to color picker modal#324
tracygardner merged 1 commit intomainfrom
claude/add-colour-picker-drag-handle-zC7rM

Conversation

@tracygardner
Copy link
Contributor

Summary

Added a draggable handle to the top of the color picker modal, allowing users to reposition the picker within its parent container.

Key Changes

  • New drag handle element: Added a visual drag handle bar at the top of the color picker with a grab cursor and hover effects
  • Drag functionality: Implemented setupDragHandle() method that enables pointer-based dragging with boundary constraints to keep the picker within the parent container
  • Layout restructuring: Wrapped the color picker body in a new .color-picker-inner div to accommodate the drag handle while maintaining existing styling
  • Styling updates:
    • Moved padding from .color-picker-content to .color-picker-inner to allow the drag handle to span full width
    • Added styles for the drag handle with grab/grabbing cursor states and visual feedback on hover/focus
    • Included a decorative pseudo-element (::before) showing drag indicator lines

Implementation Details

  • Uses pointer events (pointerdown, pointermove, pointerup, pointercancel) for robust cross-device support
  • Implements pointer capture to ensure smooth dragging even when pointer moves outside the handle
  • Constrains picker position to prevent dragging outside parent container bounds
  • Drag handle is marked with aria-hidden="true" as it's purely decorative/interactive UI chrome

https://claude.ai/code/session_018sNko4Gf8XTY6McSCb63n5

Adds an 8px horizontal drag bar at the top of the colour picker panel,
styled to match the vertical resizer between editor panels: grey (#aaa)
background, a centred grip indicator (30×3px), and colour-focus highlight
on hover/active/focus. Pointer-event dragging lets users reposition the
picker freely within the canvas area.

https://claude.ai/code/session_018sNko4Gf8XTY6McSCb63n5
@tracygardner tracygardner merged commit b20abbd into main Feb 26, 2026
5 checks passed
@tracygardner tracygardner deleted the claude/add-colour-picker-drag-handle-zC7rM branch February 26, 2026 13:48
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.

2 participants