Skip to content

Conversation

ac615223s5
Copy link
Contributor

closes #368
closes #299
closes #289

@ac615223s5 ac615223s5 changed the title Separate light and dark themes feat: separate light and dark themes Feb 12, 2025
@Tech-How
Copy link

Tech-How commented Apr 5, 2025

Will this be merged soon? I'm excited for it!

Copy link
Member

@sigaloid sigaloid left a 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

Comment on lines 630 to 634
pub theme: String,
pub theme_light: String,
#[revision(start = 1)]
pub theme_dark: String,
Copy link
Member

@sigaloid sigaloid Apr 6, 2025

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.

Comment on lines 27 to 29
#[serde(rename = "REDLIB_DEFAULT_THEME")]
#[serde(alias = "LIBREDDIT_DEFAULT_THEME")]
pub(crate) default_theme: Option<String>,
Copy link
Member

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?

@ac615223s5
Copy link
Contributor Author

ac615223s5 commented Apr 11, 2025

I made the changes but it doesn't compile anymore (error[E0560]: struct Preferences has no field named theme --> src\utils.rs:630:2 .
sorry, not familiar with that library. does anyone knew how to fix this?

@Tech-How
Copy link

Bump, could anyone help us out here?

@ac615223s5 ac615223s5 marked this pull request as draft August 29, 2025 20:13
@ac615223s5 ac615223s5 changed the title feat: separate light and dark themes feat: separate light and dark themes (help needed) Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants