-
Notifications
You must be signed in to change notification settings - Fork 460
fix(ui): Fix OrganizationSwitcher avatar flash and polish popover styling #9112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| '@clerk/ui': patch | ||
| --- | ||
|
|
||
| Polish the `<OrganizationSwitcher />`: | ||
|
|
||
| - Decode avatar images synchronously so a freshly mounted avatar (e.g. when the popover opens) paints on its first frame instead of briefly flashing the avatar background. | ||
| - Highlight the trigger while its popover is open. | ||
| - Align the "Create organization" action's height with the other rows for a consistent list. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,6 +97,10 @@ export const Avatar = (props: AvatarProps) => { | |
| title={title} | ||
| alt={`${title}'s logo`} | ||
| src={imageUrl || ''} | ||
| // Decode the (typically cached) avatar bytes before presenting so a freshly-mounted | ||
| // <img> paints on its first frame instead of flashing the avatar background for a tick. | ||
| // Safe for avatar-sized images: decode is off-thread/sub-ms and only affects already-fetched bytes. | ||
| decoding='sync' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is used throughout the components, so a org profiles members tab has this used in the table. Do you think this is ok? I am not to familiar with the impacts of usage here.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea was chatting with claude abt this. they're basically all so small and all our lists are capped from pagination at around 10 that it is negligible. shouldn't use it willy nilly, but in this case we're fine |
||
| sx={{ | ||
| objectFit: 'cover', | ||
| width: '100%', | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯