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:
PVAppDelegate creates PVRootViewController (UIViewController)
- Wraps in
PVRootViewNavigationController (UINavigationController)
- Wraps in
SideNavigationController (custom UIKit slide-out panel)
SideMenuView (SwiftUI) is hosted inside via UIHostingController
ConsolesWrapperView (SwiftUI) is main content, also in UIHostingController
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
SideNavigationController with 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
PVRootViewController with a SwiftUI root view
- Replace
PVRootViewNavigationController with NavigationStack
- Move
PVMenuDelegate / PVRootDelegate actions into SwiftUI environment or observable
- Simplify
PVAppDelegate.setupSwiftUIInterface()
Files to Modify/Delete
Delete (~6 files):
SideNavigationController/SideNavigationController.swift
SideNavigationController/SideNavigationController+NestedTypes.swift
SideNavigationController/UIViewController+SideNavigationController.swift
SideMenu/SideMenuNavigationController.swift (mostly commented out)
RootView/PVRootViewNavigationController.swift
SideMenu/NavigationBarConfigurator (embedded in SideMenuView.swift)
Rewrite (~4 files):
RootView/PVRootViewController.swift + extensions → SwiftUI root view
SideMenu/SideMenuView.swift — remove UIKit hosting, use native SwiftUI nav
App Delegate/PVAppDelegate.swift — simplify setupSwiftUIInterface()
Keep mostly unchanged:
ConsolesWrapperView.swift
MenuItemView.swift, MenuSectionHeaderView.swift
PVMenuDelegate.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
Summary
Replace the UIKit-based
SideNavigationControllerslide-out menu with a pure SwiftUI implementation. This is a prerequisite for eventually removing the legacyPVAppDelegate→PVRootViewControllerUIKit hosting chain.Current Architecture
The side menu uses a deep UIKit wrapping stack:
PVAppDelegatecreatesPVRootViewController(UIViewController)PVRootViewNavigationController(UINavigationController)SideNavigationController(custom UIKit slide-out panel)SideMenuView(SwiftUI) is hosted inside viaUIHostingControllerConsolesWrapperView(SwiftUI) is main content, also inUIHostingControllerThe 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
SideNavigationControllerwith a SwiftUI overlay/offset-based menuPhase 2: Remove UIKit Wrappers
PVRootViewControllerwith a SwiftUI root viewPVRootViewNavigationControllerwithNavigationStackPVMenuDelegate/PVRootDelegateactions into SwiftUI environment or observablePVAppDelegate.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
Context
The old
SwiftUI-Introspectdependency was removed and replaced withNavigationBarConfigurator. This works but is fragile — a pure SwiftUI approach would eliminate the responder-chain walking entirely.🤖 Generated with Claude Code