Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions docs/reference/host-core-reset.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,17 @@ where Swift is still holding deterministic product logic that belongs in Rust.

The current native-host Swift split is:

- `NativeHostApp.swift`: app delegate, menu bar lifecycle, settings/hotkey wiring, launch and
permission orchestration, and the `CaptureSessionController` bridge that routes host events,
host requests, and host-owned side effects.
- `NativeHostApp.swift`: app delegate, menu bar lifecycle, settings/hotkey wiring, launch,
permission orchestration, onboarding, software-update wiring, and status-menu state.
- `CaptureSessionController.swift` plus `CaptureSessionController+*.swift`: the Swift host-session
coordinator around the Rust `RsnapHostSession`. The base file owns shared controller state and
lifecycle hooks; the extensions split live capture/input, frozen selection interactions,
host-request draining, native scroll-capture sampling, copy/save/export effects, Vision OCR, and
runtime teardown/window helpers.
- `CaptureChrome.swift`: shared native chrome metrics, palette, dashed-border geometry, and
AppKit color/image helpers used by live and frozen capture UI.
- `CaptureOverlayWindow.swift`: the AppKit `NSPanel` wrapper that embeds `CaptureHostView` for each
capture overlay window.
- `CaptureOverlayController.swift`: AppKit overlay-window set management, focus/first-responder
routing, capture-stream preparation, mouse passthrough, and CoreGraphics capture sources needed
to sample below native overlay windows.
Expand All @@ -76,6 +84,8 @@ The current native-host Swift split is:
session controller.
- `FrozenCaptureModels.swift`: Swift view-adapter state for Rust-owned frozen overlay editing,
including conversion from Rust edit snapshots into AppKit draw models.
- `NativeHostFeedbackSound.swift`: host-side `NSSound` lookup/playback for capture and OCR
completion effects.
- `NativeHostImageBridge.swift` and `RsnapHostBridge`: conversion and FFI glue between
CoreGraphics/AppKit images and Rust-owned RGBA snapshots.

Expand Down
22 changes: 21 additions & 1 deletion docs/reference/workspace-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,32 @@ It owns:

The main host-kit files are split by responsibility:

- `NativeHostApp.swift`: app delegate and capture-session bridge orchestration
- `NativeHostApp.swift`: app delegate, menu bar lifecycle, settings/hotkey wiring, launch,
permission, onboarding, update, and status-menu orchestration
- `CaptureSessionController.swift`: shared state and lifecycle hooks for the Swift host-session
coordinator around `RsnapHostSession`
- `CaptureSessionController+Live.swift`: live capture startup, live sampling warmup, pointer
movement, and live primary interaction routing
- `CaptureSessionController+FrozenInteraction.swift`: frozen selection movement/resizing,
annotation commands, auto-center, loupe, and toolbar command forwarding
- `CaptureSessionController+HostRequests.swift`: Rust host-request draining, freeze-snapshot
commit handling, host-owned frozen scene preparation, and host-effect dispatch
- `CaptureSessionController+ScrollCapture.swift`: native scroll monitor lifecycle, scroll-event
forwarding, viewport sampling, and scroll minimap preview refresh
- `CaptureSessionController+Export.swift`: copy/save host effects, output naming, capture-image
export, capture-frame effect application, and Rust-backed PNG encoding
- `CaptureSessionController+TextRecognition.swift`: Vision OCR request execution and recognized
text pasteboard publication
- `CaptureSessionController+Runtime.swift`: shared monitor/window lookup, overlay refresh,
teardown, status message, and capture-stream release helpers
- `CaptureChrome.swift`: shared native chrome metrics, palette, and drawing geometry
- `CaptureOverlayWindow.swift`: AppKit `NSPanel` wrapper for capture overlay windows
- `CaptureOverlayController.swift`: overlay window set, focus, stream preparation, and below-overlay
capture source management
- `CaptureHostView.swift`: AppKit view rendering, hit testing, cursor presentation, and native
pointer/key routing
- `FrozenCaptureModels.swift`: Swift adapter models for Rust-owned frozen overlay editing
- `NativeHostFeedbackSound.swift`: host-side sound lookup/playback for completion effects
- `NativeHostImageBridge.swift`: RGBA/CoreGraphics image conversion used by the FFI bridge

It depends on:
Expand Down
Loading
Loading