For the newest piefed release, I worked on a new feature, that allows community admins to choose a “community theme”, which overrides the users theme while they are browsing the specific community. This works for every user on piefed, that has the newest version, it unfortunately won’t show up on lemmy, because they have a completely different theming system.

There are already some cool themes to choose from (the themes, that the users could pick from before), but the idea with this, is that you can create your own themes for your community and propose it to our Codeberg repository. There are so many cool ways, to make your community stand out, I am imagining maybe a swirling background for a balatro community, a theme that makes posts looked like ripped out pages and a custom comic-book hand as a cursor for [email protected] or other comic communities, maybe the hercules, or irix theme for retro communities.

I am sure you have many ideas, that are even cooler and I really hope that piefed get’s even more wild and interresting with this update!

(PS: I know that the screenshot is of a lemmy community and that this wouldn’t work, it’s just meant as an example)

  • wjs018@piefed.wjs018.xyz
    link
    fedilink
    English
    arrow-up
    2
    ·
    5 days ago

    To do this on a per-community basis, it might make sense to store it in the session cookie rather than in the db. Look for instances of response.set_cookie and request.cookies.get to see other examples of where we do that.

    Some user settings are stored in the cookie to look at as an example; stuff like the compactness level, low bandwidth mode, etc. Basically anything that is set on a per-device basis rather than stored in the db.

    • DeckPacker@piefed.blahaj.zoneOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      5 days ago

      Disabling a particularly annoying theme seems to me like something you would wanna do on every device, no?

      Maybey it would make sense to store the user theme in a cookie though, because that is a thing, you may want to be different on different types of devices.

      Do you know, how long such a cookie lasts?

      • wjs018@piefed.wjs018.xyz
        link
        fedilink
        English
        arrow-up
        1
        ·
        4 days ago

        My thinking on a per-device basis was that themes might work better/worse in a mobile vs. desktop browser, so people might prefer different experiences, but I could see the other side of things as well. That was also the rationale for making compact mode be in the cookie rather than saved in the db.

        I honestly don’t know what the expiration of the session cookie is. It might depend on the browser. I think it is pretty long-lasting unless people clear their cache because I have definitely loaded up piefed instances after a long time and have still been logged in.

        As for technical details, to save space, it might make sense to make a key (maybe like ignore_comm_theme) be a comma-separated list of community id’s that people have unchecked the box. That means you can easily convert this to a list with split and then see if the currently requested community id is in that list. Being the id means that it is unique for the instance and avoids name collisions like the actual community name might have (how many linux communities do we have now). It also keeps things relatively small since the cookie has a pretty small size limit iirc.