Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
7f68661
file body uses new previews
Siriusmart Jul 29, 2026
27fe1cc
collapsed and uncollapsed image tile
Siriusmart Jul 29, 2026
4e75f83
using the new preview tiles in upload confirm dialog
Siriusmart Jul 29, 2026
c9d4eae
audio and video tag
Siriusmart Jul 30, 2026
23311cc
slapped on the styles for url previews as well
Siriusmart Jul 30, 2026
eb22e50
remove old urlpreview code
Siriusmart Aug 11, 2026
ac265cc
fixed upload audio upload preview failing, and hide preview box when …
Siriusmart Aug 11, 2026
ad65da0
undo the removal of the legacy mediabody
Siriusmart Aug 12, 2026
8ddb2be
undo removing the audio/voice message mediabody
Siriusmart Aug 12, 2026
bf2d791
fixed oxlint issues
Siriusmart Aug 12, 2026
0a297fa
regenerate storybook screenshots
Siriusmart Aug 12, 2026
b878360
regenerate stuff for end to end tests
Siriusmart Aug 13, 2026
8b8373f
jest and linter fix
Siriusmart Aug 13, 2026
184c0b1
regenreated one image
Siriusmart Aug 13, 2026
98149bb
show the new file preview in file search
Siriusmart Aug 13, 2026
790949c
claude fixed end to end tests
Siriusmart Aug 13, 2026
54fb7e5
pass lint
Siriusmart Aug 13, 2026
386c20b
upload dialogue use tallbanner instead of full images
Siriusmart Aug 17, 2026
b878250
fixed tests
Siriusmart Aug 26, 2026
4b34b5c
Merge branch 'unified-previews/1-mediapreview-components' into unifie…
Siriusmart Sep 1, 2026
0d157a2
Merge branch 'unified-previews/1-mediapreview-components' into unifie…
Siriusmart Sep 1, 2026
f19805c
Cover the file preview tile and its view model
Siriusmart Sep 1, 2026
7582050
Update the file panel screenshot to CI's rendering
Siriusmart Sep 1, 2026
c24d6e1
applied some reviews
Siriusmart Sep 2, 2026
8b72b93
oxlint
Siriusmart Sep 2, 2026
ca67d01
Merge branch 'unified-previews/1-mediapreview-components' into unifie…
Siriusmart Sep 2, 2026
a44b4f9
docs for mediapreiewgroupviewmodel
Siriusmart Sep 2, 2026
dcaac3e
uses wrapper!
Siriusmart Sep 2, 2026
a2683b0
switch to userevent
Siriusmart Sep 2, 2026
824dacf
renamed file name in test to more sensible thing
Siriusmart Sep 2, 2026
1142736
use screen.getByRole instead of the destructed getByRole
Siriusmart Sep 2, 2026
59b6fbd
made a new view model for mbodyfactory
Siriusmart Sep 2, 2026
681a393
regenered one snapshot
Siriusmart Sep 2, 2026
99bcd4b
Merge branch 'unified-previews/1-mediapreview-components' into unifie…
Siriusmart Sep 3, 2026
fa0dcbe
use aria label selector
Siriusmart Sep 3, 2026
8800218
Merge branch 'unified-previews/2-file-body-preview-tile' of https://g…
Siriusmart Sep 3, 2026
107885e
update changes from merge
Siriusmart Sep 3, 2026
5adaf19
make bubble layout try to use as much width as the mediatile allow
Siriusmart Sep 4, 2026
c6b2072
fixed type issue
Siriusmart Sep 4, 2026
bb52722
shared component diff again
Siriusmart Sep 4, 2026
d4030e1
updated snapshot
Siriusmart Sep 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions apps/web/playwright/e2e/modules/composer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ test.describe("Composer API", () => {
await app.getComposer().getByRole("button", { name: "Attachment" }).click();
await page.getByRole("menuitem", { name: "Example uploader" }).click({ noWaitAfter: true });
await page.locator(".mx_Dialog").getByRole("button", { name: "Upload" }).click();
const fileTile = page.locator(".mx_MFileBody").first();
await expect(fileTile).toBeVisible();
// The timeline renders the uploaded file as a preview tile with its name and a download button
const fileTile = page.getByRole("listitem").filter({ hasText: "testfile.txt" });
await expect(fileTile.getByText("testfile.txt")).toBeVisible();
await expect(fileTile.getByRole("button", { name: "Download" })).toBeVisible();
});
});
29 changes: 13 additions & 16 deletions apps/web/playwright/e2e/right-panel/file-panel.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,10 @@ test.describe("FilePanel", () => {
// Assert that the audio player is rendered
await expect(roomViewBody.getByRole("region", { name: "Audio player" })).toBeVisible();

// Assert that the file button exists
await expect(
roomViewBody
.locator(".mx_EventTile")
.filter({ has: page.locator(".mx_MFileBody", { hasText: ".json" }) }),
).toBeVisible();
// Assert that the file is rendered as a preview tile with its name and a download button
const fileTile = roomViewBody.locator(".mx_EventTile").last();
await expect(fileTile.getByText(/matrix.*?\.json/)).toBeVisible();
await expect(fileTile.getByRole("button", { name: "Download" })).toBeVisible();

const filePanel = page.locator(".mx_FilePanel");
// Assert that the file panel is opened inside mx_RightPanel and visible
Expand All @@ -84,8 +82,9 @@ test.describe("FilePanel", () => {
// Assert that all of the file tiles are rendered
await expect(filePanelMessageList.locator(".mx_EventTile")).toHaveCount(3);

// Assert that the download links are rendered
await expect(filePanelMessageList.locator(".mx_MFileBody")).toHaveCount(3);
// Assert that the download links are rendered for the image and the audio file, which embed
// the classic file body as their download-only fallback
await expect(filePanelMessageList.locator(".mx_MFileBody")).toHaveCount(2);

// Assert that the sender of the files is rendered on all of the tiles
await expect(filePanelMessageList.getByText(NAME)).toHaveCount(3);
Expand All @@ -105,13 +104,10 @@ test.describe("FilePanel", () => {
await expect(audio.getByRole("button", { name: "Play" })).toBeVisible();

// Detect the JSON file
const jsonTile = filePanelMessageList
.locator(".mx_EventTile")
.filter({ has: page.locator(".mx_MFileBody", { hasText: ".json" }) });
// Assert that the tile is rendered as a button
const file = jsonTile.getByTestId("event-tile-slot-body").getByRole("button", { name: /matrix.*?\.json/ });
// Assert that the file name is exposed by the button with ellipsis
await expect(file).toHaveAccessibleName(/matrix.*?\.json/);
// Assert that the file is rendered as a preview tile with its name and a download button
const file = filePanelMessageList.locator(".mx_EventTile").last();
await expect(file.getByText(/matrix.*?\.json/)).toBeVisible();
await expect(file.getByRole("button", { name: "Download" })).toBeVisible();

// Make the viewport tall enough to display all of the file tiles on FilePanel
await page.setViewportSize({ width: 800, height: 1000 });
Expand Down Expand Up @@ -187,7 +183,8 @@ test.describe("FilePanel", () => {
const tile = page.locator(".mx_FilePanel .mx_EventTile");
// Assert that the file size is displayed in kibibytes, not kilobytes (1000 bytes)
// See: https://github.com/vector-im/element-web/issues/24866
await expect(tile.locator(".mx_MFileBody [data-type='info']", { hasText: size })).toBeVisible();
// The panel renders files as a preview tile, which shows the size as the tile body.
await expect(tile.getByText(size)).toBeVisible();
});
});

Expand Down
2 changes: 1 addition & 1 deletion apps/web/playwright/e2e/timeline/timeline.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -723,11 +723,11 @@ test.describe("Timeline", () => {

// Assert that the file size is displayed in kibibytes (1024 bytes), not kilobytes (1000 bytes)
// See: https://github.com/vector-im/element-web/issues/24866
// The timeline renders files as a preview tile, which shows the size as the tile body.
await expect(
page
.locator(".mx_EventTile")
.last()
.locator(".mx_MFileBody [data-type='info']")
.getByText(/1.12 KB/),
).toBeVisible();
});
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading