summaryrefslogtreecommitdiff
path: root/popups.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2026-02-23 12:46:28 +0300
committerGrail Finder <wohilas@gmail.com>2026-02-23 12:46:28 +0300
commit04db7c2f01355f2c43843794522380607e807716 (patch)
tree79446ff4d5f43b936e62a5381a8f4f30e2c86886 /popups.go
parent3d889e70b55e8bf4b7d94ac7d42d09ea16203f3e (diff)
Enha: not allow popups outside of main page
Diffstat (limited to 'popups.go')
-rw-r--r--popups.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/popups.go b/popups.go
index 0226461..829a412 100644
--- a/popups.go
+++ b/popups.go
@@ -65,16 +65,19 @@ func showModelSelectionPopup() {
chatBody.Model = modelName
cfg.CurrentModel = chatBody.Model
pages.RemovePage("modelSelectionPopup")
+ app.SetFocus(textArea)
updateCachedModelColor()
updateStatusLine()
})
modelListWidget.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
if event.Key() == tcell.KeyEscape {
pages.RemovePage("modelSelectionPopup")
+ app.SetFocus(textArea)
return nil
}
if event.Key() == tcell.KeyRune && event.Rune() == 'x' {
pages.RemovePage("modelSelectionPopup")
+ app.SetFocus(textArea)
return nil
}
return event
@@ -160,6 +163,7 @@ func showAPILinkSelectionPopup() {
cfg.CurrentModel = chatBody.Model
}
pages.RemovePage("apiLinkSelectionPopup")
+ app.SetFocus(textArea)
choseChunkParser()
updateCachedModelColor()
updateStatusLine()
@@ -167,10 +171,12 @@ func showAPILinkSelectionPopup() {
apiListWidget.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
if event.Key() == tcell.KeyEscape {
pages.RemovePage("apiLinkSelectionPopup")
+ app.SetFocus(textArea)
return nil
}
if event.Key() == tcell.KeyRune && event.Rune() == 'x' {
pages.RemovePage("apiLinkSelectionPopup")
+ app.SetFocus(textArea)
return nil
}
return event
@@ -230,6 +236,7 @@ func showUserRoleSelectionPopup() {
textView.SetText(chatToText(filtered, cfg.ShowSys))
// Remove the popup page
pages.RemovePage("userRoleSelectionPopup")
+ app.SetFocus(textArea)
// Update the status line to reflect the change
updateStatusLine()
colorText()
@@ -237,10 +244,12 @@ func showUserRoleSelectionPopup() {
roleListWidget.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
if event.Key() == tcell.KeyEscape {
pages.RemovePage("userRoleSelectionPopup")
+ app.SetFocus(textArea)
return nil
}
if event.Key() == tcell.KeyRune && event.Rune() == 'x' {
pages.RemovePage("userRoleSelectionPopup")
+ app.SetFocus(textArea)
return nil
}
return event
@@ -303,16 +312,19 @@ func showBotRoleSelectionPopup() {
cfg.WriteNextMsgAsCompletionAgent = mainText
// Remove the popup page
pages.RemovePage("botRoleSelectionPopup")
+ app.SetFocus(textArea)
// Update the status line to reflect the change
updateStatusLine()
})
roleListWidget.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
if event.Key() == tcell.KeyEscape {
pages.RemovePage("botRoleSelectionPopup")
+ app.SetFocus(textArea)
return nil
}
if event.Key() == tcell.KeyRune && event.Rune() == 'x' {
pages.RemovePage("botRoleSelectionPopup")
+ app.SetFocus(textArea)
return nil
}
return event
@@ -364,14 +376,17 @@ func showFileCompletionPopup(filter string) {
textArea.SetText(before+mainText, true)
}
pages.RemovePage("fileCompletionPopup")
+ app.SetFocus(textArea)
})
widget.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
if event.Key() == tcell.KeyEscape {
pages.RemovePage("fileCompletionPopup")
+ app.SetFocus(textArea)
return nil
}
if event.Key() == tcell.KeyRune && event.Rune() == 'x' {
pages.RemovePage("fileCompletionPopup")
+ app.SetFocus(textArea)
return nil
}
return event
@@ -484,14 +499,17 @@ func showColorschemeSelectionPopup() {
}
// Remove the popup page
pages.RemovePage("colorschemeSelectionPopup")
+ app.SetFocus(textArea)
})
schemeListWidget.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
if event.Key() == tcell.KeyEscape {
pages.RemovePage("colorschemeSelectionPopup")
+ app.SetFocus(textArea)
return nil
}
if event.Key() == tcell.KeyRune && event.Rune() == 'x' {
pages.RemovePage("colorschemeSelectionPopup")
+ app.SetFocus(textArea)
return nil
}
return event