31695 theme switching composer#31831
Conversation
|
added some fixes |
chrispader
left a comment
There was a problem hiding this comment.
LGTM, just a few minor naming comments :)
| import ContainerComposeStyles from './types'; | ||
|
|
||
| const containerComposeStyles: ContainerComposeStyles = [styles.textInputComposeSpacing]; | ||
| const containerComposeStyles: ContainerComposeStyles = (stylesObject) => [stylesObject.textInputComposeSpacing]; |
There was a problem hiding this comment.
can we rename this to just styles? :)
There was a problem hiding this comment.
@lukemorawski would you be able to update with this change today?
|
|
||
| // We need to set paddingVertical = 0 on web to avoid displaying a normal pointer on some parts of compose box when not in focus | ||
| const containerComposeStyles: ContainerComposeStyles = [styles.textInputComposeSpacing, {paddingVertical: 0}]; | ||
| const containerComposeStyles: ContainerComposeStyles = (stylesObject) => [stylesObject.textInputComposeSpacing, {paddingVertical: 0}]; |
| import styles from '@styles/styles'; | ||
|
|
||
| type ContainerComposeStyles = ViewStyle[]; | ||
| type ContainerComposeStyles = (stylesObject: typeof styles) => ViewStyle[]; |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
chrispader
left a comment
There was a problem hiding this comment.
Thanks for the changes :) LGTM
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
| import RNTextInput from '@components/RNTextInput'; | ||
| import * as ComposerUtils from '@libs/ComposerUtils'; | ||
| import themeColors from '@styles/themes/default'; | ||
| import {useTheme} from '@styles/themes/useTheme'; |
There was a problem hiding this comment.
I'm seeing the following error after I synced with main
Shouldn't this be
import useTheme from '@styles/themes/useTheme';There doesn't seem to be a named export called useTheme here: src/styles/themes/useTheme.ts
There was a problem hiding this comment.
I'm seeing the same thing. @lukemorawski why are there no testing steps and no screenshots on this PR?
There was a problem hiding this comment.
I'm seeing the same thing. @lukemorawski why are there no testing steps and no screenshots on this PR?
Maybe because QA team cannot test this PR without switching to light theme which is not enabled yet.
But it would have been better to test in all platforms though this is very simple PR. Or have C+ review and test - should the bug have been caught earlier before merge.
There was a problem hiding this comment.
sorry, wrong auto import! fixed now
There was a problem hiding this comment.
Is there a PR that fixes this already?
There was a problem hiding this comment.
I understand this PR doesn't enable or change any functionality, but it does refactor theming in several components. We should always test these changes even if the test is a super simple "view each component and verify styling is still working". That would have been enough to catch small errors. QA regression testing should catch anything more complex.
@lukemorawski please don't cut corners and test on all platforms even for the simple stuff. I know it's annoying, but it's worth the time 🙇.
There was a problem hiding this comment.
should have catched this in the review as well, sorry for that! 🫠
There was a problem hiding this comment.
totally agree, sorry again for that
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.6-2 🚀
|

Details
This PR refactors the code to use dynamic theme/styling object, by using useThemeStyles and useTheme hooks in favor of static imports, to enable app wide theme switching.
Fixed Issues
$ #31695
PROPOSAL: no proposal
Tests
apply this diff to test light theme
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)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
no screenshotsAndroid: mWeb Chrome
no screenshots
iOS: Native
no screenshots
iOS: mWeb Safari
no screenshots
MacOS: Chrome / Safari
no screenshots
MacOS: Desktop
no screenshots