Fix avatar in chat export (#12537)

* Update `@vector-im/compound-web`

* Update test snapshots
pull/28217/head
Florian Duros 2024-05-15 15:34:27 +02:00 committed by GitHub
parent a730e1d3d6
commit 580bc8771c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 8 additions and 17 deletions

View File

@ -76,7 +76,7 @@
"@sentry/browser": "^7.0.0", "@sentry/browser": "^7.0.0",
"@testing-library/react-hooks": "^8.0.1", "@testing-library/react-hooks": "^8.0.1",
"@vector-im/compound-design-tokens": "^1.2.0", "@vector-im/compound-design-tokens": "^1.2.0",
"@vector-im/compound-web": "^4.2.0", "@vector-im/compound-web": "^4.3.1",
"@zxcvbn-ts/core": "^3.0.4", "@zxcvbn-ts/core": "^3.0.4",
"@zxcvbn-ts/language-common": "^3.0.4", "@zxcvbn-ts/language-common": "^3.0.4",
"@zxcvbn-ts/language-en": "^3.0.2", "@zxcvbn-ts/language-en": "^3.0.2",

View File

@ -116,7 +116,6 @@ exports[`AppTile for a pinned widget should render 1`] = `
<img <img
alt="" alt=""
class="_image_mcap2_50" class="_image_mcap2_50"
crossorigin="anonymous"
data-type="round" data-type="round"
height="20px" height="20px"
loading="lazy" loading="lazy"
@ -202,7 +201,6 @@ exports[`AppTile for a pinned widget should render permission request 1`] = `
<img <img
alt="" alt=""
class="_image_mcap2_50" class="_image_mcap2_50"
crossorigin="anonymous"
data-type="round" data-type="round"
height="20px" height="20px"
loading="lazy" loading="lazy"
@ -355,7 +353,6 @@ exports[`AppTile preserves non-persisted widget on container move 1`] = `
<img <img
alt="" alt=""
class="_image_mcap2_50" class="_image_mcap2_50"
crossorigin="anonymous"
data-type="round" data-type="round"
height="20px" height="20px"
loading="lazy" loading="lazy"

View File

@ -198,7 +198,7 @@ describe("<TextualBody />", () => {
const { container } = getComponent({ mxEvent: ev }); const { container } = getComponent({ mxEvent: ev });
const content = container.querySelector(".mx_EventTile_body"); const content = container.querySelector(".mx_EventTile_body");
expect(content.innerHTML).toMatchInlineSnapshot( expect(content.innerHTML).toMatchInlineSnapshot(
`"Chat with <span><bdi><a class="mx_Pill mx_UserPill mx_UserPill_me" href="https://matrix.to/#/@user:example.com"><span aria-label="Profile picture" aria-hidden="true" data-testid="avatar-img" data-type="round" data-color="2" class="_avatar_mcap2_17 mx_BaseAvatar" style="--cpd-avatar-size: 16px;"><img loading="lazy" alt="" src="mxc://avatar.url/image.png" crossorigin="anonymous" referrerpolicy="no-referrer" class="_image_mcap2_50" data-type="round" width="16px" height="16px"></span><span class="mx_Pill_text">Member</span></a></bdi></span>"`, `"Chat with <span><bdi><a class="mx_Pill mx_UserPill mx_UserPill_me" href="https://matrix.to/#/@user:example.com"><span aria-label="Profile picture" aria-hidden="true" data-testid="avatar-img" data-type="round" data-color="2" class="_avatar_mcap2_17 mx_BaseAvatar" style="--cpd-avatar-size: 16px;"><img loading="lazy" alt="" src="mxc://avatar.url/image.png" referrerpolicy="no-referrer" class="_image_mcap2_50" data-type="round" width="16px" height="16px"></span><span class="mx_Pill_text">Member</span></a></bdi></span>"`,
); );
}); });

View File

@ -65,7 +65,6 @@ exports[`<TextualBody /> renders formatted m.text correctly pills appear for an
<img <img
alt="" alt=""
class="_image_mcap2_50" class="_image_mcap2_50"
crossorigin="anonymous"
data-type="round" data-type="round"
height="16px" height="16px"
loading="lazy" loading="lazy"
@ -113,7 +112,6 @@ exports[`<TextualBody /> renders formatted m.text correctly pills appear for eve
<img <img
alt="" alt=""
class="_image_mcap2_50" class="_image_mcap2_50"
crossorigin="anonymous"
data-type="round" data-type="round"
height="16px" height="16px"
loading="lazy" loading="lazy"
@ -163,7 +161,6 @@ exports[`<TextualBody /> renders formatted m.text correctly pills appear for roo
<img <img
alt="" alt=""
class="_image_mcap2_50" class="_image_mcap2_50"
crossorigin="anonymous"
data-type="round" data-type="round"
height="16px" height="16px"
loading="lazy" loading="lazy"
@ -272,7 +269,6 @@ exports[`<TextualBody /> renders formatted m.text correctly pills get injected c
<img <img
alt="" alt=""
class="_image_mcap2_50" class="_image_mcap2_50"
crossorigin="anonymous"
data-type="round" data-type="round"
height="16px" height="16px"
loading="lazy" loading="lazy"
@ -292,9 +288,9 @@ exports[`<TextualBody /> renders formatted m.text correctly pills get injected c
</span> </span>
`; `;
exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to a message in the same room with the label »Message from Member« 1`] = `"Visit <span><bdi><a class="mx_Pill mx_EventPill" href="https://matrix.to/#/!room1:example.com/%event_id%"><span aria-label="Profile picture" aria-hidden="true" data-testid="avatar-img" data-type="round" data-color="2" class="_avatar_mcap2_17 mx_BaseAvatar" style="--cpd-avatar-size: 16px;"><img loading="lazy" alt="" src="mxc://avatar.url/image.png" crossorigin="anonymous" referrerpolicy="no-referrer" class="_image_mcap2_50" data-type="round" width="16px" height="16px"></span><span class="mx_Pill_text">Message from Member</span></a></bdi></span>"`; exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to a message in the same room with the label »Message from Member« 1`] = `"Visit <span><bdi><a class="mx_Pill mx_EventPill" href="https://matrix.to/#/!room1:example.com/%event_id%"><span aria-label="Profile picture" aria-hidden="true" data-testid="avatar-img" data-type="round" data-color="2" class="_avatar_mcap2_17 mx_BaseAvatar" style="--cpd-avatar-size: 16px;"><img loading="lazy" alt="" src="mxc://avatar.url/image.png" referrerpolicy="no-referrer" class="_image_mcap2_50" data-type="round" width="16px" height="16px"></span><span class="mx_Pill_text">Message from Member</span></a></bdi></span>"`;
exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to an event in another room with the label »Message in Room 2« 1`] = `"Visit <span><bdi><a class="mx_Pill mx_EventPill" href="https://matrix.to/#/!room2:example.com/%event_id%"><span aria-label="Avatar" aria-hidden="true" data-testid="avatar-img" data-type="round" data-color="2" class="_avatar_mcap2_17 mx_BaseAvatar" style="--cpd-avatar-size: 16px;"><img loading="lazy" alt="" src="mxc://avatar.url/room.png" crossorigin="anonymous" referrerpolicy="no-referrer" class="_image_mcap2_50" data-type="round" width="16px" height="16px"></span><span class="mx_Pill_text">Message in Room 2</span></a></bdi></span>"`; exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to an event in another room with the label »Message in Room 2« 1`] = `"Visit <span><bdi><a class="mx_Pill mx_EventPill" href="https://matrix.to/#/!room2:example.com/%event_id%"><span aria-label="Avatar" aria-hidden="true" data-testid="avatar-img" data-type="round" data-color="2" class="_avatar_mcap2_17 mx_BaseAvatar" style="--cpd-avatar-size: 16px;"><img loading="lazy" alt="" src="mxc://avatar.url/room.png" referrerpolicy="no-referrer" class="_image_mcap2_50" data-type="round" width="16px" height="16px"></span><span class="mx_Pill_text">Message in Room 2</span></a></bdi></span>"`;
exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to an unknown message in the same room with the label »Message« 1`] = ` exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to an unknown message in the same room with the label »Message« 1`] = `
<span <span

View File

@ -27,7 +27,6 @@ exports[`PeopleRoomSettingsTab with requests to join renders requests fully 1`]
<img <img
alt="" alt=""
class="_image_mcap2_50" class="_image_mcap2_50"
crossorigin="anonymous"
data-type="round" data-type="round"
height="42px" height="42px"
loading="lazy" loading="lazy"

View File

@ -35,7 +35,6 @@ exports[`<AddExistingToSpaceDialog /> looks as expected 1`] = `
<img <img
alt="" alt=""
class="_image_mcap2_50" class="_image_mcap2_50"
crossorigin="anonymous"
data-type="square" data-type="square"
height="40px" height="40px"
loading="lazy" loading="lazy"

View File

@ -3097,10 +3097,10 @@
dependencies: dependencies:
svg2vectordrawable "^2.9.1" svg2vectordrawable "^2.9.1"
"@vector-im/compound-web@^4.2.0": "@vector-im/compound-web@^4.3.1":
version "4.2.0" version "4.3.1"
resolved "https://registry.yarnpkg.com/@vector-im/compound-web/-/compound-web-4.2.0.tgz#16915a5e64c405360fc049ddfa39b5185725f950" resolved "https://registry.yarnpkg.com/@vector-im/compound-web/-/compound-web-4.3.1.tgz#4570adeccdfcac6919256c5e399d592510bdb15d"
integrity sha512-VSZxIFToDesjiiCGLOj+DrrKv1I0rtpzJbdylarJXY7REnHzVdgaBBtGm403iJ8KkZ2Rn16Mxe+P1/+VS4yiAA== integrity sha512-/Sw27GI0jCg6A7E+93SWFyF3pEwLyLzExB3lIVPTY0mMTx50+rZloRuhuqftUlIscWSlmAUex8Lo4WK8WKPFPA==
dependencies: dependencies:
"@floating-ui/react" "^0.26.9" "@floating-ui/react" "^0.26.9"
"@floating-ui/react-dom" "^2.0.8" "@floating-ui/react-dom" "^2.0.8"