-
-
Notifications
You must be signed in to change notification settings - Fork 137
feat: separate light and dark themes #378
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
base: main
Are you sure you want to change the base?
Conversation
cc1d548
to
604aef1
Compare
Will this be merged soon? I'm excited for 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.
Preliminary glance-over review here, may do some more testing + reviewing before merge
src/utils.rs
Outdated
pub theme: String, | ||
pub theme_light: String, | ||
#[revision(start = 1)] | ||
pub theme_dark: String, |
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'm using the revision library here to specifically allow for reverse compatibility of parsed Preferences (that's the test that is currently failing). Try leaving theme
but making its derive tag #[revision(start = 1, end = 2)]
, then the new light and dark ones #[revision(start = 2)]
(and changing revision to 2 at the top of the Preferences struct). Once you get the tests passing, go to Redlib in an incognito browser and export a new Preferences string (with a revision of 2) and add it to the KNOWN_GOOD_CONFIGS
array.
src/config.rs
Outdated
#[serde(rename = "REDLIB_DEFAULT_THEME")] | ||
#[serde(alias = "LIBREDDIT_DEFAULT_THEME")] | ||
pub(crate) default_theme: Option<String>, |
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 there any way we can preserve this behavior so someone with the REDLIB_DEFAULT_THEME
env var set doesn't have to change it? Possibly by giving default_theme_light
and default_theme_dark
an alias of REDLIB_DEFAULT_THEME
in order to make it the default across both?
ee87f6b
to
482e698
Compare
I made the changes but it doesn't compile anymore ( |
closes #368
closes #299
closes #289