Skip to content

feat: wire ISOCacheManagerWindow + SwitchStatisticsWindowController to Xcode target#19

Merged
DaxxSec merged 1 commit into
mainfrom
feat/wire-prelaunch-windows
May 13, 2026
Merged

feat: wire ISOCacheManagerWindow + SwitchStatisticsWindowController to Xcode target#19
DaxxSec merged 1 commit into
mainfrom
feat/wire-prelaunch-windows

Conversation

@DaxxSec
Copy link
Copy Markdown
Owner

@DaxxSec DaxxSec commented May 13, 2026

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:

  • `SecVF/ISOCacheManagerWindow.swift` — 843 lines
  • `SecVF/SwitchStatisticsWindowController.swift` — 221 lines

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:

  • Lists every cached ISO/IPSW under `~/.avf/ISOCache/`
  • Per-image checksum status (verified / not verified / placeholder / failed)
  • Size, download date, last-used date, distro tag
  • Search/filter by name
  • Clear All (destructive, red-tinted)
  • Refresh

The window was already written end-to-end. Pure wire-up; zero UI changes in this PR.

Tools → Virtual Switch Statistics

`SwitchStatisticsWindowController` opens with:

  • Global counters: status, connected ports, learned MACs, packets forwarded / broadcast
  • Per-port detail: VM name, MAC, packets rx/tx, bytes rx/tx
  • Auto-refresh every 2s (toggleable)
  • ⌘R for manual refresh

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

  • `xcodebuild build` succeeds with both files in the target
  • `xcodebuild test` — 278/278 passing (one pre-existing flaky network test skipped as before)
  • Tools → ISO Cache Manager: window opens, lists cached images, search field filters, Clear All prompts for confirmation
  • Tools → Virtual Switch Statistics: window opens, shows global counters + per-port details, auto-refresh ticks every 2s, ⌘R refreshes immediately
  • Close window, reopen via menu: same window instance comes back (no double-creation)

🤖 Generated with Claude Code

…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>
@DaxxSec DaxxSec merged commit 521c56f into main May 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant