Nheko-Reborn / nheko

Desktop client for Matrix using Qt and C++20.
https://nheko-reborn.github.io/
GNU General Public License v3.0
1.93k stars 201 forks source link

add a global toggle for Pinned Messages default open/closed state #1230

Open darkralts opened 1 year ago

darkralts commented 1 year ago

The Problem

well, each time you go into a room on nheko the pins are set to always be open, but you can turn them off and it will save the state.

but what if someone wants to have the opposite?

nheko pins set to be always closed, but you can toggle it and it will save the state.

The Solution

i think the best option would be for a toggle of sorts. as if you flat out disable it, those who use pinned messages always on wouldnt be able to.

and i think good flexible software should have a decent degree of modularity/options to it.

so basically, it would look something like this.

Have pinned messages window in rooms open by default: ON/OFF

or a more suitable title if you so choose.

Alternatives

you currently can technically toggle each and every one you join and it will save locally, but if you reinstall nheko you have to do it all again, its just really unoptimal and i would prefer the pins to be closed unless i need them.

Additional context

i think this is important to be a toggle, instead of either or.

as i have heard a wide variety of opinions.

some people like to keep it on so they can see the rules of certain chats they are in, and i agree for that use case, that's useful.

other use cases that make sense for it off would be, if someone just doesn't use pinned messages at all, or doesn't like them opening as they'd rather just see and focus on the chat in the given moment, it could be annoying turning them off all the time.

some people want a really small and minimal window, like when you make Nheko small in the corner of your WM and it goes into minimal mode, it kind of makes the vertical space less compared to fullscreen Nheko, so anyone who doesn't use Nheko like that might not have realized.

also just for all the OCD gamers out there.

if i missed anything feel free to add in the comments ^^ thanks

Happens in the latest version

darkralts commented 10 months ago

any update or willingness to re return to this? i love nheko and would love a feature like this : 3

LorenDB commented 10 months ago

@darkralts sounds useful to me. If I have time in the next few days I'll whip up a PR.

darkralts commented 4 months ago

thank you, any progress? @LorenDB

LorenDB commented 4 months ago

Sorry, forgot about this and life got in the way :/ No promises, but I will set a reminder to get around to doing this :D

darkralts commented 4 months ago

its ok :D i highly appreciate you doing this ^~^

darkralts commented 3 months ago

heyo @LorenDB im willing to do it if you can tell me specifically what i should do/where i should look in the code :D

my experience is pretty little tho so, idk how good i can do it

LorenDB commented 3 months ago

Ah yes, I keep not doing this.

The main part I'm hung up on is figuring out how to handle rooms that are individually toggled apart from the global setting. Currently we just store a list of rooms that have pins toggled off; this will have to be converted into a map that explicitly states whether a room has pins on or off. I'm not sure if we want to store that state permanently though; in other words, if I have a room with pins turned off and then I change the global setting to have pins off, should that clear that room from the list?

Maybe I'm overthinking this though.

darkralts commented 3 months ago

ah i see, hmm,

that is a pretty good point,

i think it should be fine to keep the list, for when the global setting is set to pins off by default, it would only affect those rooms not in the list yet.

in other words i think it should be like, the user individually toggled ones should take priority, if a user has a room specifically set for pins open, i feel it should honor that regardless of the global toggle, same with if they want them closed, for if they have the toggle set for all open. etc.

but if its just some random room etc that you come across, or you just have a lot of rooms, and you don't want to toggle all those pins(aka pins that have not been touched by you, just default behaviour), i feel that should respect the global option and would be a good use case :)

also maybe a button to clear saved pins to eliminate confusion in some certain scenarios (or a way to look at the list? what do you think?)