-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Per User Dark Mode Preference #151507
Per User Dark Mode Preference #151507
Conversation
…-ref HEAD~1..HEAD --fix'
…-ref HEAD~1..HEAD --fix'
… to extract UserSettings
|
||
return result; | ||
} | ||
|
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.
The following methods are left stubbed to complete the interface. While not used currently, the savedObjectsClient
is available here for a future iteration of User Settings that may be stored/migrated to SO
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 the intention to create one SO per user to hold other User Settings? What's the benefit we'd get from doing so instead of storing every User Setting in the user's profile? Any known limitations?
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 don't think there are any limitations for for simple settings, like Dark Mode, being stored in the User Profile, but Im sure there could arise a scenario that wouldn't work.
In my initial meeting with the core team and discussions on my brainstorming doc, the team expressed that there might be a need to store User Settings in SO eventually, or at least, be able to migrate the settings from User Profiles to SO in the future.
I wanted the client to behave like the regular/global client so I included the methods stubbed so they would fulfill the interface and be available if we do need to move that direction
return UiSettingsClientFactory.create(options) as ClientType<T>; | ||
}; | ||
} | ||
|
||
private getUserClientFactory<T extends UiSettingsScope>(): ( | ||
savedObjectsClient: SavedObjectsClientContract, |
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.
See comment here
userSettingsServiceStart, | ||
uiSettingServiceStart, | ||
}: SetupUiSettingsServiceParams) { | ||
uiSettingServiceStart.setUserProfileSettingsClientFactoryProvider(() => () => { |
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 was following the ClientFactoryProvider
patter I saw utilized with the SO client, but this could probably be simplified.
Awesome start! I have added the design team as reviewers once you are ready. @MichaelMarcialis in particular worked on the profile screen design. |
…/user_profile.tsx Co-authored-by: Michael Marcialis <michael.l.marcialis@gmail.com>
…/user_profile.tsx Co-authored-by: Michael Marcialis <michael.l.marcialis@gmail.com>
description={ | ||
<FormattedMessage | ||
id="xpack.security.accountManagement.userProfile.themeFormGroupDescription" | ||
defaultMessage="Select the interface theme that you wish to apply across the platform." |
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 suggest cutting this down a bit. Here are some suggestions:
Select the appearance of your interface.
Select the theme to apply across the interface.
Select the them to apply across the platform.
Choose between a light or dark theme, or use the default system setting. (ok this is longer, but it is more specific)
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've switched it to the first option! Thanks for the suggestions.
<FormLabel for="data.userSettings.darkMode"> | ||
<FormattedMessage | ||
id="xpack.security.accountManagement.userProfile.userSettings.theme" | ||
defaultMessage="Theme mode" |
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.
Can this just say "Mode"
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.
Fixed in latest commit!
legend={i18n.translate( | ||
'xpack.security.accountManagement.userProfile.userSettings.themeGroupDescription', | ||
{ | ||
defaultMessage: 'Kibana Theme', |
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 don't know where this appears, but can we eliminate the word "Kibana"? Maybe "Elastic theme"? We typically use sentence case.
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.
Changed to Elastic theme
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 for making those changes, @kc13greiner! I'm leaving two last comments below for your re-review, but nothing that appears to be a show-stopper. Approving now so I don't hold you up, assuming you're able to address them.
- I had an open question/comment in my previous review regarding the space-level advanced setting for theme mode and the "Default" button wording. Any thoughts there? Per User Dark Mode Preference #151507 (comment)
/> | ||
} | ||
> | ||
<EuiFlexItem> |
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 believe this EuiFlexItem
can be removed (now that the parent EuiFlexGroup
was removed).
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.
Fixed in latest commit!
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
Public APIs missing exports
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
@kc13greiner ::thumbs-up:: |
Just for reference; I noticed there were some inconsistencies in the how dark mode was handled if it had been set in the Space vs. the user profile. #156362 |
Summary
Allow user's to set their desired theme on their User Profile
How to test
Login as a non-cloud user, navigate to User Profile:
Release Note
Users can now select their theme preference for Kibana in their User Profile