feat(web): move Hidden tracks out of main nav, surface from Settings
Hidden tracks (M5b quarantine) is a low-frequency surface — it doesn't warrant a permanent slot in the main nav. Moves the link under a new 'Library' section card on /settings alongside ListenBrainz config. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -26,7 +26,6 @@
|
||||
{ href: '/library/artists', label: 'Artists' },
|
||||
{ href: '/library/albums', label: 'Albums' },
|
||||
{ href: '/library/liked', label: 'Liked' },
|
||||
{ href: '/library/hidden', label: 'Hidden' },
|
||||
{ href: '/search', label: 'Search' },
|
||||
{ href: '/discover', label: 'Discover' },
|
||||
{ href: '/requests', label: 'Requests' },
|
||||
|
||||
@@ -41,7 +41,7 @@ describe('Shell', () => {
|
||||
|
||||
test('renders nav items in expected order', () => {
|
||||
render(Shell);
|
||||
const labels = ['Home', 'Artists', 'Albums', 'Liked', 'Hidden', 'Search',
|
||||
const labels = ['Home', 'Artists', 'Albums', 'Liked', 'Search',
|
||||
'Discover', 'Requests', 'Playlists', 'Settings'];
|
||||
for (const label of labels) {
|
||||
expect(screen.getByRole('link', { name: label })).toBeInTheDocument();
|
||||
@@ -55,19 +55,9 @@ describe('Shell', () => {
|
||||
expect(screen.getByRole('link', { name: 'Playlists' })).toHaveAttribute('href', '/playlists');
|
||||
});
|
||||
|
||||
test('Hidden nav link sits between Liked and Search', () => {
|
||||
test('Hidden link is not in the main nav', () => {
|
||||
render(Shell);
|
||||
const hidden = screen.getByRole('link', { name: 'Hidden' });
|
||||
expect(hidden).toHaveAttribute('href', '/library/hidden');
|
||||
const labels = screen
|
||||
.getAllByRole('link')
|
||||
.map((el) => el.textContent?.trim())
|
||||
.filter(Boolean);
|
||||
const idxLiked = labels.indexOf('Liked');
|
||||
const idxHidden = labels.indexOf('Hidden');
|
||||
const idxSearch = labels.indexOf('Search');
|
||||
expect(idxLiked).toBeLessThan(idxHidden);
|
||||
expect(idxHidden).toBeLessThan(idxSearch);
|
||||
expect(screen.queryByRole('link', { name: 'Hidden' })).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('non-admin users do not see the Admin nav link', () => {
|
||||
|
||||
@@ -97,4 +97,14 @@
|
||||
</div>
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
<section class="space-y-3 rounded border border-border bg-surface p-4">
|
||||
<h2 class="text-lg font-semibold">Library</h2>
|
||||
<ul class="space-y-2 text-sm">
|
||||
<li>
|
||||
<a href="/library/hidden" class="text-accent hover:underline">Hidden tracks</a>
|
||||
<span class="text-text-secondary"> — tracks you've flagged as bad rips, wrong tags, or otherwise unplayable.</span>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user