From 256922e791aca7b0c4b02433d061296fbf901283 Mon Sep 17 00:00:00 2001 From: Chris Alves <25260078+chrisae9@users.noreply.github.com> Date: Sun, 11 Oct 2026 23:12:36 -0400 Subject: [PATCH] fix: compact watch-party participant layout --- src/__tests__/sidebar-room-actions.test.js | 12 ++++++-- src/components/TheSidebarRight.vue | 24 ++++++++------- src/components/UserList.vue | 36 +++++++++++++++------- test/fixtures/ui-preview.js | 9 ++++-- test/fixtures/ui-preview.vue | 4 ++- 5 files changed, 57 insertions(+), 28 deletions(-) diff --git a/src/__tests__/sidebar-room-actions.test.js b/src/__tests__/sidebar-room-actions.test.js index ce481e0bce..43cc6d6e86 100644 --- a/src/__tests__/sidebar-room-actions.test.js +++ b/src/__tests__/sidebar-room-actions.test.js @@ -16,7 +16,7 @@ vi.mock('@/components/ThePwaInstall.vue', () => ({ default: { template: '
vi.mock('@/components/ReportProblem.vue', () => ({ default: { template: '' } })); vi.mock('@/components/TheSettingsDialog.vue', () => ({ default: { template: '' } })); -const setup = (component, inRoom = true) => { +const setup = (component, inRoom = true, host = null) => { const disconnect = vi.fn(); const store = createStore({ state: { isLeftSidebarOpen: true, isRightSidebarOpen: true }, @@ -31,7 +31,7 @@ const setup = (component, inRoom = true) => { getters: { IS_IN_ROOM: () => inRoom, GET_USERS: () => ({ me: { username: 'Me' } }), - GET_HOST_USER: () => null, + GET_HOST_USER: () => host, AM_I_HOST: () => false, IS_PARTY_PAUSING_ENABLED: () => false, IS_AUTO_HOST_ENABLED: () => false, @@ -79,6 +79,14 @@ describe('sidebar close and room exit', () => { } finally { wrapper.unmount(); } }); + it('omits host-only control rows for a viewer during playback', () => { + const { wrapper } = setup(TheSidebarRight, true, { username: 'Host', state: 'playing' }); + try { + expect(wrapper.findAll('.switch-item')).toHaveLength(0); + expect(wrapper.get('[aria-label="Pause party"]').exists()).toBe(true); + } finally { wrapper.unmount(); } + }); + it('disconnects only through the labeled navigation action', async () => { const { wrapper, store, disconnect } = setup(TheSidebarLeft); try { diff --git a/src/components/TheSidebarRight.vue b/src/components/TheSidebarRight.vue index c3cc893515..5c26d2c8f3 100644 --- a/src/components/TheSidebarRight.vue +++ b/src/components/TheSidebarRight.vue @@ -41,6 +41,7 @@ @update:model-value="SET_ADVANCED_PARTY_MODE" />- Four sample participants. Messages and party controls stay in this fixture’s memory. + Six sample participants. Messages and party controls stay in this fixture’s memory.