Skip to content

Conversation

@skjnldsv
Copy link
Contributor

@skjnldsv skjnldsv commented May 2, 2025

This component is aimed to standardise this a bit more.

  • There is one being used in Files (for files requests)
  • Another in Talk to join a conversation

As I'm currently adding a bit more visibility towards how you're seen as a guest on an instance, I thought it would be nice to create this.
image

Features:

  • Creates a new getGuestUser method that looks similar to a normal user
  • Creates a dedicated showGuestUserPrompt that spawns a dialog
  • Add a way to monitor displayName change to so whatever you want (reload an avatar, or change other stuff...)

Screenshots

Folder share

2025-05-02_16-41

Talk room

2025-05-02_16-40

Code snippet example

// Watching for displayname change in vue component
data() {
	return {
		currentUser: getGuestUser(),
		displayName: getGuestUser().displayName,
	}
},

mounted() {
	this.currentUser.addEventListener('updateDisplayName', () => {
		this.displayName = getGuestUser().displayName || ''
	})
},

@skjnldsv
Copy link
Contributor Author

skjnldsv commented May 2, 2025

@susnux would be nice to have the vue props being exported in the docs.
But it seems more complex that my knowledge of it. Any clue ?
Else i'll investigate

Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv skjnldsv force-pushed the feat/guest-user branch from d4ff9d1 to dcfbd08 Compare May 2, 2025 14:54
Copy link
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

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

Please not another API package with UI components.

  1. It increases bundle size a lot even if you do not use Vue for your app
  2. It bounds an API only library to UI
  3. More complex dependencies
  4. This creates a circular dependency between nextcloud-vue and nextcloud-auth

Instead this probably should belong just to @nextcloud/vue for UI components or if you consider it a dialog maybe also to @nextcloud/dialogs but makes no sense to make another simple logic library a UI package.

@skjnldsv
Copy link
Contributor Author

skjnldsv commented May 2, 2025

Ah, sure thing!! Wasn't aware this was such a bad pattern 👍

@skjnldsv skjnldsv closed this May 2, 2025
@skjnldsv
Copy link
Contributor Author

skjnldsv commented May 2, 2025

Smaller extract without UI: #795

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants