Skip to content

Conversation

zamoore
Copy link
Contributor

@zamoore zamoore commented Jul 7, 2025

πŸ“Œ Summary

If merged, this PR will add support for column reordering to the AdvancedTable component.

πŸ› οΈ Detailed description

  • Initial column order will be derived from whatever order the columns array is in OR may be explicitly set by passing in a columnOrder argument as an override.
  • Added throttling via the requestAnimationFrame API to both resize and reorder actions. This helps prevent stuttering when these actions are being performed.
  • After reordering, the optional onColumnReorder callback function will be called with an array of column keys in the newly updated order.
  • Adds additional items to the column context menu for
    • Moving a column to terminal positions (beginning/end)
    • Move column - Enables keyboard movement via the reorder handle component

πŸ“Έ Screenshots

toggle

πŸ”— External links

Jira ticket: HDS-4588
Figma file: [if it applies]


πŸ‘€ Component checklist

πŸ’¬ Please consider using conventional comments when reviewing this PR.

πŸ“‹ PCI review checklist
  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
  • If applicable, I've worked with GRC to document the impact of any changes to security controls.
    Examples of changes to controls include access controls, encryption, logging, etc.
  • If applicable, I've worked with GRC to ensure compliance due to a significant change to the in-scope PCI environment.
    Examples include changes to operating systems, ports, protocols, services, cryptography-related components, PII processing code, etc.

Copy link

vercel bot commented Jul 7, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
hds-showcase Ready Ready Preview Sep 15, 2025 3:14pm
hds-website Ready Ready Preview Sep 15, 2025 3:14pm

dchyun
dchyun previously approved these changes Sep 11, 2025
Copy link
Contributor

@dchyun dchyun left a comment

Choose a reason for hiding this comment

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

🟒 🟒 🟒
🟒 🚒 🟒
🟒 🟒 🟒

Copy link
Contributor

@shleewhite shleewhite left a comment

Choose a reason for hiding this comment

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

ok I hate to do this but I found a teeeeeeeny styling bug

the fantom border is still showing up on the reorder handle if you have a sticky header that is scrolled a bit down. it goes away when the header is not pinned.

Image

// If dropping to the right of the target, insert after the target
// If dropping to the left of the target, insert before the target
// Adjust for the shift in indices caused by removing the source column
const adjustedIndex =
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: this is totally a style thing that you are more than welcome to ignore, but I find these nested ternaries harder than necessary to understand. I'd just opt for an if statement here.

@zamoore
Copy link
Contributor Author

zamoore commented Sep 15, 2025

ok I hate to do this but I found a teeeeeeeny styling bug

the fantom border is still showing up on the reorder handle if you have a sticky header that is scrolled a bit down. it goes away when the header is not pinned.

Image

@shleewhite

Alright, this one was a little tricky. This was the same kind of stacking context issue we were seeing with the pinnable column. I made a change to where the scroll shadow is rendered and updated the styles/js a bit. Let me know what you think of this approach.

Copy link
Contributor

@shleewhite shleewhite left a comment

Choose a reason for hiding this comment

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

WOOO! looks great 🚒

Copy link
Contributor

@dchyun dchyun left a comment

Choose a reason for hiding this comment

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

🚒 🎊

@zamoore zamoore merged commit 493a04c into main Sep 15, 2025
16 checks passed
@zamoore zamoore deleted the zamoore/AdvancedTable/column-reordering-2 branch September 15, 2025 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants