Add infrastructure and settings for controlling the Review Board theme.
Review Request #13724 — Created April 10, 2024 and submitted
Review Board 7 introduces the beginnings of theme support. We'll be
supporting Light, Dark, and System (Auto Light/Dark) themes, but the
idea is to later allow for the possibility of more flexibility here
(such as High Contrast and maybe even custom themes).Users can make their choice in My Account -> Appearance. The default is
the traditional Light Mode, with all other modes listed as Beta.
Eventually, once Dark Mode is stabilized, the plan is to set System as
the default. For this reason, "default" is a mode of its own, mapping
internally to the default mode. A siteconfig setting can be specified to
choose a custom default.Internally, this is all backed by a new app module:
reviewboard.themes
. This contains a sub-module,
reviewboard.themes.ui
, which defines aBaseUITheme
, each theme
implementation, and aUIThemeRegistry
. These are picked up by the form
and used to offer selections. The theme classes supply attributes for
the<html>
tag to enable Ink theme selection.This is one half of the theme implementation. The second part will
introduce syntax highlighting themes.
Unit tests pass.
Tested all the themes, making sure they applied, set the right
attributes, and took effect.
Summary | ID |
---|---|
da7e15615fdc3b852351532b953841bfc8b3a77e |
Description | From | Last Updated |
---|---|---|
Rather than have a new page for this, I feel like we should rearrange the existing "Settings" page a bit: … |
david |
- Change Summary:
-
Added missing
Version Added
toProfile.ui_theme_id
. - Commits:
-
Summary ID 375af4174c6fe671198394ee501c32fe0bbcec50 a89a21af8bee7785cbf5f35c7a209df2aed8cc07 - Diff:
-
Revision 2 (+1266 -20)
Checks run (2 succeeded)
-
Meant to ask this in my last review -- do the themes apply right away when selecting them on the form? Or do they only apply after saving the form? It would be nice to show a preview of the selected theme somehow, by having the theme apply to the page right away when selecting it. Or you could show a little picture of the theme similar to how GitHub does.
-
-
Rather than have a new page for this, I feel like we should rearrange the existing "Settings" page a bit:
Appearance
(o) Default appearance (Light mode)
( ) Dark mode (beta)
( ) Use system theme (beta)[x] Enable syntax highlighting for the diff viewer
General Settings
Time Zone
[x] Always open an issue when the comment box opens
[x] Always use markdown for text fieldsNotifications
...
- Change Summary:
-
- Updated to have themes set
data-ink-color-scheme
instead ofdata-theme
(see /r/13726/). - They also now set
data-theme
toBaseUITheme.name
. - Theme names are now localizable.
- The "Appearance" page has been moved below "Settings".
- Updated to have themes set
- Commits:
-
Summary ID a89a21af8bee7785cbf5f35c7a209df2aed8cc07 da7e15615fdc3b852351532b953841bfc8b3a77e - Diff:
-
Revision 3 (+1326 -22)