From 37eaa49e4c43e0bc0ade0e4f52d17c6be865e95c Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 12 Dec 2025 18:07:27 +0000 Subject: [PATCH] fix(mac): allow typing in web chat panel --- apps/macos/Sources/Clawdis/WebChatWindow.swift | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/macos/Sources/Clawdis/WebChatWindow.swift b/apps/macos/Sources/Clawdis/WebChatWindow.swift index 5bf8640e3..3e0626cf6 100644 --- a/apps/macos/Sources/Clawdis/WebChatWindow.swift +++ b/apps/macos/Sources/Clawdis/WebChatWindow.swift @@ -12,6 +12,12 @@ private enum WebChatLayout { static let anchorPadding: CGFloat = 8 } +/// A borderless panel that can still accept key focus (needed for typing into the embedded WebChat). +final class WebChatPanel: NSPanel { + override var canBecomeKey: Bool { true } + override var canBecomeMain: Bool { true } +} + enum WebChatPresentation { case window case panel(anchorProvider: () -> NSRect?) @@ -92,9 +98,9 @@ final class WebChatWindowController: NSWindowController, WKNavigationDelegate, N window.minSize = NSSize(width: 880, height: 680) return window case .panel: - let panel = NSPanel( + let panel = WebChatPanel( contentRect: NSRect(origin: .zero, size: WebChatLayout.panelSize), - styleMask: [.nonactivatingPanel, .borderless], + styleMask: [.borderless], backing: .buffered, defer: false) panel.level = .statusBar