-
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
Theme switching: Add Theme to User Preferences (No QA) #21666
Theme switching: Add Theme to User Preferences (No QA) #21666
Conversation
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.
First pass review! I realize this is a WIP but here ya go
@sobitneupane 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] |
@sobitneupane please ignore this mention, @grgia is gonna review this |
@chrispader we need to add the header text and device settings options here's the mockup again: |
I understand your proposal, but this seems to not solve the root problem, does it? the value from Onyx may never be It should always either be undefined - in which case there is a Maybe i'm wrong here though.. |
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.
Screen.Recording.2023-07-11.at.10.26.20.AM.mov
Is there a reason we aren't saving the selection as part of this PR? Did you intend to add that to the going live?
@chrispader no, the ONYX key may not be set and will return '', in which case we default as if the user selected |
Yes, you suggested to put the saving/persisting logic into a separate PR here. Should i add it here instead? |
Reviewer Checklist
Screenshots/VideosMobile Web - Chromechrome not working on my emulator |
Co-authored-by: Georgia Monahan <[email protected]>
Co-authored-by: Georgia Monahan <[email protected]>
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.
Woot woot!
✋ 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/grgia in version: 1.3.40-0 🚀
|
); | ||
|
||
Navigation.navigate(ROUTES.SETTINGS_PREFERENCES); | ||
} |
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 hi, I think we want to replace the navigate
with goBack
, so we won't experience this kind of issue in the future.
I'm currently working on a PR to do this fix, but I can't access the theme page yet, so I'm leaving a note here so you can fix it in the next PR. Thanks!
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.
@bernhardoj the ThemePage
should now be available :)
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 I don't see it on the Preferences page, or is it on other page
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.
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.
Ah, I mean the page on the app, not the code 😅. If I manually create a button to navigate there, QA won't be able to test it.
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.
ah yea, makes sense.This is the PR that's gonna add the button, but it's gonna take some more time until we merge it, because we have to migrate the whole app to theme switching first
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.
Got it. Maybe you can apply this change replace the navigate with goBack
in your PR?
<HeaderWithBackButton | ||
title={props.translate('themePage.theme')} | ||
shouldShowBackButton | ||
onBackButtonPress={() => Navigation.navigate(ROUTES.SETTINGS_PREFERENCES)} |
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.
Same as above
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 if you haven't already applied these two changes to your PR, could you add an issue to the light mode project view to make sure we don't forget this?
🚀 Deployed to production by https://github.com/Julesssss in version: 1.3.40-5 🚀
|
@grgia
Details
Fixed Issues
$ #21020
PROPOSAL: GH_LINK_ISSUE(COMMENT)
Tests
We decided to extract the code for the menu entry for "Color theme" in
Settings -> Preferences
into a separate PR, in order to enable theme switching for the user, once every component is migrated to the new theme switching logic.That's why in order to test the changes of THIS PR, we'll need to manually add the changes for the menu entry from the other PR, to test the new screen.
In the
PreferencesPage
Add this to below the
MenuItemWithTopDescription
ofpreferredLocale
:Uncomment the
Settings_Preferences_Theme
entry inModalStackNavigators.js
:Settings -> Preferences
Dev Tools -> Application -> IndexedDB -> OnyxDB -> keyvaluepairs
)ThemePage
andPreferencesPage
) and the app's theme updates tooOffline tests
No additional tests needed.
QA Steps
No QA, this PR creates the theme settings page but does not yet add it to the app.
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
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android