Skip to content

feat: draggable bounds#990

Merged
whoami-amrit merged 13 commits into
developfrom
feat/fe-misc
Dec 26, 2025
Merged

feat: draggable bounds#990
whoami-amrit merged 13 commits into
developfrom
feat/fe-misc

Conversation

@whoami-amrit

Copy link
Copy Markdown
Contributor
  • fix: bound movement of draggable to screen
  • chore: rm file from eslintignore

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the DraggableWrapper component to use native bounds constraint from the react-draggable library instead of custom boundary checking logic. The changes improve the positioning system by using screen-absolute coordinates instead of parent-relative positioning, and delegate boundary enforcement to the library's built-in bounds prop.

Key Changes:

  • Replaced controlled position state with defaultPosition and native bounds prop for boundary constraints
  • Refactored position calculations to use screen coordinates instead of parent-relative offsets
  • Removed deprecated layoutFixDelta parameter from the component API

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
src/Common/DraggableWrapper/types.ts Removed deprecated layoutFixDelta property from DraggableWrapperProps interface
src/Common/DraggableWrapper/DraggableWrapper.tsx Refactored to use defaultPosition with bounds constraint, simplified position calculations for screen coordinates, and added visibility handling for initial render
.eslintignore Removed DraggableWrapper.tsx from ESLint ignore list to enable linting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Common/DraggableWrapper/DraggableWrapper.tsx Outdated
Comment thread src/Common/DraggableWrapper/DraggableWrapper.tsx Outdated
Comment thread src/Common/DraggableWrapper/DraggableWrapper.tsx Outdated
Comment thread src/Common/DraggableWrapper/DraggableWrapper.tsx Outdated
Comment thread src/Common/DraggableWrapper/DraggableWrapper.tsx Outdated
Comment thread src/Common/DraggableWrapper/DraggableWrapper.tsx
Comment thread src/Common/DraggableWrapper/DraggableWrapper.tsx Outdated
Comment thread src/Common/DraggableWrapper/DraggableWrapper.tsx Outdated
Comment thread src/Common/DraggableWrapper/DraggableWrapper.tsx
Comment thread src/Common/DraggableWrapper/DraggableWrapper.tsx Outdated
Comment thread package-lock.json Outdated
Comment thread src/Common/DraggableWrapper/DraggableWrapper.tsx
AbhishekA1509
AbhishekA1509 previously approved these changes Dec 23, 2025
vivek-devtron
vivek-devtron previously approved these changes Dec 24, 2025
@whoami-amrit whoami-amrit merged commit bc1bafd into develop Dec 26, 2025
7 checks passed
@whoami-amrit whoami-amrit deleted the feat/fe-misc branch December 26, 2025 07:50
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.

6 participants