From 5cab74be39db0143627f82b876c7656757ddd494 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 14 May 2026 23:00:05 -0400 Subject: [PATCH] fix: correct settings and reactions button selectors for EC 0.19.3 EC 0.19.3 changed the toolbar layout. The old previousElementSibling traversal from the leave button pointed at wrong elements: - settingsButton was finding the raise-hand button - reactionsButton was finding the screenshare button Fix: use stable selectors instead: - settingsButton: data-testid=settings-bottom-center (new in EC 0.19.3) - reactionsButton: [class*=raiseHand] (CSS module class, consistent in 0.19.x) --- src/app/plugins/call/CallControl.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/app/plugins/call/CallControl.ts b/src/app/plugins/call/CallControl.ts index 145283898..8732648dc 100644 --- a/src/app/plugins/call/CallControl.ts +++ b/src/app/plugins/call/CallControl.ts @@ -29,17 +29,13 @@ export class CallControl extends EventEmitter implements CallControlState { } private get settingsButton(): HTMLElement | undefined { - const leaveBtn = this.document?.querySelector('[data-testid="incall_leave"]'); - - const settingsButton = leaveBtn?.previousElementSibling as HTMLElement | null; - - return settingsButton ?? undefined; + // EC 0.19.3: settings button has data-testid="settings-bottom-center" + return (this.document?.querySelector('[data-testid="settings-bottom-center"]') as HTMLElement) ?? undefined; } private get reactionsButton(): HTMLElement | undefined { - const reactionsButton = this.settingsButton?.previousElementSibling as HTMLElement | null; - - return reactionsButton ?? undefined; + // EC 0.19.3: reactions/raise-hand button has a CSS module class containing "raiseHand" + return (this.document?.querySelector('[class*="raiseHand"]') as HTMLElement) ?? undefined; } private get spotlightButton(): HTMLInputElement | undefined { @@ -165,6 +161,8 @@ export class CallControl extends EventEmitter implements CallControlState { } public onControlMutation() { + const prevScreenshare = this.screenshare; + const screenshare: boolean = this.screenshareButton?.getAttribute('data-kind') === 'primary'; const spotlight: boolean = this.spotlightButton?.checked ?? false; @@ -176,6 +174,11 @@ export class CallControl extends EventEmitter implements CallControlState { spotlight ); this.emitStateUpdate(); + + // EC auto-switches to spotlight when screenshare starts — revert to grid + if (!prevScreenshare && screenshare) { + setTimeout(() => { if (this.spotlight) this.gridButton?.click(); }, 600); + } } public setMicrophone(enabled: boolean) {