Skip to content

feat(macOS, iOS): Fluent 2 connected-cover drill transitions and unified motion polish - #545

Open
vizmoe wants to merge 1 commit into
chenqi92:mainfrom
vizmoe:issue/541-fluent-cover-drill-motion
Open

vizmoe wants to merge 1 commit into
chenqi92:mainfrom
vizmoe:issue/541-fluent-cover-drill-motion

Conversation

@vizmoe

@vizmoe vizmoe commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Closes #541

Summary

Upgrades navigation transitions and micro-interactions across macOS and iOS to a cohesive Windows Fluent 2–inspired motion language. Replaces abrupt album detail swaps on macOS with a 120Hz zero-blink connected-cover flight engine across all album entry points, adds Fluent Continuum 3-layer detail staging and a sliding sidebar indicator, and unifies iOS cover-only zoom transitions and elastic hero overscroll stretch.

Changes

  • Pure Fluent 2 Transition Policy (PrimuseKit/Sources/PrimuseKit/Interface/ScreenChangeTransitionPolicy.swift, FluentDrillTransitionPolicyTests.swift):
    • Implemented Fluent 2 cubic-bezier curves (enterEase (0.10, 0.90, 0.20, 1.0) 0.40s zero-overshoot; exitEase (0.16, 0.88, 0.26, 1.0) 0.30s), arc-lifted CoverFrame with mid-flight specular rim highlight (borderHighlightOpacity), clamped clicked-tile overview dive-in anchor (1.0 -> 1.032, avoiding viewport edge gaps), 3-layer Continuum LayerFrame (edge-to-edge backdrop, horizontal header unfold, vertical tracklist settle, fast exit clear), mid-air exit interruption state machine (beginExit(fromCurrentCoverRect:...)), Reduce Motion crossfade fallback, and heroOverscrollFrame stretch math.
    • Added 8 unit tests in FluentDrillTransitionPolicyTests covering curves, exact endpoints, arc/rim, visibility/reduce-motion degradation, clamped anchors, Continuum staging, mid-air live interruption, and hero overscroll bounds.
  • macOS 120Hz Zero-Blink Connected-Cover Drill Engine (MacDetailContainer.swift, MacLibraryHeader.swift, AlbumDetailView.swift):
    • Lifted MacFluentAlbumDrillHost to MacDetailContainer wrapping the detail NavigationStack and drove flight via TimelineView(.animation(paused:)) with dynamic destination-rect calibration and seamless live mid-air Esc/Back reversal.
    • Added bounded MacFluentCoverSnapshot (24-item NSCache + synchronous memory/disk artwork resolution) so flying covers render actual artwork on Frame 0 without grey placeholder flashes.
    • Applied Continuum staging modifiers to MacLibraryHeader metadata and AlbumDetailView tracklist, upgraded macOS album playing-row indicator to SongRowPlayingWaveform, and added favorite heart burst on detail headers.
  • Unified macOS Album Entry Points & Navigation Micro-Interactions:
    • Wired MacFluentAlbumLink + .macFluentCoverSource across AlbumGridView, AlbumCardView, MacHomeView, MacHomeAlbumPickHero, MacHomeRecentlyAddedPage, HomeForYouSection, ArtistDetailView, GenreLibraryView, ReleaseDateLibraryView, ReleaseDateLibraryView+Catalog, SearchView, and .primuseDetailOpenAlbum.
    • Added Fluent 2 3pt leading sliding accent bar & selection pill to MacSidebar, sliding segmented highlight pill to MacSegmentChrome (AlbumGridView), subtle hover lift (1.022x) + pressable tile feedback, unified PMPageEnterModifier & PMMotion curves (ArtistListView, GenreLibraryView, MacContentView, PMTitleBar).
  • iOS Cover-Only Zoom & Hero Overscroll Stretch:
    • Extended MediaZoomTransitionID (ContentView.swift) to Genres, Smart Playlists, and Spoken Word Books (LibraryView, PlaylistListView, GenreLibraryView, SpokenWordLibraryView, HomeView, HomeHeroRecommendations, HomeForYouSection, SearchView), and added MediaZoomSourceShape (.roundedRect / .circle) to clip zoom sources strictly to artwork/avatar bounds.
    • Added pmHeroOverscrollStretch() (PMMotion.swift) to full-bleed headers in AlbumDetailView, ArtistDetailView, and CollectionCoverWallHeader (Playlist / Smart Playlist).

Acceptance Criteria Coverage

  • Connected-cover Fluent 2 flight with zero-blink snapshot, anchored dive-in overview, 3-layer Continuum staging, and mid-air reversal works across all macOS album entry points.
  • Sidebar sliding 3pt accent bar, grid/list sliding pill, card hover/press feedback, and unified page entrance are active on macOS.
  • iOS zoom sources cover all collection detail types with clean artwork/avatar bounds, and full-bleed Album/Artist/Playlist headers stretch elastically from the top edge.
  • Reduce Motion cleanly degrades flight and overscroll stretch to crossfades.

Verification

Verified on commit 5d47766f5 (based on origin/main c4ee8513e):

  • PrimuseKit unit tests (swift test --package-path PrimuseKit --filter 'FluentDrillTransitionPolicyTests|ScreenChangeTransitionPolicyTests'): 25/25 passed.
  • xcodebuild build -scheme PrimuseMac -destination 'platform=macOS' CODE_SIGNING_ALLOWED=NO: BUILD SUCCEEDED.
  • xcodebuild build -scheme Primuse -destination 'generic/platform=iOS' CODE_SIGNING_ALLOWED=NO: BUILD SUCCEEDED.
  • xcodebuild build -scheme PrimuseTV -destination 'generic/platform=tvOS' CODE_SIGNING_ALLOWED=NO: BUILD SUCCEEDED.
  • mise exec xcodegen@2.46.0 -- ruby scripts/check-widget-platforms.rb: passed.
  • mise exec xcodegen@2.46.0 -- python3 -I scripts/gate/gate.py --root . --require-all --strict-baselines --range origin/main..HEAD: 0 errors, 0 warnings, 0 skipped.
  • python3 -I scripts/gate/gate.py --root . --commits origin/main..HEAD: 0 errors, 0 warnings, 0 skipped.
  • Interactive macOS visual verification performed on a local debug build against an isolated sandbox library; interactive iOS simulator testing was skipped locally because the host CoreSimulator runtime is out-of-date for the installed Xcode (iOS device build verified above).

@chenqi92 chenqi92 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't take this one as is. The motion values have to stay in line with the 2.0 interface, and the Mac cover flight has bugs that block it.

Not taking:

  • The Mac cover-flight engine (overlay host, snapshot cache, Continuum staging, arc / rim / 1.032 zoom, delayed pop and root reveal), and FluentDrillTransitionPolicy:
    • Esc or Back twice during the close freezes the detail column. close() cancels the completion task before beginExit, and beginExit returns nil while exiting. The phase stays .exiting, the overview stays disabled and the TimelineView keeps running at 120 Hz.
    • Album to "Go to Artist" to Back no longer returns to the album: the overlay is reset and the album isn't in the path. Opening another album or a playlist loses it too.
    • Clicking an album reads the cover from disk on the main actor (custom artwork always, other covers on a memory miss). The NSCache holds full-size images.
    • The TimelineView wraps the whole NavigationStack, so every frame of the flight rebuilds the column. The container now also re-renders on every library publish (visibleSongCollectionRevision).
    • Clicks on the overview and on Back are ignored while the transition runs, and every pop waits 170 ms. Main is instant here.
    • On reversal only the cover is continuous; the layers jump in one frame.
    • Albums would open two ways on Mac (overlay vs. NavigationStack). Favorites and semantic search still push.
  • Removing .transaction { $0.animation = nil } on the detail root. It's there on purpose (it fixed playlist hangs): with it gone, the album grid/list switch, folder navigation and playlist reordering run inside animation transactions.
  • PMMotion changes (.panel spring 0.28/0.3, pmPageEnter 240 ms and 10 pt, unused .drillIn/.drillOut). These values match the 2.0 skin table, and .panel drives about 15 places, including now-playing sheets.
  • iOS hero overscroll stretch. It belongs to the 2.0 headers, and the title block separates from the artwork by about 96 pt at a 200 pt pull.

These are fine if you send them as a separate, smaller PR on current main:

  • Sliding sidebar selection using PMMotion.selection and the existing pmRowBackground fill, without the 3 pt accent bar. It also needs to actually animate: the route change runs with disablesAnimations, so .animation(_:value:) won't fire there.
  • Sliding pill on the album grid/list switch, with .pmAnimation(.selection) only. Drop the withAnimation around albumViewMode so the grid/list swap stays out of the transaction.
  • iOS zoom sources clipped to the artwork / avatar, plus zoom for genres. For smart playlists and spoken-word books, clip the source to the artwork too (now it's the whole row / label). The Home smart-playlist tile has a destination but no source.
  • Heart burst via the existing PMLikeBurst, and the waveform on the Mac album playing row.
  • pmPageEnter for inline artist / genre detail.
  • New hover in scrolling content must use the pmScrolling* / PMScrollingButton variants (#380). GenreLibraryView adds a raw .pmHoverLift in a horizontal ScrollView.

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.

feat(macOS, iOS): Fluent 2 connected-cover drill transitions, unified zoom sources, and micro-interaction polish

2 participants