mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-09-04 10:11:46 +03:00
fix(tui): dismiss runtime pickers on outside click
This commit is contained in:
+10
-1
@@ -487,10 +487,15 @@ export class NanobotTui {
|
||||
flexDirection: "column",
|
||||
backgroundColor: RGBA.defaultBackground(),
|
||||
onMouseDown: (event) => {
|
||||
if (event.button !== 0) return
|
||||
// Runtime pickers are transient popovers. A primary click anywhere
|
||||
// outside their trigger or body dismisses them; hide() restores the
|
||||
// composer focus through the shared visibility callback.
|
||||
this.dismissRuntimeControls()
|
||||
// Selection belongs to transcript/input content, never to empty chrome.
|
||||
// Clearing it here prevents default-background cells from lingering as
|
||||
// opaque blocks in terminals with differential repainting.
|
||||
if (event.button === 0 && event.target && !event.target.selectable) {
|
||||
if (event.target && !event.target.selectable) {
|
||||
this.renderer.clearSelection()
|
||||
}
|
||||
},
|
||||
@@ -1732,6 +1737,10 @@ export class NanobotTui {
|
||||
this.activeMentionQuery = null
|
||||
}
|
||||
|
||||
private dismissRuntimeControls(): void {
|
||||
if (this.runtimeControls.visible) this.runtimeControls.hide()
|
||||
}
|
||||
|
||||
private applyWorkspaceScope(scope: WorkspaceScopePayload): void {
|
||||
if (scope.project_path) {
|
||||
this.hostWorkspace = scope.project_path
|
||||
|
||||
Reference in New Issue
Block a user