Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions components/pages/posts/post/PostMedia.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
switch (true) {
case isVideo.value:
createVideoPlayer()

break

case isAnimatedMedia.value:
Expand Down Expand Up @@ -115,6 +116,10 @@

fillToContainer: true,

autoPlay: autoplayAnimatedMedia.value,

mute: autoplayAnimatedMedia.value,

Comment on lines +119 to +122
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Add a focused player-options test to lock this behavior.

Consider adding/expanding a PostMedia test that verifies layoutControls.autoPlay and layoutControls.mute follow autoplayAnimatedMedia, so this doesn’t regress silently.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/pages/posts/post/PostMedia.vue` around lines 119 - 122, Add/expand
a unit test for the PostMedia component that asserts layoutControls.autoPlay and
layoutControls.mute mirror the reactive value autoplayAnimatedMedia;
specifically mount or shallowMount PostMedia with different
autoplayAnimatedMedia states and verify the produced player-options (or
emitted/derived layoutControls) set autoPlay and mute accordingly so this
behavior cannot regress (reference symbols: PostMedia component,
autoplayAnimatedMedia, layoutControls.autoPlay, layoutControls.mute,
player-options test).

preload: 'none',

loop: true,
Expand Down
6 changes: 4 additions & 2 deletions pages/settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,11 @@
<!-- autoplayAnimatedMedia -->
<li>
<SettingSwitch v-model="autoplayAnimatedMedia">
<template #name> Autoplay GIFs</template>
<template #name> Autoplay GIFs & videos</template>

<template #description> Automatically play animated GIFs without requiring a click </template>
<template #description>
Automatically play animated GIFs and start videos muted without requiring a click
</template>
</SettingSwitch>
</li>

Expand Down
1 change: 1 addition & 0 deletions test/pages/settings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ describe('/settings', async () => {
await page.waitForSelector('h1')

expect(await page.textContent('h1')).toBe('Settings')
expect(await page.textContent('main')).toContain('Autoplay GIFs & videos')
})
})