nioc / xmpp-web

Lightweight web chat client for XMPP server
GNU Affero General Public License v3.0
142 stars 20 forks source link

Set presence on window focus #77

Closed singpolyma closed 1 year ago

singpolyma commented 1 year ago

Describe the solution you'd like

On window blur, set to away ("Window not active") on window focus set to online.

nioc commented 1 year ago

Hello, may be a good idea. I am not sure we should set away status immediately or after a timer (which is more complex to implement)?

What is the behavior of others XMPP client?

nioc commented 1 year ago

@Ppjet6 what do you think about this?

Ppjet6 commented 1 year ago

I don't know if I would personally want this kind of feature for privacy reasons, but let me not stop you if that's something you want for your client. I won't be of much help here as I generally try to stay available always. I have poked people here and there to get an idea.

Ppjet6 commented 1 year ago

From a first glance:

nioc commented 1 year ago

I propose we could have a specific "auto" value which automatically set away/online presence based on the window focus. In order to respect user privacy, he/she will have to set manually this value.

image

Does it sounds good for everyone?

singpolyma commented 1 year ago

@nioc that's probably a good step yeah. Then we can probably override for guests with smaller local edits if we need to

nioc commented 1 year ago

I've found a better UI using a switch:

image

Looking for add it to guest to.

nioc commented 1 year ago

Not so easy... presence is build with as navbar item, without navbar (guest) rendering is broken. I have to think about it.

nioc commented 1 year ago

Done! I needed to refactor presence dropdown in a dedicated component and juggle with two kind of Bulma components (dropdown and navbar item).