feat(sort-handle): hide reorder group title when no sibling groups; disable boundary items instead of hiding#14033
feat(sort-handle): hide reorder group title when no sibling groups; disable boundary items instead of hiding#14033
Conversation
…isable items at boundaries Co-authored-by: ashetland <108549080+ashetland@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates the calcite-sort-handle dropdown UX to reduce visual noise (hide the “Reorder” group header when it’s the only group) and stabilize menu height (disable boundary reorder actions instead of conditionally hiding them). Also adjusts dropdown focus behavior to avoid targeting disabled/hidden items, and includes new E2E coverage for the updated sort-handle behavior.
Changes:
- Conditionally omits the reorder group title when there are no sibling groups, and always renders the 4 reorder actions with boundary items disabled.
- Adds E2E tests for reorder group title visibility and boundary disabled states.
- Updates dropdown initial-focus logic to use traversable (non-disabled/non-hidden) items.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/components/src/components/sort-handle/sort-handle.tsx | Hide reorder group title when it’s the only group; render reorder actions consistently and disable at boundaries. |
| packages/components/src/components/sort-handle/sort-handle.e2e.ts | Adds E2E coverage for group title visibility and disabled boundary actions. |
| packages/components/src/components/dropdown/dropdown.tsx | Ensures initial focus targets traversable dropdown items (avoids disabled/hidden). |
| package-lock.json | Large lockfile churn included in the PR. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| private async focusOnFirstActiveOrDefaultItem(): Promise<void> { | ||
| const selectedItem = this.getTraversableItems().find((item) => item.selected); | ||
| const traversableItems = this.getTraversableItems(); |
There was a problem hiding this comment.
@copilot can you add e2e browser tests for the changes to this file?
There was a problem hiding this comment.
@copilot can you revert the changes to the package-lock file?
|
@driskull Do we have story coverage for this or do we need to make new ones? |
|
@ashetland sort handle has stories. I think as part of our copilot instructions we should say to add relevant storybook stories to cover screenshot testing. cc @isaacbraun |
|
This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions. |
The sort-handle dropdown always showed the "Reorder" group label even when it was the only group, adding noise with no disambiguation value. Additionally, reorder items were hidden at boundary positions, causing the menu height to vary depending on item position.
Changes
sort-handle.tsxrenderReorderGroup(): Only setsgroupTitlewhen sibling groups (moveToItemsoraddToItems) are present — matches the Atlassian Pragmatic DnD design pattern referenced in issue discussionrenderDropdownItem(): Accepts an optionaldisabledparameterrenderTop/Up/Down/Bottom(): Always render all 4 items; disable at boundaries instead of hiding:sort-handle.e2e.tsOriginal prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.