Skip to content

Conversation

@max-nextcloud
Copy link
Collaborator

@max-nextcloud max-nextcloud commented Aug 19, 2025

Lots of fixes to the guest user dialog:

  • Keep the session list up to date.
  • Update the guest avatar right after changing the name.
  • Ensure the avatars in the toggle are always round.
  • Use avatar colors for logged in users.
  • Wording "Edit guest name" -> "Enter your name".
  • use NcInputField with disabled (loading) and success state.
  • Fix border in popup when viewing as a logged in user.
  • Use color max contrast for guest names.
  • Use valid html (wrap <form> in <li> to use in <ul>)
  • Use 30px size for avatars. Together with the 2px border they match the 34px. input height.
  • Use the same avatar size in toggle and popup.
  • Hide local client for guest users even if no guestname is set.

Screenshots

🏃 Action 🏚️ Before 🏡 After
Admin sees guest
now with colors
grafik grafik
Guest sees admin and form
now without duplicate entry for themselves
grafik grafik
Guest starts entering new name
Now with NcInputField
Bildschirmfoto vom 2025-08-21 14-33-07 grafik
Guest successfully changed name
with feedback now
grafik grafik
Afterwards admin sees...
now with updated name and color.
(used to use an outdated color and name)
grafik grafik

@max-nextcloud max-nextcloud requested a review from mejo- as a code owner August 19, 2025 14:46
@codecov
Copy link

codecov bot commented Aug 19, 2025

Codecov Report

❌ Patch coverage is 89.65517% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.12%. Comparing base (bc7c8c9) to head (4f691ed).
⚠️ Report is 43 commits behind head on main.

Files with missing lines Patch % Lines
src/extensions/CollaborationCursor.ts 13.33% 13 Missing ⚠️
src/composables/useEditorMethods.ts 33.33% 6 Missing ⚠️
src/services/SyncService.ts 33.33% 4 Missing ⚠️
src/apis/connect.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7555      +/-   ##
==========================================
+ Coverage   53.45%   60.12%   +6.66%     
==========================================
  Files         502      502              
  Lines       43542    38566    -4976     
  Branches     1128     1128              
==========================================
- Hits        23277    23186      -91     
+ Misses      20157    15272    -4885     
  Partials      108      108              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@max-nextcloud max-nextcloud force-pushed the fix/guest-user-dialog branch 4 times, most recently from a5f1745 to 5959124 Compare August 21, 2025 12:19
@max-nextcloud max-nextcloud requested review from a team and marcoambrosini August 21, 2025 12:26
@max-nextcloud
Copy link
Collaborator Author

/backport to stable31

@silverkszlo
Copy link
Collaborator

silverkszlo commented Aug 21, 2025

When I open a .md file in Files app and open the same file via public link in a private browser, the display of another editor/guest overlaps with another icon (in Firefox; but maybe that's intentional :*)):

Screenshot from 2025-08-21 17-25-53

@silverkszlo silverkszlo self-requested a review August 21, 2025 15:40
@silverkszlo
Copy link
Collaborator

In SessionList.vue:

data() {
  return {
	  myName: '',
  }
},

myName is not being used anymore or yet.

@max-nextcloud
Copy link
Collaborator Author

When I open a .md file in Files app and open the same file via public link in a private browser, the display of another editor/guest overlaps with another icon (in Firefox; but maybe that's intentional :*)):

Yes... it's intentional. We show up to three users plus the people Icon. I see there's room for improvement 😉 - but I also have no simple idea of what else to do.

@max-nextcloud
Copy link
Collaborator Author

max-nextcloud commented Aug 22, 2025

myName is not being used anymore or yet.

Great catch!

Turns out it was not used since it was introduce in drumroll 2019.
🙈

Copy link
Member

@marcoambrosini marcoambrosini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvements @max-nextcloud. Dropping a few design related comments:

  • When the guest username is not defined, instead of the question mark I suggest we use a regular user icon
  • In "Guest sees admin and form
    now without duplicate entry for themselves"

    • I would not show an input field, instead I would show a list item with avatar, the string "you", and a right align secondary "edit" button with pencil icon. Clicking that would activate the input.
    • The input field here should be horizontally aligned with the left icon and button, right now they're slightly misaligned
  • In "Guest starts entering new name Now with NcInputField"

    • Once in edit mode, the icon here could be hidden and the input field could expand to the left
    • I think it would still be good to have a submit button in the same place as the edit one, otherwise it's a bit confusing. I'd make it also primary in this case and with the icon: check.

@max-nextcloud max-nextcloud force-pushed the fix/guest-user-dialog branch from 2c5ff91 to 186a915 Compare August 24, 2025 10:18
@max-nextcloud
Copy link
Collaborator Author

Dropping a few design related comments:

I think I addressed them all. Let me know if I misunderstood something or something else comes up

Bildschirmaufzeichnung.vom.2025-08-24.12-30-33.mp4

@max-nextcloud max-nextcloud force-pushed the fix/guest-user-dialog branch 3 times, most recently from d806f7e to 3fad811 Compare August 25, 2025 09:31
@silverkszlo
Copy link
Collaborator

Also not related to this PR but $userName in SessionService.php does not seem to be used anymore or yet:
$userName = $this->userId ?? $guestName;

@silverkszlo
Copy link
Collaborator

In Editor.vue seems to be a typo in props. Should be required instead of require:

props: {
  richWorkspace: {
	  type: Boolean,
	  require: false,
	  default: false,
},

Also remove `required: false` as that is the default.

Signed-off-by: Max <[email protected]>
Use `var(--default-clickable-area)` in css instead.

Signed-off-by: Max <[email protected]>
... and we never used it and mixed it with the session id.

Signed-off-by: Max <[email protected]>
It is included in json serialize in `Db/Session.php`
but not fetched for most cases in `Db/SessionMapper.php`.

This results in empty values in the response
so we better ignore them on the client side.

Exposing them for other sessions than ones own would be security issue.

Signed-off-by: Max <[email protected]>
UserSession has userId and displayName
GuestSession has guestName (which may be an empty string).

Signed-off-by: Max <[email protected]>
The conditional rendering somehow caused the icon to sometimes not be rendered
leaving the button empty.

This will need another rework anyway
to integrate with the new guest user settings in @nextcloud/auth.

Signed-off-by: Max <[email protected]>
We load the guestName from localStorage,
send it to the server,
and then store it again.

That would make sense if the server changed it.
But i do not see why it would do that
if it did not do it the last time the name was changed and stored in localStorage.

Signed-off-by: Max <[email protected]>
We used to set this on the guests side
but then the translation is for the guests language.

Better to set it on the current users side
so it is translated according to the viewers language.

Signed-off-by: Max <[email protected]>
It was only applied in the popup.

Signed-off-by: Max <[email protected]>
@max-nextcloud max-nextcloud merged commit 924edf4 into main Sep 3, 2025
80 of 83 checks passed
@max-nextcloud max-nextcloud deleted the fix/guest-user-dialog branch September 3, 2025 08:36
@backportbot backportbot bot mentioned this pull request Sep 3, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants