No single-click destructive action belongs in the kebab. Removing the item orphaned its whole path (RemoveTrackPopover was its only caller, and the admin/tracks API client was the popover's only caller), so per the repo's no-dead-code convention the chain is fully removed: the menu item + its admin/isAdmin plumbing in TrackMenu, RemoveTrackPopover(.svelte/.test), src/lib/api/admin/tracks(.ts/.test), and the now-needless transitive mocks in the CompactTrackCard / PlaylistTrackRow / playlist specs. The kebab is now an 8-item, admin-agnostic menu. The DELETE /api/admin/tracks server endpoint is untouched — a future safer admin surface can rebind it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -10,10 +10,6 @@ vi.mock('$lib/api/likes', () => emptyLikesMock());
|
||||
|
||||
vi.mock('$lib/api/quarantine', () => emptyQuarantineMock());
|
||||
|
||||
vi.mock('$lib/api/admin/tracks', () => ({
|
||||
removeTrack: vi.fn().mockResolvedValue({ deleted_track_id: 't1' })
|
||||
}));
|
||||
|
||||
vi.mock('$lib/api/playlists', () => emptyPlaylistsMock());
|
||||
|
||||
vi.mock('$lib/auth/store.svelte', () => ({
|
||||
|
||||
Reference in New Issue
Block a user