Skip to content

Sharing UI: display user names - #25

Open
tomasr8 wants to merge 1 commit into
cs3org:masterfrom
tomasr8:display-names
Open

Sharing UI: display user names#25
tomasr8 wants to merge 1 commit into
cs3org:masterfrom
tomasr8:display-names

Conversation

@tomasr8

@tomasr8 tomasr8 commented Apr 16, 2026

Copy link
Copy Markdown
Member

Use display names (where available) instead of opaque ids

image

@tomasr8
tomasr8 requested review from diocas and rawe0 April 16, 2026 08:53
Comment thread src/shares-widget.tsx
function FileTypeIcon({ share, registry }: { share: Share; registry: FileTypeRegistry }) {
if (share.resourceType !== 'RESOURCE_TYPE_FILE') {
return <span className="swan-shares-item-icon"><folderIcon.react stylesheet="listing" /></span>;
return (

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is just a formatting change

Comment thread src/shares-widget.tsx
const Icon = fileTypes.length > 0 && fileTypes[0].icon ? fileTypes[0].icon.react : fileIcon.react;
return <span className="swan-shares-item-icon"><Icon stylesheet="listing" /></span>;
return (
<span className="swan-shares-item-icon">

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

same here

@diocas diocas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just some small nitpicks.. I think is fine.

Comment thread src/shares-widget.tsx
meta = `from ${share.sharedBy.displayName || share.sharedBy.opaqueId}`;
} else if (share.shareDirection === 'BY_ME' && share.shareType === 'REGULAR' && share.sharedWith.length > 0) {
meta = `with ${share.sharedWith.map(g => g.opaqueId).join(', ')}`;
meta = `with ${share.sharedWith.map(g => ('displayName' in g ? g.displayName : g.opaqueId)).join(', ')}`;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These types of checks can be simplified, but it's a minor suggestion

Suggested change
meta = `with ${share.sharedWith.map(g => ('displayName' in g ? g.displayName : g.opaqueId)).join(', ')}`;
meta = `with ${share.sharedWith.map(g => g.displayName ?? g.opaqueId).join(', ')}`;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There are other places where this can be applied.

Comment thread src/shares.ts
}

interface RawSharedByMeRegular {
interface RawGranteeUserInfo {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a reason to have different interfaces that are the same? They actually represent the same entity (user, person, account.. not sure what's the most appropriate name), that can be a person that creates or receives a share.

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.

2 participants