@lattices/cli 0.4.9 → 0.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +13 -13
- package/{app → apps/mac}/Lattices.app/Contents/Info.plist +10 -2
- package/{app → apps/mac}/Lattices.app/Contents/MacOS/Lattices +0 -0
- package/{app → apps/mac}/Package.swift +2 -1
- package/apps/mac/Resources/Pets/assistant-spark/pet.json +62 -0
- package/apps/mac/Resources/Pets/assistant-spark/spritesheet.webp +0 -0
- package/apps/mac/Resources/Pets/scout-ranger/pet.json +6 -0
- package/apps/mac/Resources/Pets/scout-ranger/spritesheet.webp +0 -0
- package/apps/mac/Sources/AppShell/AppActivationCoordinator.swift +27 -0
- package/apps/mac/Sources/AppShell/AppDelegate.swift +189 -0
- package/apps/mac/Sources/AppShell/AppServicesBootstrap.swift +25 -0
- package/{app → apps/mac}/Sources/AppShell/AppShellView.swift +18 -3
- package/{app → apps/mac}/Sources/AppShell/AppUpdater.swift +4 -3
- package/apps/mac/Sources/AppShell/HotkeyBootstrap.swift +87 -0
- package/{app → apps/mac}/Sources/AppShell/LatticesRuntime.swift +43 -0
- package/{app → apps/mac}/Sources/AppShell/MainView.swift +116 -63
- package/apps/mac/Sources/AppShell/MenuBarController.swift +177 -0
- package/{app → apps/mac}/Sources/AppShell/OnboardingView.swift +72 -60
- package/apps/mac/Sources/AppShell/PermissionsAssistantView.swift +366 -0
- package/apps/mac/Sources/AppShell/PermissionsAssistantWindow.swift +70 -0
- package/{app → apps/mac}/Sources/AppShell/Preferences.swift +37 -2
- package/{app → apps/mac}/Sources/AppShell/SettingsView.swift +815 -156
- package/{app → apps/mac}/Sources/AppShell/SettingsWindow.swift +10 -0
- package/apps/mac/Sources/AppShell/WorkspaceInspectorPresenter.swift +13 -0
- package/{app → apps/mac}/Sources/Core/Actions/HotkeyStore.swift +6 -1
- package/{app → apps/mac}/Sources/Core/Actions/IntentEngine.swift +2 -0
- package/{app → apps/mac}/Sources/Core/Daemon/DaemonServer.swift +5 -0
- package/{app → apps/mac}/Sources/Core/Daemon/LatticesApi.swift +365 -0
- package/{app → apps/mac}/Sources/Core/Desktop/DesktopModel.swift +1 -0
- package/{app → apps/mac}/Sources/Core/Desktop/OcrModel.swift +17 -13
- package/apps/mac/Sources/Core/Desktop/WindowCapture.swift +33 -0
- package/{app → apps/mac}/Sources/Core/Desktop/WindowDragSnapController.swift +18 -217
- package/{app → apps/mac}/Sources/Core/Desktop/WindowPreviewStore.swift +4 -5
- package/{app → apps/mac}/Sources/Core/Desktop/WindowTiler.swift +19 -13
- package/apps/mac/Sources/Core/Input/EventTapBreaker.swift +124 -0
- package/apps/mac/Sources/Core/Input/EventTapThread.swift +54 -0
- package/apps/mac/Sources/Core/Input/InputCaptureResetCenter.swift +20 -0
- package/apps/mac/Sources/Core/Input/KeyboardRemapController.swift +335 -0
- package/apps/mac/Sources/Core/Input/KeyboardRemapStore.swift +141 -0
- package/{app → apps/mac}/Sources/Core/Input/MouseGestureConfig.swift +155 -20
- package/apps/mac/Sources/Core/Input/MouseGestureController.swift +2259 -0
- package/apps/mac/Sources/Core/Input/MouseShortcutStore.swift +170 -0
- package/apps/mac/Sources/Core/Input/SecureEventInputMonitor.swift +39 -0
- package/apps/mac/Sources/Core/Input/ShapeRecognizer.swift +624 -0
- package/apps/mac/Sources/Core/Input/TapBudgetMeter.swift +56 -0
- package/{app → apps/mac}/Sources/Core/Overlays/ScreenMap/ScreenMapState.swift +46 -27
- package/{app → apps/mac}/Sources/Core/Overlays/ScreenMap/ScreenMapView.swift +580 -162
- package/apps/mac/Sources/Core/Overlays/ScreenOverlayCanvasController.swift +1240 -0
- package/{app → apps/mac}/Sources/Core/Overlays/Voice/VoiceCommandWindow.swift +11 -23
- package/{app → apps/mac}/Sources/Core/Pi/PiChatDock.swift +90 -43
- package/{app → apps/mac}/Sources/Core/Pi/PiChatSession.swift +676 -43
- package/{app → apps/mac}/Sources/Core/Pi/PiProviderSetupCallout.swift +5 -5
- package/{app → apps/mac}/Sources/Core/Pi/PiWorkspaceView.swift +93 -44
- package/apps/mac/Sources/Core/System/Capability.swift +79 -0
- package/{app → apps/mac}/Sources/Core/System/PermissionChecker.swift +43 -8
- package/{app → apps/mac}/Sources/Core/Voice/AudioProvider.swift +225 -56
- package/bin/handsoff-infer.ts +14 -5
- package/bin/handsoff-worker.ts +11 -7
- package/bin/infer.ts +406 -0
- package/bin/lattices-app.ts +57 -7
- package/bin/lattices-dev +40 -1
- package/bin/lattices.ts +1 -1
- package/docs/agent-execution-plan.md +9 -9
- package/docs/api.md +119 -0
- package/docs/app.md +1 -0
- package/docs/companion-deck.md +1 -1
- package/docs/gesture-customization-proposal.md +520 -0
- package/docs/mouse-gestures.md +79 -0
- package/docs/overview.md +2 -2
- package/docs/presentation-execution-review.md +9 -9
- package/docs/proposals/LAT-001-gesture-visual-customization.md +522 -0
- package/docs/proposals/LAT-002-shared-overlay-canvas.md +353 -0
- package/docs/proposals/LAT-003-menu-bar-controller-architecture.md +291 -0
- package/docs/proposals/LAT-004-interactive-overlay-actors.md +534 -0
- package/docs/reference/dewey.config.ts +74 -0
- package/docs/reference/install-agent.md +79 -0
- package/docs/repo-structure.md +100 -0
- package/docs/voice-error-model.md +7 -7
- package/docs/voice.md +18 -0
- package/package.json +23 -13
- package/swift/Package.swift +20 -0
- package/swift/Sources/DeckKit/DeckAction.swift +51 -0
- package/swift/Sources/DeckKit/DeckBridgeSecurity.swift +152 -0
- package/swift/Sources/DeckKit/DeckCockpit.swift +82 -0
- package/swift/Sources/DeckKit/DeckHost.swift +7 -0
- package/swift/Sources/DeckKit/DeckManifest.swift +145 -0
- package/swift/Sources/DeckKit/DeckRuntimeSnapshot.swift +533 -0
- package/swift/Sources/DeckKit/DeckTrackpad.swift +63 -0
- package/swift/Sources/DeckKit/DeckValue.swift +93 -0
- package/swift/Sources/DeckKit/DeckVoiceError.swift +88 -0
- package/swift/Tests/DeckKitTests/DeckKitTests.swift +286 -0
- package/app/Sources/AppShell/AppDelegate.swift +0 -408
- package/app/Sources/Core/Input/KeyboardRemapController.swift +0 -184
- package/app/Sources/Core/Input/KeyboardRemapStore.swift +0 -84
- package/app/Sources/Core/Input/MouseGestureController.swift +0 -1203
- package/app/Sources/Core/Input/MouseShortcutStore.swift +0 -107
- /package/{app → apps/mac}/Info.plist +0 -0
- /package/{app → apps/mac}/Lattices.app/Contents/Resources/AppIcon.icns +0 -0
- /package/{app → apps/mac}/Lattices.app/Contents/Resources/tap.wav +0 -0
- /package/{app → apps/mac}/Lattices.app/Contents/_CodeSignature/CodeResources +0 -0
- /package/{app → apps/mac}/Lattices.entitlements +0 -0
- /package/{app → apps/mac}/Resources/tap.wav +0 -0
- /package/{app → apps/mac}/Sources/AppShell/App.swift +0 -0
- /package/{app → apps/mac}/Sources/AppShell/CliActionLauncher.swift +0 -0
- /package/{app → apps/mac}/Sources/AppShell/HomeDashboardView.swift +0 -0
- /package/{app → apps/mac}/Sources/AppShell/KeyRecorderView.swift +0 -0
- /package/{app → apps/mac}/Sources/AppShell/MainWindow.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Actions/HotkeyManager.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Actions/IntentSchema.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Actions/Intents/CreateLayerIntent.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Actions/Intents/DistributeIntent.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Actions/Intents/FocusIntent.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Actions/Intents/HelpIntent.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Actions/Intents/KillIntent.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Actions/Intents/LatticeIntent.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Actions/Intents/LaunchIntent.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Actions/Intents/ListSessionsIntent.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Actions/Intents/ListWindowsIntent.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Actions/Intents/ScanIntent.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Actions/Intents/SearchIntent.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Actions/Intents/SwitchLayerIntent.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Actions/Intents/TileIntent.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Actions/PaletteCommand.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Actions/VoiceIntentResolver.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Companion/CompanionActivityLog.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Companion/CompanionKeyboardController.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Companion/LatticesCompanionBridgeServer.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Companion/LatticesCompanionCockpit.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Companion/LatticesCompanionSecurityCoordinator.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Companion/LatticesCompanionTrackpadController.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Companion/LatticesDeckHost.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Daemon/DaemonProtocol.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Desktop/AccessibilityTextExtractor.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Desktop/AppTypeClassifier.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Desktop/DesktopModelTypes.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Desktop/InventoryManager.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Desktop/InventoryPath.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Desktop/MouseFinder.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Desktop/OcrStore.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Desktop/PlacementSpec.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Desktop/SessionWindowLocator.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Desktop/TilePickerView.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Desktop/WindowPreviewCard.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Desktop/WindowSelectionStore.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Input/KeyboardRemapConfig.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Input/MouseInputDeviceStore.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Input/MouseInputEventViewer.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Overlays/AppWindowShell.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Overlays/CommandMode/CommandModeState.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Overlays/CommandMode/CommandModeView.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Overlays/CommandMode/CommandModeWindow.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Overlays/CommandPalette/CommandPaletteView.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Overlays/CommandPalette/CommandPaletteWindow.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Overlays/HUD/CheatSheetHUD.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Overlays/HUD/HUDBottomBar.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Overlays/HUD/HUDController.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Overlays/HUD/HUDLeftBar.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Overlays/HUD/HUDMinimap.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Overlays/HUD/HUDRightBar.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Overlays/HUD/HUDState.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Overlays/HUD/HUDTopBar.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Overlays/HUD/LauncherHUD.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Overlays/HUD/LayerBezel.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Overlays/OmniSearch/OmniSearchState.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Overlays/OmniSearch/OmniSearchView.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Overlays/OmniSearch/OmniSearchWindow.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Overlays/OverlayPanelShell.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Overlays/ScreenMap/ScreenMapWindowController.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Pi/PiAuthNextStepCard.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Pi/PiAuthPromptCard.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Pi/PiInstallCallout.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/System/DiagnosticLog.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/System/EventBus.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/System/ProcessModel.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/System/ProcessQuery.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/System/SystemTelemetryMonitor.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Voice/AdvisorLearningStore.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Voice/AgentSession.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Voice/HandsOffSession.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Voice/VoiceChatView.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Voice/VoxClient.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Workspace/Project.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Workspace/ProjectScanner.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Workspace/SessionLayerStore.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Workspace/SessionManager.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Workspace/Terminal/Terminal.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Workspace/Terminal/TerminalQuery.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Workspace/Terminal/TerminalSynthesizer.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Workspace/Tmux/TmuxModel.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Workspace/Tmux/TmuxQuery.swift +0 -0
- /package/{app → apps/mac}/Sources/Core/Workspace/WorkspaceManager.swift +0 -0
- /package/{app → apps/mac}/Sources/UI/ActionRow.swift +0 -0
- /package/{app → apps/mac}/Sources/UI/OrphanRow.swift +0 -0
- /package/{app → apps/mac}/Sources/UI/ProjectRow.swift +0 -0
- /package/{app → apps/mac}/Sources/UI/TabGroupRow.swift +0 -0
- /package/{app → apps/mac}/Sources/UI/Theme.swift +0 -0
- /package/{app → apps/mac}/Tests/StageDragTests.swift +0 -0
- /package/{app → apps/mac}/Tests/StageJoinTests.swift +0 -0
- /package/{app → apps/mac}/Tests/StageManagerTests.swift +0 -0
- /package/{app → apps/mac}/Tests/StageTileTests.swift +0 -0
|
@@ -144,7 +144,7 @@ enum CanvasDragMode {
|
|
|
144
144
|
|
|
145
145
|
final class ScreenMapEditorState: ObservableObject {
|
|
146
146
|
@Published var windows: [ScreenMapWindowEntry]
|
|
147
|
-
@Published var selectedLayers: Set<Int> = [
|
|
147
|
+
@Published var selectedLayers: Set<Int> = [] // empty = show all
|
|
148
148
|
@Published var draggingWindowId: UInt32? = nil
|
|
149
149
|
var canvasDragMode: CanvasDragMode = .move
|
|
150
150
|
var currentCursorMode: CanvasDragMode = .move
|
|
@@ -153,7 +153,7 @@ final class ScreenMapEditorState: ObservableObject {
|
|
|
153
153
|
@Published var zoomLevel: CGFloat = 1.0 // 1.0 = fit-all
|
|
154
154
|
@Published var panOffset: CGPoint = .zero // canvas-local pixels
|
|
155
155
|
@Published var focusedDisplayIndex: Int? = nil // nil = all-displays view
|
|
156
|
-
@Published var activeViewportPreset: ScreenMapViewportPreset? = .
|
|
156
|
+
@Published var activeViewportPreset: ScreenMapViewportPreset? = .overview
|
|
157
157
|
@Published var windowSearchQuery: String = ""
|
|
158
158
|
@Published var isTilingMode: Bool = false
|
|
159
159
|
var isSearching: Bool { !windowSearchQuery.isEmpty }
|
|
@@ -380,10 +380,11 @@ final class ScreenMapEditorState: ObservableObject {
|
|
|
380
380
|
return "L\(layer)"
|
|
381
381
|
}
|
|
382
382
|
|
|
383
|
-
/// Windows visible for the active layer filter
|
|
383
|
+
/// Windows visible on the current desktop for the active layer filter.
|
|
384
384
|
var visibleWindows: [ScreenMapWindowEntry] {
|
|
385
|
-
|
|
386
|
-
|
|
385
|
+
let onscreen = windows.filter(\.isOnScreen)
|
|
386
|
+
guard !selectedLayers.isEmpty else { return onscreen }
|
|
387
|
+
return onscreen.filter { selectedLayers.contains($0.layer) }
|
|
387
388
|
}
|
|
388
389
|
|
|
389
390
|
private var worldScopedDisplays: [DisplayGeometry] {
|
|
@@ -398,7 +399,7 @@ final class ScreenMapEditorState: ObservableObject {
|
|
|
398
399
|
|
|
399
400
|
var canvasWorldBounds: CGRect {
|
|
400
401
|
var rects = worldScopedDisplays.map(\.cgRect)
|
|
401
|
-
rects.append(contentsOf: worldScopedWindows.map(\.virtualFrame))
|
|
402
|
+
rects.append(contentsOf: worldScopedWindows.filter(\.hasEdits).map(\.virtualFrame))
|
|
402
403
|
|
|
403
404
|
if rects.isEmpty {
|
|
404
405
|
return CGRect(origin: bboxOrigin, size: screenSize)
|
|
@@ -409,7 +410,7 @@ final class ScreenMapEditorState: ObservableObject {
|
|
|
409
410
|
union = union.union(rect)
|
|
410
411
|
}
|
|
411
412
|
|
|
412
|
-
let pad: CGFloat = focusedDisplayIndex == nil ?
|
|
413
|
+
let pad: CGFloat = focusedDisplayIndex == nil ? 180 : 120
|
|
413
414
|
return union.insetBy(dx: -pad, dy: -pad)
|
|
414
415
|
}
|
|
415
416
|
|
|
@@ -1424,7 +1425,7 @@ final class ScreenMapController: ObservableObject {
|
|
|
1424
1425
|
|
|
1425
1426
|
private func finalizeDisplayFocusChange(flashLabel: Bool) {
|
|
1426
1427
|
guard let ed = editor else { return }
|
|
1427
|
-
focusViewportPreset(ed.activeViewportPreset ?? .
|
|
1428
|
+
focusViewportPreset(ed.activeViewportPreset ?? .overview, flashView: false)
|
|
1428
1429
|
if flashLabel {
|
|
1429
1430
|
flash(ed.focusedDisplay?.label ?? "All displays")
|
|
1430
1431
|
}
|
|
@@ -1454,6 +1455,7 @@ final class ScreenMapController: ObservableObject {
|
|
|
1454
1455
|
guard newZoom != ed.zoomLevel else { return }
|
|
1455
1456
|
ed.activeViewportPreset = nil
|
|
1456
1457
|
ed.zoomLevel = newZoom
|
|
1458
|
+
ed.scale = ed.fitScale * newZoom
|
|
1457
1459
|
objectWillChange.send()
|
|
1458
1460
|
}
|
|
1459
1461
|
|
|
@@ -1677,7 +1679,7 @@ final class ScreenMapController: ObservableObject {
|
|
|
1677
1679
|
func enter() {
|
|
1678
1680
|
let existingSets = windowSets
|
|
1679
1681
|
guard let windowList = CGWindowListCopyWindowInfo(
|
|
1680
|
-
[.
|
|
1682
|
+
[.optionOnScreenOnly, .excludeDesktopElements], kCGNullWindowID
|
|
1681
1683
|
) as? [[String: Any]] else { return }
|
|
1682
1684
|
|
|
1683
1685
|
struct CGWin {
|
|
@@ -1724,7 +1726,7 @@ final class ScreenMapController: ObservableObject {
|
|
|
1724
1726
|
guard CGRectMakeWithDictionaryRepresentation(boundsDict, &rect) else { continue }
|
|
1725
1727
|
guard rect.width >= 100 && rect.height >= 50 else { continue }
|
|
1726
1728
|
let app = info[kCGWindowOwnerName as String] as? String ?? ""
|
|
1727
|
-
if app == "Lattices" || app == "lattices" || app == "AutoFill" { continue }
|
|
1729
|
+
if app == "Lattices" || app == "lattices" || app == "AutoFill" || app == "Codex Computer Use" { continue }
|
|
1728
1730
|
let pid = info[kCGWindowOwnerPID as String] as? Int32 ?? 0
|
|
1729
1731
|
let title = info[kCGWindowName as String] as? String ?? ""
|
|
1730
1732
|
let dIdx = displayIndex(for: rect)
|
|
@@ -1844,15 +1846,14 @@ final class ScreenMapController: ObservableObject {
|
|
|
1844
1846
|
}
|
|
1845
1847
|
}
|
|
1846
1848
|
|
|
1847
|
-
//
|
|
1848
|
-
if
|
|
1849
|
+
// Start monitor-first: focus the display under the cursor, or the first display.
|
|
1850
|
+
if !displayGeometries.isEmpty {
|
|
1849
1851
|
let mouseLocation = NSEvent.mouseLocation
|
|
1850
1852
|
let mouseCG = CGPoint(x: mouseLocation.x, y: primaryHeight - mouseLocation.y)
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
}
|
|
1853
|
+
if let display = displayGeometries.first(where: { $0.cgRect.contains(mouseCG) }) {
|
|
1854
|
+
newEditor.focusedDisplayIndex = display.index
|
|
1855
|
+
} else {
|
|
1856
|
+
newEditor.focusedDisplayIndex = displayGeometries[0].index
|
|
1856
1857
|
}
|
|
1857
1858
|
}
|
|
1858
1859
|
|
|
@@ -1867,7 +1868,12 @@ final class ScreenMapController: ObservableObject {
|
|
|
1867
1868
|
self.activeWindowSetID = nil
|
|
1868
1869
|
}
|
|
1869
1870
|
selectedWindowIds = []
|
|
1870
|
-
focusViewportPreset(.
|
|
1871
|
+
focusViewportPreset(.overview, flashView: false)
|
|
1872
|
+
DispatchQueue.main.asyncAfter(deadline: .now() + 0.08) { [weak self] in
|
|
1873
|
+
guard let self,
|
|
1874
|
+
self.editor?.activeViewportPreset == .overview else { return }
|
|
1875
|
+
self.focusViewportPreset(.overview, flashView: false)
|
|
1876
|
+
}
|
|
1871
1877
|
}
|
|
1872
1878
|
|
|
1873
1879
|
/// Re-snapshot, preserving display/layer context
|
|
@@ -1914,10 +1920,15 @@ final class ScreenMapController: ObservableObject {
|
|
|
1914
1920
|
ed.activeViewportPreset = preset
|
|
1915
1921
|
let rect = ed.viewportRect(for: preset)
|
|
1916
1922
|
DiagnosticLog.shared.info("[Canvas] preset → \(preset.title)")
|
|
1923
|
+
if preset == .overview {
|
|
1924
|
+
ed.zoomLevel = 1
|
|
1925
|
+
ed.scale = ed.fitScale
|
|
1926
|
+
ed.panOffset = .zero
|
|
1927
|
+
}
|
|
1917
1928
|
queueCanvasNavigation(
|
|
1918
1929
|
centeredOn: CGPoint(x: rect.midX, y: rect.midY),
|
|
1919
1930
|
rect: rect,
|
|
1920
|
-
zoomToFit:
|
|
1931
|
+
zoomToFit: preset != .overview
|
|
1921
1932
|
)
|
|
1922
1933
|
if flashView {
|
|
1923
1934
|
flash(preset.title)
|
|
@@ -1960,6 +1971,14 @@ final class ScreenMapController: ObservableObject {
|
|
|
1960
1971
|
}
|
|
1961
1972
|
|
|
1962
1973
|
setViewport(centeredOn: target.center, zoomLevel: targetZoom)
|
|
1974
|
+
if target.zoomToFit {
|
|
1975
|
+
ed.pendingCanvasNavigation = ScreenMapCanvasNavigationTarget(
|
|
1976
|
+
center: target.center,
|
|
1977
|
+
rect: nil,
|
|
1978
|
+
zoomToFit: false
|
|
1979
|
+
)
|
|
1980
|
+
ed.canvasNavigationRevision &+= 1
|
|
1981
|
+
}
|
|
1963
1982
|
if shouldLogView {
|
|
1964
1983
|
let viewport = ed.viewportWorldRect
|
|
1965
1984
|
DiagnosticLog.shared.info(
|
|
@@ -2741,9 +2760,10 @@ final class ScreenMapController: ObservableObject {
|
|
|
2741
2760
|
|
|
2742
2761
|
var captures: [UInt32: NSImage] = [:]
|
|
2743
2762
|
for win in visible {
|
|
2744
|
-
if let cgImage =
|
|
2745
|
-
|
|
2746
|
-
|
|
2763
|
+
if let cgImage = WindowCapture.image(
|
|
2764
|
+
listOption: .optionIncludingWindow,
|
|
2765
|
+
windowID: CGWindowID(win.id),
|
|
2766
|
+
imageOption: [.boundsIgnoreFraming, .bestResolution]
|
|
2747
2767
|
) {
|
|
2748
2768
|
captures[win.id] = NSImage(cgImage: cgImage,
|
|
2749
2769
|
size: NSSize(width: win.virtualFrame.width, height: win.virtualFrame.height))
|
|
@@ -2966,11 +2986,10 @@ final class WindowBezel {
|
|
|
2966
2986
|
|
|
2967
2987
|
// Capture window content for screenshot tool compositing
|
|
2968
2988
|
let windowSnapshot: NSImage? = {
|
|
2969
|
-
guard let cgImage =
|
|
2970
|
-
.
|
|
2971
|
-
.
|
|
2972
|
-
|
|
2973
|
-
[.bestResolution, .boundsIgnoreFraming]
|
|
2989
|
+
guard let cgImage = WindowCapture.image(
|
|
2990
|
+
listOption: .optionIncludingWindow,
|
|
2991
|
+
windowID: win.id,
|
|
2992
|
+
imageOption: [.bestResolution, .boundsIgnoreFraming]
|
|
2974
2993
|
) else { return nil }
|
|
2975
2994
|
return NSImage(cgImage: cgImage, size: NSSize(width: cgFrame.width, height: cgFrame.height))
|
|
2976
2995
|
}()
|