Presence (away/busy/offline) + user status support #28

Merged
blizzz merged 23 commits from nephros/harbour-nextcloud-talk:presence-color into master 4 months ago
nephros commented 9 months ago
Collaborator

PoC / rough version of displaying user status (presence) in the participants list.

As you will see from the code I'm not a programmer at all. Still, this seems to do what it should...

In case you don't like it, look at just the first patch (5424710515) which just shows online/offline status from QML, without any code changes.

PoC / rough version of displaying user status (presence) in the participants list. As you will see from the code I'm not a programmer at all. Still, this seems to do what it should... In case you don't like it, look at just the first patch (5424710515) which just shows online/offline status from QML, without any code changes.
nephros added 2 commits 9 months ago
blizzz reviewed 8 months ago
blizzz left a comment

That looks good, thanks! One issue with the "dnd" state, but nothing dramatic.

The only thing that comes to my mind how to do it differently is instead of adding text is to incorporate the state in the avatar component, for instance as a small indicator in a corner. This will save some horizontal space. Would you want to explore it? Otherwise I am happy to take it like this.

// 25CE Bullseye
if ( isOnline ) {
switch (presence) {
case 2: // away
Poster
Owner

I'd prefer to avoid bare numbers and use an enum instead. Would you want to give it a try or should I do shoot something in?

I'd prefer to avoid bare numbers and use an enum instead. Would you want to give it a try or should I do shoot something in?
Poster
Collaborator

Sure, would be better. I'll update.

Could take a bit, I don't actually speak C++ really.

Sure, would be better. I'll update. Could take a bit, I don't actually speak C++ really.
Poster
Collaborator

About the Avatar Overlay, that was my initial idea but I failed to get it right in QML.
So I fell back to the text/UTF8 character thing and called it a PoC.

I'll give it another shot though.

About the Avatar Overlay, that was my initial idea but I failed to get it right in QML. So I fell back to the text/UTF8 character thing and called it a PoC. I'll give it another shot though.
Poster
Collaborator

See 7af19edce5, presence is now indicated as a circle around the avatar.

See 7af19edce5, presence is now indicated as a circle around the avatar.
Poster
Owner

Woohoo, I'll check it out!

I don't actually speak C++ really.

Same for me, it's the first thing ever i've written in C++ :)

Woohoo, I'll check it out! > I don't actually speak C++ really. Same for me, it's the first thing ever i've written in C++ :)
blizzz marked this conversation as resolved
if (participantData.value("status").toString().contains("Away", Qt::CaseInsensitive))
model.presence = 2;
if (participantData.value("status").toString().contains("Busy", Qt::CaseInsensitive) || \
participantData.value("status").toString().contains("Do not disturb", Qt::CaseInsensitive) )
Poster
Owner

"Do not disturb" should be "dnd". Currently DnD participants appear as online.

The values are defined at: https://github.com/nextcloud/server/blob/master/lib/public/UserStatus/IUserStatus.php#L42-L66

I'd also use the casing as defined in the server (unlikely to change) and go with a case sensitive comparison. Micro-optimization ;)

It is also worth considering to keep the busy and dnd status seperated in the backend, and only treat them similarly in the QML frontend, in case there might be subtle differences in future. On the other hand, if there are subtle differences in future, they need to be baked in, too, so keeping this is also totally fine.

`"Do not disturb"` should be `"dnd"`. Currently DnD participants appear as online. The values are defined at: https://github.com/nextcloud/server/blob/master/lib/public/UserStatus/IUserStatus.php#L42-L66 I'd also use the casing as defined in the server (unlikely to change) and go with a case sensitive comparison. Micro-optimization ;) It is also worth considering to keep the busy and dnd status seperated in the backend, and only treat them similarly in the QML frontend, in case there might be subtle differences in future. On the other hand, if there are subtle differences in future, they need to be baked in, too, so keeping this is also totally fine.
blizzz marked this conversation as resolved
nephros added 3 commits 8 months ago
nephros added 1 commit 8 months ago
edf5491264 Squashed commit: Fixups, and make it work...
nephros added 1 commit 8 months ago
33235f11d7 Squashed commit:
Poster
Collaborator

33235f11d7 is my first try at the enum intead of int thing.

It compiles, it works, not sure if it's correct tho. :)

33235f11d7 is my first try at the enum intead of int thing. It compiles, it works, not sure if it's *correct* tho. :)
Owner

33235f11d7 is my first try at the enum intead of int thing.

It compiles, it works, not sure if it's correct tho. :)

This certainly goes in the right direction! Like I did in the past with the enums AccountRoles and ColorMode:

The Q_ENUM macro allows to use it in QML as well, for example:

https://codeberg.org/blizzz/harbour-nextcloud-talk/src/branch/master/qml/pages/accounts/AccountSettings.qml#L96-L98

Then all weird numbers stay in the enum definition and nowhere else.

> 33235f11d7 is my first try at the enum intead of int thing. > > It compiles, it works, not sure if it's *correct* tho. :) This certainly goes in the right direction! Like I did in the past with the enums `AccountRoles` and `ColorMode`: - https://codeberg.org/blizzz/harbour-nextcloud-talk/src/branch/master/src/services/accounts.h#L14-L27 - https://codeberg.org/blizzz/harbour-nextcloud-talk/src/branch/master/src/services/accounts.cpp#L64-L72 The Q_ENUM macro allows to use it in QML as well, for example: https://codeberg.org/blizzz/harbour-nextcloud-talk/src/branch/master/qml/pages/accounts/AccountSettings.qml#L96-L98 Then all weird numbers stay in the enum definition and nowhere else.
nephros added 1 commit 8 months ago
nephros added 1 commit 8 months ago
blizzz added 2 commits 7 months ago
609c356fd9
make enum available to QML
Owner

Finally (was in a hole) added a commit, after some testing. I got errors about the PresenceStatus in QML, so moved it outside and registered it. I also shortened the names, I thought one Status is enough.

You also styled the Moderator-indicator differently. Makes more sense like this! But the formatting can use improvement, sicne it is not clear or misleading who the moderator is (see screenshot). I may look into it tomorrow evening (if nothing unplanned), unless you'd like to pick it up.

Finally (was in a hole) added a commit, after some testing. I got errors about the PresenceStatus in QML, so moved it outside and registered it. I also shortened the names, I thought one Status is enough. You also styled the Moderator-indicator differently. Makes more sense like this! But the formatting can use improvement, sicne it is not clear or misleading who the moderator is (see screenshot). I may look into it tomorrow evening (if nothing unplanned), unless you'd like to pick it up.
blizzz added 1 commit 7 months ago
c8fd4cc726
improve Participants page layout
Owner

Another commit with layout improvements (see commit message).

I am still not entirely happy, because it looks out of place when one user had the moderator flag, but no status, and the other vice versa. Maybe aligning them generally in the center, but I am afraid it would still be edgy. Maybe trying it out the other day.

Two other points:

  • I'd refrain from adding status messages here (the indicator does it), but instead show the status message that is set with the user status.
  • At the moment the font boldness indicates whether the particpant is actively present in the conversation. This is not the case anymore, and I would like to bring it back. Instead of be bold / non-bold it could be primary-color / secondary-color. In any case I would disconnect the coloring from the presence status, imo the colored indicator should be sufficient already.

@nephros what do you think?

Another commit with layout improvements (see commit message). I am still not entirely happy, because it looks out of place when one user had the moderator flag, but no status, and the other vice versa. Maybe aligning them generally in the center, but I am afraid it would still be edgy. Maybe trying it out the other day. Two other points: * I'd refrain from adding status messages here (the indicator does it), but instead show the status message that is set with the user status. * At the moment the font boldness indicates whether the particpant is actively present in the conversation. This is not the case anymore, and I would like to bring it back. Instead of be bold / non-bold it could be primary-color / secondary-color. In any case I would disconnect the coloring from the presence status, imo the colored indicator should be sufficient already. @nephros what do you think?
Poster
Collaborator

Another commit with layout improvements (see commit message).

I am still not entirely happy, because it looks out of place when one user had the moderator flag, but no status, and the other vice versa. Maybe aligning them generally in the center, but I am afraid it would still be edgy. Maybe trying it out the other day.

Two other points:

  • I'd refrain from adding status messages here (the indicator does it), but instead show the status message that is set with the user status.

Hmm, maybe show the (user-defined status/away) message on long press (as a "context menu")?
On the other hand, I'd expect a context menu to have things like "kick" "promote to moderator" etc. rather than a status.
Tap to show status, long press to go to context menu?

  • At the moment the font boldness indicates whether the particpant is actively present in the conversation. This is not the case anymore, and I would like to bring it back. Instead of be bold / non-bold it could be primary-color / secondary-color. In any case I would disconnect the coloring from the presence status, imo the colored indicator should be sufficient already.

@nephros what do you think?

Agreed. The difference between primary/secondary is only opacity (at least with sailfish defaults, hehe), so that's fine for online/offline. Maybe bold/normal/italic for online/offline/other.

> Another commit with layout improvements (see commit message). > > I am still not entirely happy, because it looks out of place when one user had the moderator flag, but no status, and the other vice versa. Maybe aligning them generally in the center, but I am afraid it would still be edgy. Maybe trying it out the other day. > > Two other points: > > * I'd refrain from adding status messages here (the indicator does it), but instead show the status message that is set with the user status. Hmm, maybe show the (user-defined status/away) message on long press (as a "context menu")? On the other hand, I'd expect a context menu to have things like "kick" "promote to moderator" etc. rather than a status. Tap to show status, long press to go to context menu? > * At the moment the font boldness indicates whether the particpant is actively present in the conversation. This is not the case anymore, and I would like to bring it back. Instead of be bold / non-bold it could be primary-color / secondary-color. In any case I would disconnect the coloring from the presence status, imo the colored indicator should be sufficient already. > > @nephros what do you think? Agreed. The difference between primary/secondary is only opacity (at least with sailfish defaults, hehe), so that's fine for online/offline. Maybe bold/normal/italic for online/offline/other.
blizzz added 1 commit 7 months ago
343a257d48
improves positioning of part. list item components
Owner

Hmm, maybe show the (user-defined status/away) message on long press (as a "context menu")?
On the other hand, I'd expect a context menu to have things like "kick" "promote to moderator" etc. rather than a status.
Tap to show status, long press to go to context menu?

Aye, this should not be in a menu and imo should not be hidden after a long press. I decided to align all labels centrally now, see screenshot attached.

Also reverted the coloring of the user name to the isOnline status.

That's what I pushed here, I hope that's ok with you to continuing using your branch :)

Another thing I am increasingly unsure about: the presence indicator underlay is nice, but has problems: the status might be not clear or not play nice with the avatar colors. But most importantly it is useless for people with color blindness issues: it may look all the same. The web frontend has the indicator as small icon on top of the avatar with different shapes:

  • online: green solid cirlce
  • away: orange crescent
  • dnd: red circle with white rectangle in its center

I tend to do the same.

> Hmm, maybe show the (user-defined status/away) message on long press (as a "context menu")? On the other hand, I'd expect a context menu to have things like "kick" "promote to moderator" etc. rather than a status. Tap to show status, long press to go to context menu? Aye, this should not be in a menu and imo should not be hidden after a long press. I decided to align all labels centrally now, see screenshot attached. Also reverted the coloring of the user name to the `isOnline` status. That's what I pushed here, I hope that's ok with you to continuing using your branch :) Another thing I am increasingly unsure about: the presence indicator underlay is nice, but has problems: the status might be not clear or not play nice with the avatar colors. But most importantly it is useless for people with color blindness issues: it may look all the same. The web frontend has the indicator as small icon on top of the avatar with different shapes: - online: green solid cirlce - away: orange crescent - dnd: red circle with white rectangle in its center I tend to do the same.
blizzz added 1 commit 7 months ago
7463e4bebe
use icon overlay for presence indication like web
Owner

Another thing I am increasingly unsure about: the presence indicator underlay is nice, but has problems: the status might be not clear or not play nice with the avatar colors. But most importantly it is useless for people with color blindness issues: it may look all the same. The web frontend has the indicator as small icon on top of the avatar with different shapes:

online: green solid cirlce
away: orange crescent
dnd: red circle with white rectangle in its center

I tend to do the same.

Implemented with latest commit, see screenshots.

> Another thing I am increasingly unsure about: the presence indicator underlay is nice, but has problems: the status might be not clear or not play nice with the avatar colors. But most importantly it is useless for people with color blindness issues: it may look all the same. The web frontend has the indicator as small icon on top of the avatar with different shapes: > > online: green solid cirlce > away: orange crescent > dnd: red circle with white rectangle in its center > > I tend to do the same. Implemented with latest commit, see screenshots.
blizzz added 1 commit 7 months ago
4275af0498
show user status icon and message if available
Owner

Now also pulled in the status message. Long texts are expendable (up to 5 lines, more must be spam ;) )

Now also pulled in the status message. Long texts are expendable (up to 5 lines, more must be spam ;) )
blizzz changed title from PoC: Presence (away/busy/offline) support to Presence (away/busy/offline) + user status support 7 months ago
Owner

@nephros How does it look like to you? Do you see something to fix or change? Are you happy with this?

@nephros How does it look like to you? Do you see something to fix or change? Are you happy with this?
Owner

(Sorry for the noise)

Now, that I was looking repeatedly at it (there was a slight feeling of dissatisfaction), the rows should have the same (base) size, independent of the content. The distances between the avatars are inconsistent → too "noisy".

Should look into computing the backgrounditem height by adding heights of the (max possible) labels and paddings.

(Sorry for the noise) Now, that I was looking repeatedly at it (there was a slight feeling of dissatisfaction), the rows should have the same (base) size, independent of the content. The distances between the avatars are inconsistent → too "noisy". Should look into computing the backgrounditem height by adding heights of the (max possible) labels and paddings.
Poster
Collaborator

@nephros How does it look like to you? Do you see something to fix or change? Are you happy with this?

Love it :) Looks much more polished/professional now.

The one thing I'd change is the button icon. I'd do either icon-s-unfocused-down, icon-s-arrow, or simply icon-lock-more but that's really a trivial thing.

> @nephros How does it look like to you? Do you see something to fix or change? Are you happy with this? Love it :) Looks much more polished/professional now. The one thing I'd change is the button icon. I'd do either icon-s-unfocused-down, icon-s-arrow, or simply icon-lock-more but that's really a trivial thing.
Poster
Collaborator

(Sorry for the noise)

Now, that I was looking repeatedly at it (there was a slight feeling of dissatisfaction), the rows should have the same (base) size, independent of the content. The distances between the avatars are inconsistent → too "noisy".

Should look into computing the backgrounditem height by adding heights of the (max possible) labels and paddings.

Maybe for away messages, instead of expanding just replace the whole content of the message, so username etc. gets hidden.
This would keep heights fixed and reduce noise.

> (Sorry for the noise) > > Now, that I was looking repeatedly at it (there was a slight feeling of dissatisfaction), the rows should have the same (base) size, independent of the content. The distances between the avatars are inconsistent → too "noisy". > > Should look into computing the backgrounditem height by adding heights of the (max possible) labels and paddings. Maybe for away messages, instead of expanding just replace the whole content of the message, so username etc. gets hidden. This would keep heights fixed and reduce noise.
Owner

@nephros How does it look like to you? Do you see something to fix or change? Are you happy with this?

Love it :) Looks much more polished/professional now.

The one thing I'd change is the button icon. I'd do either icon-s-unfocused-down, icon-s-arrow, or simply icon-lock-more but that's really a trivial thing.

Good point, and totally agree with you. I decided for icon-s-arrow, but colorization did not work there. Went with icon-m-change-type which looks the same, and is colorable. Primary color would be used otherwise and that's just too strong.

(Sorry for the noise)

Now, that I was looking repeatedly at it (there was a slight feeling of dissatisfaction), the rows should have the same (base) size, independent of the content. The distances between the avatars are inconsistent → too "noisy".

Should look into computing the backgrounditem height by adding heights of the (max possible) labels and paddings.

Maybe for away messages, instead of expanding just replace the whole content of the message, so username etc. gets hidden.
This would keep heights fixed and reduce noise.

The changing height when expanding is not the problem – that's ok. But when they are collapsed, they should be the same for a harmonic view :)

> > @nephros How does it look like to you? Do you see something to fix or change? Are you happy with this? > > Love it :) Looks much more polished/professional now. > > The one thing I'd change is the button icon. I'd do either icon-s-unfocused-down, icon-s-arrow, or simply icon-lock-more but that's really a trivial thing. Good point, and totally agree with you. I decided for icon-s-arrow, but colorization did not work there. Went with icon-m-change-type which looks the same, and is colorable. Primary color would be used otherwise and that's just too strong. > > (Sorry for the noise) > > > > Now, that I was looking repeatedly at it (there was a slight feeling of dissatisfaction), the rows should have the same (base) size, independent of the content. The distances between the avatars are inconsistent → too "noisy". > > > > Should look into computing the backgrounditem height by adding heights of the (max possible) labels and paddings. > > Maybe for away messages, instead of expanding just replace the whole content of the message, so username etc. gets hidden. > This would keep heights fixed and reduce noise. The changing height when expanding is not the problem – that's ok. But when they are collapsed, they should be the same for a harmonic view :)
blizzz added 2 commits 7 months ago
Owner

If you compare the previous screenshot with the attached one you see: before the distances between the avatars were not the same. Now it is all the same height, unless expanded.

If you compare the [previous screenshot](https://codeberg.org/attachments/9f4452d6-9aa2-4d0e-855b-6d7474f6c8dc) with the attached one you see: before the distances between the avatars were not the same. Now it is all the same height, unless expanded.
blizzz added 1 commit 7 months ago
Owner

And another fix for adapted opacity depending on online status, pointed out by my dear friend nickvergessen.

Ready for prime time I'd say.

And another fix for adapted opacity depending on online status, pointed out by my dear friend nickvergessen. Ready for prime time I'd say.
Poster
Collaborator

And another fix for adapted opacity depending on online status, pointed out by my dear friend nickvergessen.

Ready for prime time I'd say.

Spacing is realy nice now, thanks for all the fixes!

But here on SFOS 3.4 / Xperia10 it doesn't look like on the screenshots, it seems everything is positioned a tad too low.

If there is no status message, Username is almost, but not quite at the bottom of the Avatar, title (like moderator) almost centered but not quite.

If there is a status message, thinks look okay but text and Avatar are slightly misaligned.

> And another fix for adapted opacity depending on online status, pointed out by my dear friend nickvergessen. > > Ready for prime time I'd say. Spacing is realy nice now, thanks for all the fixes! But here on SFOS 3.4 / Xperia10 it doesn't look like on the screenshots, it seems everything is positioned a tad too low. If there is no status message, Username is almost, but not quite at the bottom of the Avatar, title (like moderator) almost centered but not quite. If there is a status message, thinks look okay but text and Avatar are slightly misaligned.
blizzz added 1 commit 6 months ago
536b47213a
sort participants list
Owner

Spacing is realy nice now, thanks for all the fixes!

😊

Today I added sorting of the list. The lack of it annoyed me too much on dog fooding.

If there is no status message, Username is almost, but not quite at the bottom of the Avatar, title (like moderator) almost centered but not quite.

Good catch, thank you!

And now that you mention it, i see it as well. My screenshots above were all having the status message. With just the username it is a tad better. I'll give this issue another shot, if I manage during this week, otherwise on the weekend again.

Or would you like to give it a try?

Probably it is because we are centering in the background item, but the info box is smaller than the parent height. And the avatar is not centered. Therefore it looks off. The avatar is not centered, because it would jump when the row is expanded and that looks noisy and ugly.

I don't have the proper solution right at hand, some tinkering would give inspiration fo sure.

> Spacing is realy nice now, thanks for all the fixes! 😊 Today I added sorting of the list. The lack of it annoyed me too much on dog fooding. > If there is no status message, Username is almost, but not quite at the bottom of the Avatar, title (like moderator) almost centered but not quite. Good catch, thank you! And now that you mention it, i see it as well. My screenshots above were all having the status message. With just the username it is a tad better. I'll give this issue another shot, if I manage during this week, otherwise on the weekend again. Or would you like to give it a try? Probably it is because we are centering in the background item, but the info box is smaller than the parent height. And the avatar is not centered. Therefore it looks off. The avatar is not centered, because it would jump when the row is expanded and that looks noisy and ugly. I don't have the proper solution right at hand, some tinkering would give inspiration fo sure.
Poster
Collaborator

Spacing is realy nice now, thanks for all the fixes!

😊

Today I added sorting of the list. The lack of it annoyed me too much on dog fooding.

If there is no status message, Username is almost, but not quite at the bottom of the Avatar, title (like moderator) almost centered but not quite.

Good catch, thank you!

And now that you mention it, i see it as well. My screenshots above were all having the status message. With just the username it is a tad better. I'll give this issue another shot, if I manage during this week, otherwise on the weekend again.

Or would you like to give it a try?

Great, I will have a look during this week and possibly share some "inspiration" :)

> > Spacing is realy nice now, thanks for all the fixes! > > 😊 > > Today I added sorting of the list. The lack of it annoyed me too much on dog fooding. > > > If there is no status message, Username is almost, but not quite at the bottom of the Avatar, title (like moderator) almost centered but not quite. > > Good catch, thank you! > > And now that you mention it, i see it as well. My screenshots above were all having the status message. With just the username it is a tad better. I'll give this issue another shot, if I manage during this week, otherwise on the weekend again. > > Or would you like to give it a try? Great, I will have a look during this week and possibly share some "inspiration" :)
nephros added 2 commits 6 months ago
41eb66c486 try to fix positioning
Poster
Collaborator

How about this hackish solution?

Everything should now be nicely centered in BackgroundItem, and the Avatar shouldn't jump, although I am not able to see long status messages so couldn't test that.

Sorry about the additional eye candy, couldn't help myself. g

How about this hackish solution? Everything should now be nicely centered in BackgroundItem, and the Avatar shouldn't jump, although I am not able to see long status messages so couldn't test that. Sorry about the additional eye candy, couldn't help myself. *g*
Owner

Unfortunately fading long names (and the detection there of) is broken. Didn't check for status messages.

Apart of that interesting approach. The animations are fancy :)

Unfortunately fading long names (and the detection there of) is broken. Didn't check for status messages. Apart of that interesting approach. The animations are fancy :)
Owner

I did some width fixes to get the unfolding back working. But no luck with positioning yet. Pushing pixels is hard. tbc.

I did some width fixes to get the unfolding back working. But no luck with positioning yet. Pushing pixels is hard. tbc.
blizzz added 3 commits 5 months ago
Owner

a step or two closer :)

a step or two closer :)
blizzz added 1 commit 4 months ago
efdc0a4057
Final alignment polishing of participant elements
Owner

@nephros I found my peace now. What do you think?

@nephros I found my peace now. What do you think?
blizzz merged commit 337a9c714a into master 4 months ago
The pull request has been merged as 337a9c714a.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.