fix: Arrow key navigation not working in Columns selection#78869
Conversation
|
@aimane-chnaif 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] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@TaduJR please merge main to see if it fixes perf tests failure |
…ng-in-Columns-selection
…ey-navigation-not-working-in-Columns-selection
…on' of https://github.com/TaduJR/App into fix-Arrow-key-navigation-not-working-in-Columns-selection
…ng-in-Columns-selection
Done all tests are passing. |
Done I though I was saying Reviewer Check List 😅 |
aimane-chnaif
left a comment
There was a problem hiding this comment.
Let's give this a try. Please be on a look out for any blockers on staging.
🫡 |
|
Checks are failing |
…ey-navigation-not-working-in-Columns-selection
…ation-not-working-in-Columns-selection
…ng-in-Columns-selection
|
Workflows are complete. |
Code ReviewArchitectureThe PR introduces a clean controlled/uncontrolled pattern for keyboard navigation in Issues1. In 2. Arrow keys active before container is focused In const isArrowKeyActive = isActive && (hasFocus || (isFocused && !hasBeenFocused));The 3. Space shortcut conflicts with native scroll Registering 4. In useLayoutEffect(() => {
itemKeysRef.current = itemKeys;
});A // No deps array: must update before SortableItem's useEffect calls .focus()
// so the focusin handler reads fresh item keys
useLayoutEffect(() => { ... });5. In const flags = item as DraggableItemFlags;This uses an unsafe cast. A type-safe alternative: return {
isDragDisabled: 'isDragDisabled' in item && !!(item as DraggableItemFlags).isDragDisabled,
isDisabled: 'isDisabled' in item && !!(item as DraggableItemFlags).isDisabled,
};Or better yet, use an 6. Missing integration tests for DraggableList keyboard nav The unit tests cover Minor Notes
|
|
Codex Review: Didn't find any major issues. Nice work! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
…ey-navigation-not-working-in-Columns-selection
JS00001
left a comment
There was a problem hiding this comment.
This seems extraordinarily complicated for a keyboard-based focus state (which we use all over the app). Why do we need all of these changes? Can you please give me a high level overview of why we needed to make all of these changes? Are there no existing patterns/solutions we can use?
…ey-navigation-not-working-in-Columns-selection # Conflicts: # src/components/DraggableList/SortableItem.tsx
…led by SortableItem
The main addition is focus scoping. Everything else follows existing conventions |
|
Thanks for the explanation @TaduJR , rereviewing now |
|
🚧 @JS00001 has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ 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/JS00001 in version: 9.3.40-0 🚀
|
|
🚀 Deployed to staging by https://github.com/JS00001 in version: 9.3.40-0 🚀
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.3.41-4 🚀
|

Explanation of Change
This PR adds arrow key navigation support to the DraggableList component
Fixed Issues
$ #78188
PROPOSAL: #78188 (comment)
Tests
Offline tests
Same as tests
QA Steps
Same as tests
// TODO: These must be filled out, or the issue title must include "[No QA]."
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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop
Screen.Recording.2026-01-06.at.12.02.23.in.the.morning.mov