feat: add workspace command palette component with tests

- Implemented WorkspaceCommandPaletteComponent for executing commands.
- Added unit tests for command palette functionality.
- Updated WorkspaceShellComponent to integrate command palette and keyboard shortcuts.
- Refactored workspace context panel and shell components for improved UI and functionality.
- Enhanced tooltips and accessibility for various UI elements.
- Removed unused category management functionality from context panel.
This commit is contained in:
4gray committed 2026-03-05 23:34:54 +01:00
1 parent 698668f3e3
commit 7f4c8ae9ad
12 files changed
+1109 -216

No files matched your search

@@ -1,14 +1,6 @@
import { Component, computed, inject, input } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { MatIconButton } from '@angular/material/button';
import { MatIcon } from '@angular/material/icon';
import { MatTooltip } from '@angular/material/tooltip';
import { Router } from '@angular/router';
import { PlaylistErrorViewComponent } from '../xtream-electron/playlist-error-view/playlist-error-view.component';
import {
CategoryManagementDialogComponent,
CategoryManagementDialogData,
} from '../xtream-electron/category-management-dialog/category-management-dialog.component';
import { CategoryViewComponent } from '../xtream-electron/category-view/category-view.component';
import { XtreamStore } from '../xtream-electron/stores/xtream.store';
import { StalkerStore } from '../stalker/stalker.store';
@@ -27,19 +19,12 @@ interface XtreamCategoryLike {
@Component({
selector: 'app-workspace-context-panel',
imports: [
CategoryViewComponent,
MatIcon,
MatIconButton,
MatTooltip,
PlaylistErrorViewComponent,
],
imports: [CategoryViewComponent, PlaylistErrorViewComponent],
templateUrl: './workspace-context-panel.component.html',
styleUrl: './workspace-context-panel.component.scss',
})
export class WorkspaceContextPanelComponent {
private readonly router = inject(Router);
private readonly dialog = inject(MatDialog);
private readonly xtreamStore = inject(XtreamStore);
private readonly stalkerStore = inject(StalkerStore);
@@ -162,39 +147,4 @@ export class WorkspaceContextPanelComponent {
categoryId,
]);
}
openXtreamCategoryManagement(): void {
const context = this.context();
const section = this.section();
if (!this.isXtreamCategories()) {
return;
}
const contentType =
section === 'series'
? 'series'
: section === 'live'
? 'live'
: 'vod';
const dialogRef = this.dialog.open<
CategoryManagementDialogComponent,
CategoryManagementDialogData,
boolean
>(CategoryManagementDialogComponent, {
data: {
playlistId: context.playlistId,
contentType,
itemCounts: this.xtreamCategoryItemCounts(),
},
width: '500px',
maxHeight: '80vh',
});
dialogRef.afterClosed().subscribe((result) => {
if (result) {
this.xtreamStore.reloadCategories();
}
});
}
}