Sharing UI: display user names - #25
Open
tomasr8 wants to merge 1 commit into
Open
Conversation
tomasr8
commented
Apr 16, 2026
| 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 ( |
Member
Author
There was a problem hiding this comment.
This is just a formatting change
| 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"> |
diocas
approved these changes
May 13, 2026
diocas
left a comment
Member
There was a problem hiding this comment.
Just some small nitpicks.. I think is fine.
| 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(', ')}`; |
Member
There was a problem hiding this comment.
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(', ')}`; |
Member
There was a problem hiding this comment.
There are other places where this can be applied.
| } | ||
|
|
||
| interface RawSharedByMeRegular { | ||
| interface RawGranteeUserInfo { |
Member
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use display names (where available) instead of opaque ids