Commit b4a5a2a
Stabilize swipe gesture modifiers so 3D window survives UI auto-hide
The swipe modifiers branched on `enabled` with an if/else inside their
ViewModifier body. SwiftUI compiles that into a _ConditionalContent whose
branch flip reroots the wrapped view. Once `isSwipeEnabled` started
depending on `isUIHidden`, the auto-hide tick toggled the branch — and on
the RealityKit 3D path that tore down the ImagePresentationComponent, so
the immersive 3D window disappeared the moment the ornament hid.
Keep view identity constant by always attaching the gesture and gating
the work inside its onEnded closure instead.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent cf67a28 commit b4a5a2a
1 file changed
Lines changed: 20 additions & 21 deletions
Lines changed: 20 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
718 | 718 | | |
719 | 719 | | |
720 | 720 | | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
721 | 726 | | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
732 | 734 | | |
733 | 735 | | |
734 | 736 | | |
| |||
739 | 741 | | |
740 | 742 | | |
741 | 743 | | |
742 | | - | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
753 | 752 | | |
754 | 753 | | |
0 commit comments