feat(capture): choose what to capture — area, window, browser page or screen

Capture is now a decision, not a hidden setting. The popover shows a four-way scope control with the target named under it (800 x 600 on Display 1, the frontmost window, the front browser window, the whole display), and the window header carries the same choice beside the verbs. Picking Window or Browser hides Redline, dims the screen, names the app under the pointer and highlights its window; a click captures exactly that window, Escape cancels, and the desktop highlights the whole screen. New Session is one click: the current captures stay in their own folder, a fresh session opens, and the area picker comes straight up with the saved area pre-selected — Return keeps it, a drag replaces it. Settings is consolidated into one door (the popover gear, plus Cmd-,): what to capture, saved area, shortcut, ask-on-new-session, sending, session age limit, and a new Updates group with automatic install (on by default; installs only when nothing is unsent). The footer filler and the extra-actions menu are gone.
This commit is contained in:
Claude Fable 5
2026-11-01 11:47:58 +04:00
parent 1ae8351b04
commit 3fb9b504f4
18 changed files with 1601 additions and 152 deletions
+62 -3
View File
@@ -146,15 +146,51 @@ struct SessionsWindowView: View {
.help(showInspector ? "Hide the inspector" : "Show the inspector")
.accessibilityLabel(showInspector ? "Hide the inspector" : "Show the inspector")
// What the next capture takes, in the same place as the verbs.
Menu {
ForEach(CaptureScope.allCases, id: \.self) { scope in
Button {
Task {
await model.chooseCaptureScope(scope)
await model.captureNow()
}
} label: {
Text("\(scope.menuTitle) — capture now")
}
}
Divider()
Button("Choose New Area…") {
Task { await model.rePickRegion() }
}
} label: {
HStack(spacing: 4) {
Image(systemName: scopeSymbol)
Text("\(model.captureScope.displayName) · \(scopeDetail)")
.lineLimit(1)
}
}
.menuStyle(.borderlessButton)
.fixedSize()
.help("What Capture takes")
.accessibilityLabel("Capture: \(model.captureTargetDescription)")
if model.captureScope == .area {
Button("Choose Area…") {
Task { await model.rePickRegion() }
}
.fixedSize()
.help("Pick a new area to capture")
}
Button {
Task { await model.startNewSession() }
Task { await model.newSession() }
} label: {
Label("New Session", systemImage: "plus.square.on.square")
}
.keyboardShortcut("n", modifiers: .command)
.disabled(!model.canStartNewSession)
.disabled(model.isSending)
.fixedSize()
.help("Keep this session and start a fresh one (⌘N)")
.help("Keep this session and start a fresh one, then ask where to capture (⌘N)")
Button {
Task { await model.captureNow() }
@@ -199,6 +235,29 @@ struct SessionsWindowView: View {
model.transport == .oneDrive ? "Save…" : "Send…"
}
private var scopeSymbol: String {
switch model.captureScope {
case .area: return "rectangle.dashed"
case .window: return "macwindow"
case .browser: return "safari"
case .screen: return "display"
}
}
/// Short form for the header: the area size, or what a window scope grabs.
private var scopeDetail: String {
switch model.captureScope {
case .area:
guard let region = model.region else { return "not set" }
return "\(Int(region.rect.width)) × \(Int(region.rect.height))"
case .window: return "front window"
case .browser: return "browser"
case .screen:
guard let region = model.region else { return "all" }
return "Display \(region.displayNumber)"
}
}
// MARK: - Pages
@ViewBuilder