Merge pull request #703 from 4gray/refactor-move-global-favorites-to-header

refactor: move global favorites to header
This commit is contained in:
4gray authored and GitHub committed 2025-12-26 01:32:07 +01:00
commit a2240fcc88
4 files changed
+17 -27

No files matched your search

@@ -34,6 +34,14 @@
<app-add-playlist-menu
(playlistTypeSelected)="openAddPlaylistDialog($event)"
/>
<button
mat-icon-button
(click)="navigateToGlobalFavorites()"
[matTooltip]="'HOME.PLAYLISTS.GLOBAL_FAVORITES' | translate"
data-test-id="global-favorites"
>
<mat-icon>star</mat-icon>
</button>
<!-- Combined Filter & Sort button -->
<button
mat-icon-button
@@ -18,6 +18,7 @@ import { MatTooltipModule } from '@angular/material/tooltip';
import { ActivatedRoute, Router } from '@angular/router';
import { TranslateModule } from '@ngx-translate/core';
import { DataService } from 'services';
import { GLOBAL_FAVORITES_PLAYLIST_ID } from 'shared-interfaces';
//import { shell } from 'electron';
import { AddPlaylistMenuComponent, PlaylistType } from 'components';
import { HomeComponent } from '../../../home/home.component';
@@ -78,6 +79,13 @@ export class HeaderComponent implements OnInit {
this.router.navigate(['/settings']);
}
/**
* Navigates to the global favorites view
*/
navigateToGlobalFavorites(): void {
this.router.navigate(['playlists', GLOBAL_FAVORITES_PLAYLIST_ID]);
}
/**
* Opens the provided URL string in new browser window
* @param url url to open