fix: Folder Sequencing When we try to move any folder at the bottom of the folders list#8722
fix: Folder Sequencing When we try to move any folder at the bottom of the folders list#8722ravindra-bruno wants to merge 4 commits into
Conversation
…f the folders list
…void sibling-prefix false positives
…dge zones (BRU-1112) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
b30a37b to
256f0cb
Compare
WalkthroughCollection drag-and-drop now uses shared utilities for drop-position resolution, pathname validation, and sequence reordering. UI handlers, Redux actions, styling, and tests were updated to use ChangesCollection drag-and-drop
Estimated code review effort: 4 (Complex) | ~45 minutes Suggested reviewers: Poem
Sequence Diagram(s)sequenceDiagram
participant DragMonitor
participant CollectionItem
participant CollectionUtilities
participant CollectionsActions
DragMonitor->>CollectionItem: provide hover geometry and client offset
CollectionItem->>CollectionUtilities: resolve dropType and validate item
CollectionUtilities-->>CollectionItem: above, inside, or below
CollectionItem->>CollectionsActions: dispatch collection item drop
CollectionsActions->>CollectionUtilities: reorder target directory with dropType
CollectionUtilities-->>CollectionsActions: normalized sequence values
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js`:
- Around line 1270-1271: Update the stale comments in
packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js:1270-1271
and
packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js:272-273
to use the current dropType terminology, referring to above/below in the
sequence-update comment and above in the collection line-indicator comment; make
no code changes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: fb1bc5d4-0d98-46d3-ada0-34c56913cc46
📒 Files selected for processing (5)
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/index.jspackages/bruno-app/src/providers/ReduxStore/slices/collections/actions.jspackages/bruno-app/src/utils/collections/index.jspackages/bruno-app/src/utils/tests/collections/drag-and-drop.spec.js
| // Update sequences in the target directory (if dropping adjacent) | ||
| if (dropType === 'adjacent') { | ||
| if (dropType === 'above' || dropType === 'below') { |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Stale "adjacent" comments left over from the dropType rename. Both comments describe the exact lines this PR rewrote to use 'above'/'below' instead of the old 'adjacent' dropType, but still reference the removed term.
packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js#L1270-L1271: update the comment// Update sequences in the target directory (if dropping adjacent)to reference'above'/'below'instead of "adjacent".packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js#L272-L273: update the comment// For collections, show line indicator (adjacent drop)to reference the new'above'dropType instead of "adjacent drop".
📍 Affects 2 files
packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js#L1270-L1271(this comment)packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js#L272-L273
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js`
around lines 1270 - 1271, Update the stale comments in
packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js:1270-1271
and
packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js:272-273
to use the current dropType terminology, referring to above/below in the
sequence-update comment and above in the collection line-indicator comment; make
no code changes.
| @@ -1267,7 +1268,7 @@ export const handleCollectionItemDrop | |||
| } | |||
|
|
|||
| // Update sequences in the target directory (if dropping adjacent) | |||
There was a problem hiding this comment.
If the droptype is removed from adjacent and is now above or below, then change the comments to reflect the same
JIRA: BRU-1112
Description
Contribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.
Summary by CodeRabbit
New Features
Bug Fixes
Tests