refactor(external-playback): improve session handling and remove dismiss functionality

This commit is contained in:
4gray committed 2026-03-14 11:55:26 +01:00
1 parent ec84eea924
commit c42e35b48d
8 files changed
+77 -27

No files matched your search

@@ -53,14 +53,5 @@
}
</button>
}
<button
type="button"
mat-icon-button
class="external-playback-dock__dismiss"
(click)="dismissClicked.emit()"
aria-label="Dismiss now playing panel"
>
<mat-icon>close</mat-icon>
</button>
</div>
</section>
@@ -150,10 +150,7 @@
.external-playback-dock__button {
border-radius: 999px;
}
.external-playback-dock__dismiss {
color: var(--mat-sys-on-surface-variant);
white-space: nowrap;
}
@media (max-width: 720px) {
@@ -36,17 +36,14 @@ describe('ExternalPlaybackDockComponent', () => {
expect(text).toContain('Close player');
});
it('emits close and dismiss actions', () => {
it('emits a single close action', () => {
const closeSpy = jest.fn();
const dismissSpy = jest.fn();
component.closeClicked.subscribe(closeSpy);
component.dismissClicked.subscribe(dismissSpy);
const buttons = fixture.debugElement.queryAll(By.css('button'));
buttons[0].nativeElement.click();
buttons[1].nativeElement.click();
expect(closeSpy).toHaveBeenCalled();
expect(dismissSpy).toHaveBeenCalled();
expect(buttons).toHaveLength(1);
});
});
@@ -22,7 +22,6 @@ export class ExternalPlaybackDockComponent {
readonly compact = input(false);
readonly closeClicked = output<void>();
readonly dismissClicked = output<void>();
readonly playerLabel = computed(() => this.session().player.toUpperCase());
readonly statusLabel = computed(() => {