Add VM Monitor Link
Nucleic-Session: 7D59F478-3AC7-4ED2-937F-58546F918C7E Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -559,6 +559,38 @@ private struct AuthErrorRow: View {
|
||||
}
|
||||
}
|
||||
|
||||
/// The in-chat rendering for a "VM opened" note — the one-time line the backend drops when an agent
|
||||
/// first boots a macOS or Linux guest for this session. Instead of a plain log row it shows the note
|
||||
/// text with a one-click "Open VM Monitor" button that surfaces the monitor panel for the chat (so the
|
||||
/// user can watch the guest's screen). The VM-side sibling of `AuthErrorRow`'s "Log in" button; the
|
||||
/// button is absent (`onOpen == nil`) when no panel host is wired, degrading to a plain line.
|
||||
private struct VMMonitorNoteRow: View {
|
||||
@Environment(\.appPalette) private var palette
|
||||
let text: String
|
||||
let icon: String
|
||||
let onOpen: (() -> Void)?
|
||||
|
||||
var body: some View {
|
||||
HStack(alignment: .firstTextBaseline, spacing: 6) {
|
||||
Image(systemName: icon)
|
||||
.font(.caption).foregroundStyle(.secondary).frame(width: 16)
|
||||
Text(text)
|
||||
.font(.callout).foregroundStyle(.secondary)
|
||||
.lineLimit(2).textSelection(.enabled)
|
||||
if let onOpen {
|
||||
Button(action: onOpen) {
|
||||
Label("Open VM Monitor", systemImage: "display")
|
||||
.font(.caption.weight(.semibold))
|
||||
}
|
||||
.buttonStyle(.borderedProminent)
|
||||
.controlSize(.small)
|
||||
.tint(palette.accent)
|
||||
}
|
||||
Spacer(minLength: 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A sent (user) message bubble, right-aligned, with a "revert to here" arrow tucked
|
||||
/// beneath it that reveals on hover. Tapping the arrow asks to wipe this message and
|
||||
/// everything after it and drop the text back into the composer to edit (see
|
||||
|
||||
Reference in New Issue
Block a user