-
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
Fix/31677 amend themecolors imports in utils #32264
Fix/31677 amend themecolors imports in utils #32264
Conversation
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
@@ -27,11 +29,11 @@ const propTypes = { | |||
targetHeight: PropTypes.number.isRequired, | |||
|
|||
/** Any additional amount to manually adjust the horizontal position of the tooltip. | |||
A positive value shifts the tooltip to the right, and a negative value shifts it to the left. */ | |||
A positive value shifts the tooltip to the right, and a negative value shifts it to the left. */ |
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.
Is this extra space necessary ?
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.
my Webstorm sometimes do such things 😅 But prettier didn't complain. Removing them
shiftHorizontal: PropTypes.number, | ||
|
||
/** Any additional amount to manually adjust the vertical position of the tooltip. | ||
A positive value shifts the tooltip down, and a negative value shifts it up. */ | ||
A positive value shifts the tooltip down, and a negative value shifts it up. */ |
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.
Is this extra space necessary ?
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.
looking good, just one question, why the theme and styles parameters for StylesUtils function are in different places like sometimes they are first sometimes they are in the middle and other at the end? I believe its related to default parameters but just making sure 😄
yep, I started adding them before the default params, but then added them as first in some places. Maybe it would be a good idea to pass them first always? |
Yes, i also think we should always put it in first place for util functions that use styles/theme. We can also think about changing such functions to named parameters? (or maybe all?) cc @grgia |
@chrispader ok, so I will change the order. For making them all named params - I like the idea but maybe we could do this as a follow-up? wdyt? |
export default withTheme( | ||
withThemeStyles( |
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 curiosity, what's the difference between withTheme
and withThemeStyles
?
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.
from withTheme
you get just colors, from withThemeStyles
other styles
src/styles/StyleUtils.ts
Outdated
@@ -192,17 +186,10 @@ function getAvatarSize(size: AvatarSizeName): number { | |||
/** | |||
* Return the height of magic code input container | |||
*/ | |||
function getHeightOfMagicCodeInput(): ViewStyle { | |||
function getHeightOfMagicCodeInput(styles: typeof defaultStyles): ViewStyle { |
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.
function getHeightOfMagicCodeInput(styles: typeof defaultStyles): ViewStyle { | |
function getHeightOfMagicCodeInput(styles: ThemeStyle): ViewStyle { |
We can use ThemeStyle
for this, wdyt about applying to the other functions?
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.
I'll try, for one of the previous PR I tried it somewhere else, but TS was not happy with that
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.
Yes, let's use ThemeStyle
type from @styles/styles
. Also, can we please rename it to ThemeStyles
to match other types of this kind
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.
@chrispader you mean to rename the type?
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.
I think we could try to standartise the theme
and style
param ordering. Some functions are using them in the beginning, others in the middle, others in the end of the params. Wdyt what changing to be always at the first param @koko57 ?
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.
yep, maybe styles, theme
? (alphabetically 😅) and then other params
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.
Sounds good to me!
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.
Let's do theme, styles
. styles
depend on theme
, which implicates kind of an order like ThemePreference > Theme > ThemeStyles
yes! |
@cubuspl42 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] |
@grgia @chrispader a lot of files were changed, looks a bit daunting in terms of testing, but fortunately a big part of components affected are used in the Report Screen |
@koko57 in regards to testing, we can mainly aim to make sure theres no errors or crashes on all platforms |
@@ -333,7 +333,7 @@ function BaseTextInput(props) { | |||
!isMultiline && Browser.isMobileChrome() && {boxSizing: 'content-box', height: undefined}, | |||
|
|||
// Stop scrollbar flashing when breaking lines with autoGrowHeight enabled. | |||
props.autoGrowHeight && StyleUtils.getAutoGrowHeightInputStyle(textInputHeight, maxHeight), | |||
props.autoGrowHeight && StyleUtils.getAutoGrowHeightInputStyle(textInputHeight, maxHeight, styles), |
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.
Getting an error when I update a description of a transaction
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.
StyleUtils.ts:313 Uncaught TypeError: Cannot read properties of undefined (reading 'paddingTop')
at Module.getAutoGrowHeightInputStyle (StyleUtils.ts:313:1)
at BaseTextInput (index.js:308:29)
at renderWithHooks (react-dom.development.js:16175:1)
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.
thanks! on it!
@koko57 looks like we need to run prettier too |
@grgia all fixed! |
function getEmptyAvatarStyle(size: EmptyAvatarSizeName): ViewStyle | undefined { | ||
return emptyAvatarStyles[size]; | ||
} | ||
|
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.
@grgia @chrispader FYI: I deleted this function as I could not find its usage anywhere
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.
let me know if it should be restored
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.
If its unused, all good to remove!
@grgia fixed! |
@koko57 Does this seem related? |
I'll check it |
This seems to be different from staging. @allroundexperts this is already on main, but investigating |
@allroundexperts both |
@koko57 can you merge main? I think the tabs is fixed on main |
@grgia main merged! found hopefully last one with old theme - pushing in a minute |
@chrispader @grgia so the last imports left are those in storybook, but we agreed we're not doing it now |
@koko57 yes, I can create a separate issue for storybook |
@koko57 might need one more prettier run! |
@grgia done! |
@allroundexperts bump on review! |
On it! |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2023-11-30.at.9.29.47.PM.movAndroid: mWeb ChromeScreen.Recording.2023-11-30.at.9.25.07.PM.moviOS: NativeScreen.Recording.2023-11-30.at.9.28.31.PM.moviOS: mWeb SafariScreen.Recording.2023-11-30.at.9.27.21.PM.movMacOS: Chrome / SafariScreen.Recording.2023-11-30.at.9.05.05.PM.movMacOS: DesktopScreen.Recording.2023-11-30.at.9.21.32.PM.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.
Works good.
Note: I just tested for console errors / crashes on the components mentioned in the PR description. I did not check for UI bugs.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
In
|
@chrispader thanks! and sorry for that! |
🚀 Deployed to staging by https://github.com/grgia in version: 1.4.7-0 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.4.7-4 🚀
|
Details
Fixed Issues
$ #32255
PROPOSAL:
Tests
Areas of the app affected - verify if app doesn’t crash and the elements are displayed correctly:
Most of them are visible on the Report Screen
Offline tests
QA Steps
Areas of the app affected - verify if app doesn’t crash and the elements are displayed correctly:
Most of them are visible on the Report Screen
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
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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop