How do you want disabeling community themes to work?

In a previous post , I talked about the new community themes feature.

From a lot of the commentors, I heard, that you wish, that you would like to have the ability to disable community themes from specific communities and not just in general.
I am currently planning on implementing that feature, but I am not quite shure, if you would like to be able to disable certain community themes on some of your devices, but not on others (which would mean storing that setting in a browser cookie) or if you want to disable community themes of certain communities for your entire user account, so that the setting is applied to all your devices at once (which would mean storing that setting in the database.

Feel free to share your opinion in more details in the comments!

Disable certain community themes only on one device at a time (store it as a cookie)
Disable certain community themes for your entire account (store it in the database)
Poll ends at .
Piefed just got a new "community theme" option, feel free to get creative with it!

For the newest piefed release, I worked on a new feature, that allows community admins to choose a "community theme", which overrides the users the…

I would think entire account personally. I can’t think of when I’d want it to be visible on my phone but not my PC.
Alright, thanks for the feedback!
I also agree with skavau. i often delete cookie. so i prefer a more lasting solution.

Speaking as someone who primarily used this option through RES when I used to browse Reddit, I generally would be fine with making it per device as a cookie BUT I found it increasingly helpful to simply be able to toggle it in the extension bar without leaving the page, so it’d be nice if it worked the same way in Piefed.

(Longshot; maybe the ability to do both? Toggle it once per session or forever on your account in your list of communities? That’s more of a nice to have not a necessity, though).

I wrote previously about how to put this in the session cookie, but if it is going to end up in the db, it probably makes sense to have it be a new table rather than adding a new column onto the user table. It can probably be a really simple table like CommunityBlock since this is essentially a style-only version of that (CommunityStyleBlock perhaps).

Some things to take note of while working on this:

  • Make sure to remove any of these rows that reference the user in User.delete_dependencies so that users can still be deleted. Just do it the same way we do for community blocks or any number of other tables.
  • Similarly, you need to add this to Community.delete_dependencies so that communities can still be deleted
  • To make things efficient, you can make a function to return all the blocked community styles for a particular user that can be cached (see app.utils.blocked_communities() as an example)
  • Make sure that whenever the community style blocks change (added or removed) that the cache is busted (again, using community blocks as an example): cache.delete_memoized(blocked_communities, user.id). This makes the next call refresh the result from the db rather than just pulling stale data from redis.

As for the UI (often the hardest part), I guess you will probably need some kind of button or form-control in the sidebar. Maybe a button like we do for Join/Leave currently or a checkbox and submit button? Not sure what would be best there.

All of that is just my idea for how to put this in the db anyway. @[email protected] probably has ideas as well or could tell you why all of this is crap.