Replace UIKit SideNavigationController with pure SwiftUI side menu
Summary
Replace the UIKit-based SideNavigationController slide-out menu with a pure SwiftUI implementation. This is a prerequisite for eventually removing the legacy PVAppDelegate → PVRootViewController UIKit hosting chain.
Current Architecture
The side menu uses a deep UIKit wrapping stack:
PVAppDelegatecreatesPVRootViewController(UIViewController)- Wraps in
PVRootViewNavigationController(UINavigationController) - Wraps in
SideNavigationController(custom UIKit slide-out panel) SideMenuView(SwiftUI) is hosted inside viaUIHostingControllerConsolesWrapperView(SwiftUI) is main content, also inUIHostingController
The nav bar logo/header relies on a NavigationBarConfigurator (UIViewControllerRepresentable) that walks up the responder chain to find the UINavigationController and set the Provenance logo.
Proposed Changes
Phase 1: SwiftUI Side Menu Container
- Replace
SideNavigationControllerwith a SwiftUI overlay/offset-based menu - Implement drag gesture to open/close (replaces UIKit pan gesture recognizers)
- Orientation-aware width (70% portrait iPhone, 30-40% iPad/landscape)
- Dimming overlay on main content when menu is open
- Preserve gamepad support (menu toggle, shoulder buttons)
Phase 2: Remove UIKit Wrappers
- Replace
PVRootViewControllerwith a SwiftUI root view - Replace
PVRootViewNavigationControllerwithNavigationStack - Move
PVMenuDelegate/PVRootDelegateactions into SwiftUI environment or observable - Simplify
PVAppDelegate.setupSwiftUIInterface()
Files to Modify/Delete
Delete (~6 files):
SideNavigationController/SideNavigationController.swiftSideNavigationController/SideNavigationController+NestedTypes.swiftSideNavigationController/UIViewController+SideNavigationController.swiftSideMenu/SideMenuNavigationController.swift(mostly commented out)RootView/PVRootViewNavigationController.swiftSideMenu/NavigationBarConfigurator(embedded in SideMenuView.swift)
Rewrite (~4 files):
RootView/PVRootViewController.swift+ extensions → SwiftUI root viewSideMenu/SideMenuView.swift— remove UIKit hosting, use native SwiftUI navApp Delegate/PVAppDelegate.swift— simplifysetupSwiftUIInterface()
Keep mostly unchanged:
ConsolesWrapperView.swiftMenuItemView.swift,MenuSectionHeaderView.swiftPVMenuDelegate.swift,PVRootDelegate.swift(protocols)
Platform Considerations
- Must work on iOS and tvOS
- tvOS has no edge pan gestures — menu opens via gamepad/remote button
- iPad should support larger menu widths in regular size class
Context
The old SwiftUI-Introspect dependency was removed and replaced with NavigationBarConfigurator. This works but is fragile — a pure SwiftUI approach would eliminate the responder-chain walking entirely.
Generated with Claude Code
Source: Provenance-Emu/Provenance