diff --git a/AGENTS.md b/AGENTS.md
new file mode 100644
index 0000000..a7ed8bb
--- /dev/null
+++ b/AGENTS.md
@@ -0,0 +1,5 @@
+# Web player interactions
+
+Give player controls immediate visual feedback. Use short transitions in both directions when menus and dialogs open or close, sections expand or collapse, and items appear or disappear. Match the pace of nearby controls, typically 120–160 ms, and keep the surrounding layout steady.
+
+Honor `prefers-reduced-motion` and keep controls responsive to repeated clicks and keyboard input during transitions.
diff --git a/templates/player/shell.html b/templates/player/shell.html
index 16d3e43..e78a37d 100644
--- a/templates/player/shell.html
+++ b/templates/player/shell.html
@@ -24,7 +24,7 @@
-
@@ -143,7 +143,7 @@
@click="$store.mobile.closeLibrary(); $store.user.menuOpen = !$store.user.menuOpen">
+
{% include "player/account_actions.html" %}
diff --git a/templates/player/sidebar_styles.html b/templates/player/sidebar_styles.html
index ddb7c50..897bc35 100644
--- a/templates/player/sidebar_styles.html
+++ b/templates/player/sidebar_styles.html
@@ -133,6 +133,21 @@
.mobile-account-control .mobile-account-chip { width: 42px; padding: 0; justify-content: center; }
.mobile-account-control .mobile-account-popover { top: calc(100% + 6px); right: 0; width: min(240px, calc(100vw - 24px)); }
.sidebar-account-popover, .mobile-account-control .mobile-account-popover {max-height:calc(100dvh - var(--player-bar-space) - 72px);overflow-y:auto;overscroll-behavior:contain}
+.account-popover[inert] { visibility: hidden; }
+@media (prefers-reduced-motion: no-preference) {
+ .account-popover {
+ /* Leave room for the shadow when the panel is fully open. */
+ clip-path: inset(-32px);
+ opacity: 1;
+ transition: clip-path 150ms ease-out, opacity 120ms ease-out;
+ }
+ .account-popover[inert] {
+ clip-path: inset(100% -32px 0);
+ opacity: 0;
+ transition: clip-path 110ms ease-in, opacity 110ms ease-in, visibility 0s 110ms;
+ }
+ .mobile-account-popover[inert] { clip-path: inset(0 -32px 100%); }
+}
.mobile-library-backdrop { color: var(--text-primary); padding: 0; border: 0; margin: 0; width: 100%; height: 100%; max-width: none; max-height: none; }
.mobile-library-backdrop::backdrop { background: transparent; }
.mobile-library-drawer .music-nav { padding: 4px 2px; overflow: visible; }
diff --git a/tests/browser-sidebar.cjs b/tests/browser-sidebar.cjs
index fc160b9..8f490a8 100644
--- a/tests/browser-sidebar.cjs
+++ b/tests/browser-sidebar.cjs
@@ -136,6 +136,19 @@ async function checkSidebar(browser, mobile) {
}
const trigger = page.locator(mobile ? '.mobile-account-chip' : '.sidebar-account-trigger');
const panel = page.locator(mobile ? '#mobile-account-actions' : '#sidebar-account-actions');
+ await panel.evaluate(el => {
+ window.accountTransitions = [];
+ el.addEventListener('transitionend', event => {
+ if (event.target === el && event.propertyName === 'clip-path') window.accountTransitions.push(el.inert);
+ });
+ });
+ await trigger.click();
+ await page.waitForFunction(() => window.accountTransitions.includes(false));
+ await trigger.click();
+ await panel.waitFor({state:'hidden'});
+ await page.waitForFunction(() => window.accountTransitions.includes(true));
+ await page.emulateMedia({reducedMotion:'reduce'});
+ assert.equal(await panel.evaluate(el => getComputedStyle(el).transitionDuration), '0s');
await trigger.click();
await panel.getByRole('link', {name:'Followed'}).click();
await page.getByRole('heading', {name:'Followed', exact:true}).waitFor();
@@ -154,7 +167,7 @@ async function checkSidebar(browser, mobile) {
await trigger.click();
await panel.getByRole('button', { name: 'Settings' }).click();
await page.locator('.user-settings-modal').waitFor();
- assert.equal(await panel.isVisible(), false);
+ await panel.waitFor({state:'hidden'});
await checkOfflineControls(page, trigger, panel);
assert.equal(await page.evaluate(() => document.documentElement.scrollWidth > innerWidth), false);
assert.deepEqual(errors, []);