feat: wire ISOCacheManagerWindow + SwitchStatisticsWindowController to Xcode target#19
Merged
Merged
Conversation
…o Xcode target Both source files have existed in the repo for a while but were never added to the Xcode project, so the two "Tools" menu items that referenced them fell back to "coming soon" alerts. This PR pulls them into the build target and replaces the stub alerts with real window instantiation. What lights up ============== - **Tools → ISO Cache Manager**: opens `ISOCacheManagerWindow`. Lists every cached ISO/IPSW under `~/.avf/ISOCache/` with per-image checksum status (verified / not verified / placeholder / failed), size, last-used date, search/filter, and Clear All. The window was already written, so this is pure wire-up — no UI code change. - **Tools → Virtual Switch Statistics**: opens `SwitchStatisticsWindowController`. Auto-refresh every 2s of the global packetsForwarded/Broadcast/MACs counters + per-port packets-rx/tx + bytes-rx/tx. Was previously dumping the same data silently to OSLog via `VirtualNetworkSwitch.printStatistics()`, which made the menu item effectively invisible. Both windows lazy-instantiate on first menu click + retain via an ivar across closes, matching the existing pattern for PacketAnalysisWindow and the three LogViewerWindowController instances. Build fix ========= `SwitchStatisticsWindowController.deinit` called the main-actor- isolated `stopAutoRefresh()` method, which Xcode's stricter Swift 6 concurrency checking rejects from a nonisolated deinit. Replaced the call with the direct Timer invalidate + nil-out (Timer.invalidate is documented thread-safe). Documented inline. Full test suite: 278/278 passing (one pre-existing flaky network test skipped as before). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Two existing source files in the repo were never added to the Xcode target, so the menu items that referenced them fell back to "coming soon" alerts:
The `AppDelegate.showISOCacheManager()` and `showSwitchStatistics()` handlers had explicit
TODO(pre-launch)notes asking for the wire-up. This PR does it.What lights up
Tools → ISO Cache Manager
`ISOCacheManagerWindow` opens with the full management UI:
The window was already written end-to-end. Pure wire-up; zero UI changes in this PR.
Tools → Virtual Switch Statistics
`SwitchStatisticsWindowController` opens with:
Previously the menu item silently called `VirtualNetworkSwitch.printStatistics()` to OSLog — invisible unless the user knew to open Console.app and filter on the subsystem. This makes the data first-class.
Lifecycle
Both windows lazy-instantiate on first menu click + retain via an ivar across closes — same pattern the existing PacketAnalysisWindow and three LogViewerWindowController instances use. No leaks, reopens reuse the existing instance.
Build fix
`SwitchStatisticsWindowController.deinit` called the main-actor-isolated `stopAutoRefresh()` method, which Xcode 16's stricter Swift 6 concurrency rejects from a nonisolated deinit. Replaced with the direct `Timer.invalidate()` + nil-out (Timer.invalidate is documented thread-safe). Documented inline.
Test plan
🤖 Generated with Claude Code