Skip to content

feat(liked-music): add live track search and restore detail-page scroll-edge effect#351

Open
prewue wants to merge 1 commit into
sozercan:mainfrom
prewue:feat/liked-music-search-scroll-edge
Open

feat(liked-music): add live track search and restore detail-page scroll-edge effect#351
prewue wants to merge 1 commit into
sozercan:mainfrom
prewue:feat/liked-music-search-scroll-edge

Conversation

@prewue

@prewue prewue commented Jul 8, 2026

Copy link
Copy Markdown
Contributor
video.mp4

Description

Adds live, in-place search to Liked Music and restores the native macOS 26 toolbar scroll-edge effect on track/detail pages that had it disabled.

The Liked Music page already eagerly paginates the full liked library, so search filters the loaded tracks client-side and matches keep appearing "live" as continuation batches arrive with no extra API calls and no new endpoint. The search field is pinned to the top of the list while scrolling. Separately, the detail/track pages (Liked Music, albums, releases, playlists, artist, top songs, discography, episodes) previously hid the toolbar background and painted a manual top fade, which suppressed the system scroll-edge effect; this restores the default effect while keeping the album-art accent background intact.

AI Prompt (Optional)

🤖 AI Prompt Used

Developed with the assistance of Claude.

AI Tool: Claude

Type of Change

  • ✨ New feature (live search in Liked Music)
  • 🎨 UI/UX improvement (restored native toolbar scroll-edge effect on detail pages)

Related Issues

N/A

Changes Made

  • Liked Music live search: added likedMusicSearchQuery and visibleTracks(for:) filtering to PlaylistDetailViewModel, matching title, artists, album, and video ID (case- and diacritic-insensitive). Results update live as the liked library keeps paginating — filtering runs over already-loaded tracks, with no new API or endpoint.
  • Search UI: new LikedMusicSearchField (liquid-glass + macOS 15 fallback styles) and LikedMusicSearchEmptyState, pinned as a sticky section header on the Liked Music list, with a live result count and clear button. Wired into both PlaylistDetailView (macOS 26) and SimplePlaylistDetailView (macOS 15).
  • Sticky-search fix: when an active search shrinks the visible results, the list now scrolls back to the top via ScrollViewReader, so the pinned field stays visible and keeps focus (previously it unpinned mid-scroll and lost focus while the viewport stayed put).
  • Restored scroll-edge effect: removed .toolbarBackgroundVisibility(.hidden) and the manual .topFade(...) from PlaylistDetailView, ArtistDetailView, ArtistDiscographyView, ArtistEpisodesListView, and TopSongsView, so the native macOS 26 toolbar scroll-edge effect returns. The accentBackground album-art gradient is untouched.
  • Refactor: extracted shared track-row / navigation-link views into PlaylistDetailRows.swift.
  • Accessibility: added search field / clear button / empty-state identifiers.
  • Tests: added PlaylistDetailViewModelTests coverage for search filtering, blank-query passthrough, live continuation updates, the non–Liked-Music guard, and clearing.

Testing

  • Unit tests pass (swift test --skip KasetUITests — 1690 tests across 141 suites)
  • Manual testing performed (Liked Music search + scroll-to-top; restored scroll-edge effect on detail pages)
  • UI tested on macOS 26+ (KasetUITests/LikedMusicViewUITests)

Checklist

  • My code follows the project's style guidelines
  • I have run swiftlint --strict && swiftformat . (0 violations; 0 files require formatting)
  • I have added tests that prove my fix/feature works
  • New and existing unit tests pass locally
  • I have updated documentation if needed (N/A — no doc-facing behavior changed)
  • I have checked for any performance implications (client-side filter over already-loaded tracks; no extra requests)
  • My changes generate no new warnings

Additional Notes

Search intentionally reuses the existing Liked Music playlist pagination rather than a server-side "search liked songs" endpoint YouTube Music exposes no such scoped endpoint, so filtering the fully-paginated liked set client-side is consistent with the current Liked Music loading path.

…ll-edge effect

Liked Music now has an in-place search field pinned to the top of the list.
Filtering runs client-side over the already-paginated liked library, so
matches keep appearing live as continuation batches load — no new API or
endpoint. When an active search shrinks the results, the list scrolls back
to the top so the pinned field stays visible and focused.

Also restores the native macOS 26 toolbar scroll-edge effect on track/detail
pages (Liked Music, albums, releases, artist, top songs, discography,
episodes) by removing the manual toolbar-background hide and top-fade; the
album-art accent background is unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant