feat: implement keyboard reordering for DraggableList#79793
feat: implement keyboard reordering for DraggableList#79793chuckdries merged 1 commit intoExpensify:mainfrom
Conversation
|
@chuckdries Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f666fd1b7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
79a1365 to
dbf221d
Compare
|
is this ready? If so @eVoloshchak can you review? |
|
Yeah, just need to add recordings for different devices |
|
@iwiznia PR ready |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppN/A Android: mWeb ChromeScreen.Recording.2026-01-20.at.16.50.03.moviOS: HybridAppN/A iOS: mWeb SafariScreen.Recording.2026-01-20.at.16.55.16.movMacOS: Chrome / SafariScreen.Recording.2026-01-20.at.16.44.59.mov |
trjExpensify
left a comment
There was a problem hiding this comment.
Can you make sure to test this on the Columns RHP on the Reports page, as that uses a draggable list as well?
Yes, works fine there too 79793-check.mp4 |
|
Great! |
iwiznia
left a comment
There was a problem hiding this comment.
Looks good!
@eVoloshchak can you ping me when you are done with the checklist?
eVoloshchak
left a comment
There was a problem hiding this comment.
Tests well on web/mobile web
However, this doesn't work on native platforms. I suspect this will require a follow-up PR if/when we decide to improve accessibility on native (on ios native keyboard just does nothing)
cc: @iwiznia, @MobileMage
|
@MobileMage can we include support for mobile here? |
Just to clarify, are you referring to external keyboard support on iOS/Android native (where currently the keyboard just does nothing)? If so, we would need to add VoiceOver/TalkBack custom accessibility actions (like "Move up" / "Move down") to the native DraggableList component since it uses react-native-draggable-flatlist which doesn't have keyboard sensor APIs.
I can start working on a solution for that too, would this need a new issue or should I add it to this PR? |
|
@MobileMage how much work would that be? I'm not against including it here if it's easy, but I notice that the mobile native apps don't have any concept of tab selection at all right now, and I'm not sure how common the use case of using an external keyboard with a phone or tablet is. Is our DnD currently usable for people who rely on VoiceOver/TalkBack? I also notice that this PR's keyboard ordering works in mobile safari, which seems like an acceptable workaround to me for users who need it, but curious to hear your thoughts |
|
@chuckdries I don't think it's necessary here. External keyboards on mobile are pretty rare, mobile Safari already works, and native doesn't even have tab selection. Adding accessibilityActions would be a new pattern for the app since it's not used anywhere currently. If it becomes a priority we can track it separately, but I don't think it makes sense to expand this PR's scope for such an edge case. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/chuckdries in version: 9.3.6-0 🚀
|
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.3.6-4 🚀
|
Explanation of Change
Add keyboard-accessible reordering to the
DraggableListcomponent by registeringKeyboardSensorwithsortableKeyboardCoordinates. This enables screen reader users to reorder waypoints using keyboard shortcuts (Space to drag, arrow keys to move, Space/Enter to drop).Additionally, to ensure Enter opens the waypoint editor (not activate drag), we configure
keyboardCodes.startto only use Space for drag activation, and handle Enter inSortableItemto click the inner interactive element.Inner focusable elements are removed from the tab order so there's only one Tab stop per item.
Fixed Issues
$ #79247
PROPOSAL: #79247 (comment)
Tests
Offline tests
N/A - keyboard reordering is a UI interaction that doesn't involve network requests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
79793-android-native.mp4
Android: mWeb Chrome
79793-android-mweb.mp4
iOS: Native
79793-ios-native.mp4
iOS: mWeb Safari
79793-ios-mweb.mp4
MacOS: Chrome / Safari
79793-web.mp4