Skip to content

Hero pop: stop shifting layout mid-transition on Home dismiss

jedmund requested to merge jedmund/sao-paulo-v6 into main

Created by: jedmund

Summary

Fixes the regression where dismissed hero snapshots land offset from their grid position on the Home tab and snap into place at the end of the pop animation. Only Home showed the symptom because it's the sole tab root whose tab bar is visible at rest.

Two layout shifts were firing synchronously with the pop transition:

  • PixillateHostingController.viewWillDisappear was restoring the nav bar via setNavigationBarHidden(false, animated:), even though every VC in the stack now hides it on its own viewWillAppear. That restore animated the nav-bar height over ~0.3s — the entire hero transition window — shifting the scroll content while the animator read the registry.
  • IllustDetailViewController.viewWillDisappear was restoring the tab bar synchronously. Pushed chrome like TagFeedView batched the falsetrue observable transition (because they immediately re-hide it on their viewWillAppear), so no visible change. Home doesn't re-hide, so SwiftUI re-rendered MainTabView mid-pop with the tab bar back, content shifted down, and cells' registered rects went stale.

Fix drops the nav-bar restore entirely (it's dead code now that all VCs in the stack hide the nav bar) and defers the tab-bar restore to viewDidDisappear so it fires after the pop animation completes.

Test plan

  • Tap cell on Home → push → dismiss: snapshot lands exactly on the source cell, no snap
  • Repeat on Search → TagFeedView → cell → dismiss: still works
  • Repeat on Bookmarks (ProfileView tab root) → cell → dismiss: still works
  • Repeat on a pushed ProfileView (from detail user-row tap) → cell → dismiss: still works
  • Related grid inside detail → tap related cell → dismiss: still works
  • Tab bar re-appears cleanly after Home pop completes (no flicker)

🤖 Generated with Claude Code

Merge request reports

Loading