-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[No QA] [TS migration] Migrate 'useArrowKeyFocusManager.js' hook to TypeScript #29328
[No QA] [TS migration] Migrate 'useArrowKeyFocusManager.js' hook to TypeScript #29328
Conversation
src/hooks/useArrowKeyFocusManager.ts
Outdated
@@ -26,7 +34,7 @@ export default function useArrowKeyFocusManager({ | |||
disabledIndexes = CONST.EMPTY_ARRAY, | |||
shouldExcludeTextAreaNodes = true, | |||
isActive, | |||
}) { | |||
}: Config): [number, (index: number) => void] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kubabutkiewicz, maybe put it into a separate type
src/hooks/useArrowKeyFocusManager.ts
Outdated
* @param {Boolean} [config.shouldExcludeTextAreaNodes] – Whether arrow keys should have any effect when a TextArea node is focused | ||
* @param {Boolean} [config.isActive] – Whether the component is ready and should subscribe to KeyboardShortcut | ||
* @returns {Array} | ||
* @param config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line can be removed
@@ -2,19 +2,29 @@ import {useState, useEffect, useCallback, useMemo} from 'react'; | |||
import useKeyboardShortcut from './useKeyboardShortcut'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe migrate useKeyboardShortcut
hook in this PR as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blazejkustra useKeyboardShortcut
is migrated in this PR but its blocked by this PR
…s-migration/useArrowKeyFocusManager/hook
This looks good to me! A couple minor questions, no changes needed I think:
Thanks! |
Yes, C+ should do the reviewer checklist
No need, it can be migrated separately
@kubabutkiewicz Can you add some QA steps? |
|
@rushatgabhane @ One of you needs to 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] |
Added @rushatgabhane for C+ review, then will take one more look! |
thank you |
Bump on the review when you have time @rushatgabhane - thank you! |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-10-25.at.23.49.40.movMobile Web - SafariScreen.Recording.2023-10-26.at.00.43.03.movDesktopScreen.Recording.2023-10-26.at.01.45.18.movAndroidScreen.Recording.2023-10-26.at.01.46.55.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one question - the default value on new line 30 - onFocusedIndexChange = () => {},
- is that going to pose a problem with the onFocusedIndexChange?: (index: number) => void;
type since it doesn't have an index parameter?
If that's fine, though, I'm good to merge this! Thanks.
…s-migration/useArrowKeyFocusManager/hook
@dangrous it will not cause any problem since |
I wasn't sure if we would get errors since the default did not match the type. But that would show up on compile so I think we're okay? |
✋ 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/dangrous in version: 1.3.94-0 🚀
|
1 similar comment
🚀 Deployed to staging by https://github.com/dangrous in version: 1.3.94-0 🚀
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.3.94-2 🚀
|
🚀 Deployed to staging by https://github.com/dangrous in version: 1.3.95-0 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.95-9 🚀
|
Details
Fixed Issues
$ #24947
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
android.mp4
Android: mWeb Chrome
iOS: Native
ios.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4