clear filter via esc

This commit is contained in:
2025-07-13 20:19:41 -07:00
parent 928db70011
commit 460917ceca
4 changed files with 21 additions and 5 deletions

View File

@@ -18,6 +18,7 @@ const (
// Custom message types
type (
SwitchToTableListMsg struct{}
SwitchToTableListClearMsg struct{} // Switch to table list and clear any filter
SwitchToTableDataMsg struct{ TableIndex int }
SwitchToRowDetailMsg struct{ RowIndex int }
SwitchToRowDetailFromQueryMsg struct{ RowIndex int }
@@ -519,6 +520,14 @@ func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.currentView = NewTableListModel(m.getSharedData())
return m, nil
case SwitchToTableListClearMsg:
shared := m.getSharedData()
// Clear any table filter
shared.FilteredTables = make([]string, len(shared.Tables))
copy(shared.FilteredTables, shared.Tables)
m.currentView = NewTableListModel(shared)
return m, nil
case SwitchToTableDataMsg:
shared := m.getSharedData()
shared.SelectedTable = msg.TableIndex