Skip to content

chore: Add dnd drag buttons to list #3652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 15, 2025

Conversation

gethinwebster
Copy link
Member

@gethinwebster gethinwebster commented Jul 15, 2025

Description

Add pointer-only/"UAP" buttons to sortable list

Related links, issue #, if available: AWSUI-61051

How has this been tested?

New unit and integ tests

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link

codecov bot commented Jul 15, 2025

Codecov Report

❌ Patch coverage is 97.82609% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.02%. Comparing base (d76de1a) to head (24a5aa2).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
.../sortable-area/keyboard-sensor/utilities/scroll.ts 80.00% 1 Missing ⚠️
...ponents/sortable-area/use-drag-and-drop-reorder.ts 94.73% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3652   +/-   ##
=======================================
  Coverage   97.01%   97.02%           
=======================================
  Files         835      835           
  Lines       24142    24168   +26     
  Branches     8414     8500   +86     
=======================================
+ Hits        23422    23449   +27     
+ Misses        671      670    -1     
  Partials       49       49           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

just-boris
just-boris previously approved these changes Aug 7, 2025
Copy link
Member

@just-boris just-boris left a comment

Choose a reason for hiding this comment

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

Some code style related comments, but overall looks good

await page.expectAnnouncement('Moving item to position 2 of 6');

await page.click(page.wrapper.findModal().findContentDisplayPreference().findTitle().toSelector());
await expect(await page.containsOptionsInOrder(['Item 2', 'Item 1'])).toBe(true);
Copy link
Member

Choose a reason for hiding this comment

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

Could avoid an extra await

Suggested change
await expect(await page.containsOptionsInOrder(['Item 2', 'Item 1'])).toBe(true);
await expect(page.containsOptionsInOrder(['Item 2', 'Item 1'])).resolves.toBe(true);

describe('internal icon props', () => {
test('should prevent pointer events', () => {
const { container } = render(<InternalIcon name="add-plus" __preventPointerEvents={true} />);
expect(container.querySelector('span')).toHaveClass(styles['prevent-pointer-events']);
Copy link
Member

Choose a reason for hiding this comment

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

Can we use styles.icon selector instead of any span?

@@ -16,6 +16,7 @@ import styles from './styles.css.js';
type InternalIconProps = IconProps &
InternalBaseComponentProps & {
badge?: boolean;
__preventPointerEvents?: boolean;
Copy link
Member

Choose a reason for hiding this comment

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

is it possible to avoid modifying the icon for this case?

Can pointer-events be applied somewhere on a parent DOM node?

Copy link
Member Author

Choose a reason for hiding this comment

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

good idea, updated

@@ -18,23 +18,35 @@ import { EventName } from './utilities/events';
import { Listeners } from './utilities/listeners';
import { applyScroll } from './utilities/scroll';

// Slightly modified version of @dnd-kit's KeyboardSensor:
// Modified version of @dnd-kit's KeyboardSensor:
Copy link
Member

Choose a reason for hiding this comment

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

Do you think if at this point we should abandon idea of ever switching back to upstream and maintain this code as fully our own?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, I was basically seeing it as that, I'll update the comment to make that a bit clearer

just-boris
just-boris previously approved these changes Aug 15, 2025
@gethinwebster gethinwebster added this pull request to the merge queue Aug 15, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 15, 2025
@gethinwebster gethinwebster added this pull request to the merge queue Aug 15, 2025
Merged via the queue into main with commit fa5bdbd Aug 15, 2025
39 checks passed
@gethinwebster gethinwebster deleted the dev-v3-gethinw-list-sortable-dnd branch August 15, 2025 11:39
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