Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: display workspace avatars correctly when URLs fail to load#14814

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Parkreiner merged 13 commits intomainfrommes/avatar-fix-2
Oct 2, 2024

Conversation

Parkreiner
Copy link
Member

No issue to link – this was an issue that surfaced for certain URL types when kicking the tires on the orgs work

Changes made

  • Updated custom avatar components to favor background color by default
  • UpdatedAvatarData component to let you manually specify the source of the text used when images fail to load, and updated the orgs breadcrumb segment to use it
  • Added some logic for handling emoji images better

@ParkreinerParkreiner self-assigned thisSep 26, 2024
cdr-bot[bot]
cdr-botbot previously approved these changesSep 26, 2024
Copy link

@cdr-botcdr-botbot left a comment
edited
Loading

Choose a reason for hiding this comment

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

This PR is no longer a hotfix.

  • ✅ Base is main or release branch
  • ❌ Has hotfix label
  • ✅ Head is from coder/coder
  • ✅ Less than 100 lines

@matifali
Copy link
Member

matifali commentedSep 26, 2024
edited
Loading

@Parkreiner, a few changes in the UI tests are showing misalignment.
image

@Parkreiner
Copy link
MemberAuthor

Parkreiner commentedSep 26, 2024
edited
Loading

@matifali Yeah, sorry, I should've left a message. I was hoping this would be a hotfix, but after seeing how many stories would be changed, I decided that I'd put this through a full review process, and then went to bed

Definitely not planning to push this through as-is, but appreciate you catching some wonkiness that crept through

matifali reacted with heart emoji

@cdr-botcdr-botbot dismissed theirstale reviewSeptember 26, 2024 13:55

This PR is no longer a hotfix.

@Parkreiner
Copy link
MemberAuthor

Parkreiner commentedSep 27, 2024
edited
Loading

Edit: never mind. Good to go

Making a quick comment for documentation purposes: Chromatic is currently down, which is blocking part of the CI pipeline. I could try to push the changes through as-is, but since the previous version of this PR broke parts of the UI, I want to err on the side of caution

Will try to re-run processes right before I log off today, but this might have to wait until Monday

@ParkreinerParkreiner added hotfix and removed hotfix labelsSep 27, 2024
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsSep 27, 2024
@ParkreinerParkreiner requested review froma team andbcpeinhardt and removed request fora teamSeptember 27, 2024 19:55
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Nothing about the logic here changed – just got formatted differently

Copy link
Member

Choose a reason for hiding this comment

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

thank you 😄

@ParkreinerParkreiner removed the request for review frombcpeinhardtOctober 1, 2024 16:29
avatar = <Avatar src={src}>{title}</Avatar>;
avatar = (
<Avatar background src={src}>
{typeof title === "string" ? title || "-" : imgFallbackText ?? "-"}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{typeoftitle==="string" ?title||"-":imgFallbackText??"-"}
{(typeoftitle==="string" ?title :imgFallbackText)||"-"}

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Oh, good call

Comment on lines 12 to 22
/**
* Useful for when you need to pass in a ReactNode for the title of the
* component.
*
* MUI will try to take any string titles and turn them into the first
* character, but if you pass in a ReactNode, MUI can't do that, because it
* has no way to reliably grab the text content during renders.
*
* Tried writing some layout effect/JSX parsing logic to do the extraction,
* but it added complexity and render overhead, and wasn't reliable enough
*/
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/**
*UsefulforwhenyouneedtopassinaReactNodeforthetitleofthe
*component.
*
*MUIwilltrytotakeany stringtitlesandturnthemintothefirst
*character,butifyoupassinaReactNode,MUIcan't do that, because it
*hasnowaytoreliablygrabthetextcontentduringrenders.
*
*Triedwritingsomelayouteffect/JSXparsinglogictodotheextraction,
*butitaddedcomplexityandrenderoverhead,andwasn't reliable enough
*/
/**
*Usefulforwhenyouneedtopassina`ReactNode`forthetitleofthe
*component,butyoustillwanttousethefirstcharacterofabitoftext
*asthefallback.
*/

Copy link
Member

Choose a reason for hiding this comment

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

thank you 😄

}

return url.startsWith("/emojis/");
}
Copy link
Member

Choose a reason for hiding this comment

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

hmm. I'm skeptic about adding special handling like this, but I get the motivation.

@ParkreinerParkreinerenabled auto-merge (squash)October 2, 2024 14:37
@ParkreinerParkreiner merged commit680e28b intomainOct 2, 2024
26 of 27 checks passed
@ParkreinerParkreiner deleted the mes/avatar-fix-2 branchOctober 2, 2024 14:46
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@aslilacaslilacaslilac approved these changes

@cdr-botcdr-bot[bot]cdr-bot[bot] left review comments

Assignees

@ParkreinerParkreiner

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@Parkreiner@matifali@aslilac

[8]ページ先頭

©2009-2025 Movatter.jp