Skip to content

Conversation

@avinashbot
Copy link
Member

@avinashbot avinashbot commented Sep 24, 2025

Description

Screen.Recording.2025-09-26.at.11.53.37.mov

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

API changes

This PR adds a new property to the table's ariaLabels property:

   interface AriaLabels {
     ...
+   resizerTooltipText?: string;
     ...
   }

Let's consider the 👍s on this as approval for the API changes.

How has this been tested?

  • Relying on existing tests for dragging behavior, adding new tests for the UAPs. Dry-run build ID: 7533427216.
  • Visual changes tested in jowejowe's pipeline - noting unexpected
  • Bug bash: zb3AAbRNaDaY
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.

@codecov
Copy link

codecov bot commented Sep 25, 2025

Codecov Report

❌ Patch coverage is 97.14286% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.15%. Comparing base (46bf2fc) to head (e701a6b).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/table/resizer/index.tsx 96.52% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3892      +/-   ##
==========================================
- Coverage   97.16%   97.15%   -0.02%     
==========================================
  Files         850      850              
  Lines       24785    24872      +87     
  Branches     8735     8761      +26     
==========================================
+ Hits        24082    24164      +82     
+ Misses        696      659      -37     
- Partials        7       49      +42     

☔ 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.

const resizerToggleRef = useRef<HTMLButtonElement>(null);
const resizerSeparatorRef = useRef<HTMLSpanElement>(null);

const [isPointerDown, setIsPointerDown] = useState(false);
Copy link
Member Author

Choose a reason for hiding this comment

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

Making a distinction between isPointerDown and isDragging because we want to support a "click" interaction. Currently, a mousedown starts a drag and a mouseup ends it, which means, if you click the divider slightly off center, it jumps before showing the buttons, which looks really janky. So with this, the column widths are only adjusted when the mouse starts moving.

updateTrackerPosition,
]);

useEffect(() => {
Copy link
Member Author

Choose a reason for hiding this comment

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

We added both isDragging and isPointerDown to our dependencies in the useEffect above, which means this timer get destroyed and created twice. Not a problem for real users, but this really screws with tests (since jest's time-skipping timer methods won't work if the timer is recreated).

position: relative;
display: inline-block;
.contents {
display: contents;
Copy link
Member Author

Choose a reason for hiding this comment

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

Previously, the drag handle wrapper had three nested divs I had to contend with styling them all. Since two of those divs only exist for event handling/capture reasons, I can safely just set them to display: contents and only worry about styling one div.

if (event.button !== 0) {
return;
}
event.preventDefault();
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure why this behavior was there before, but clicking on the drag handle doesn't move focus to it. But now it does, like any regular button. Helps with simplifying the UAP logic, and is also nicer because you can switch between drag and keyboard.

@avinashbot avinashbot marked this pull request as ready for review September 25, 2025 14:35
@avinashbot avinashbot requested a review from a team as a code owner September 25, 2025 14:35
@avinashbot avinashbot requested review from gethinwebster and removed request for a team September 25, 2025 14:35
@avinashbot avinashbot force-pushed the table-resizable-column-uap branch from 3ec898d to 74517a2 Compare October 1, 2025 12:54
@johannes-weber johannes-weber added this pull request to the merge queue Oct 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Oct 14, 2025
@johannes-weber johannes-weber added this pull request to the merge queue Oct 14, 2025
Merged via the queue into main with commit 369c12b Oct 14, 2025
48 checks passed
@johannes-weber johannes-weber deleted the table-resizable-column-uap branch October 14, 2025 11:52
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.

3 participants