From 04db7c2f01355f2c43843794522380607e807716 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Mon, 23 Feb 2026 12:46:28 +0300 Subject: Enha: not allow popups outside of main page --- tui.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tui.go') diff --git a/tui.go b/tui.go index 638fdd6..0e95709 100644 --- a/tui.go +++ b/tui.go @@ -15,6 +15,11 @@ import ( "github.com/rivo/tview" ) +func isFullScreenPageActive() bool { + name, _ := pages.GetFrontPage() + return name != "main" +} + var ( app *tview.Application pages *tview.Pages @@ -525,6 +530,9 @@ func init() { return nil } if event.Key() == tcell.KeyRune && event.Rune() == 'i' && event.Modifiers()&tcell.ModAlt != 0 { + if isFullScreenPageActive() { + return event + } showColorschemeSelectionPopup() return nil } @@ -731,6 +739,9 @@ func init() { return nil } if event.Key() == tcell.KeyCtrlL { + if isFullScreenPageActive() { + return event + } // Show model selection popup instead of rotating models showModelSelectionPopup() return nil @@ -744,6 +755,9 @@ func init() { return nil } if event.Key() == tcell.KeyCtrlV { + if isFullScreenPageActive() { + return event + } // Show API link selection popup instead of rotating APIs showAPILinkSelectionPopup() return nil @@ -850,11 +864,17 @@ func init() { return nil } if event.Key() == tcell.KeyCtrlQ { + if isFullScreenPageActive() { + return event + } // Show user role selection popup instead of cycling through roles showUserRoleSelectionPopup() return nil } if event.Key() == tcell.KeyCtrlX { + if isFullScreenPageActive() { + return event + } // Show bot role selection popup instead of cycling through roles showBotRoleSelectionPopup() return nil -- cgit v1.2.3