diff options
| author | adamdottv <[email protected]> | 2025-05-08 07:46:10 -0500 |
|---|---|---|
| committer | adamdottv <[email protected]> | 2025-05-08 07:59:15 -0500 |
| commit | e35ea2d448d1a3c9cf0a6fba1318e522fc61d1eb (patch) | |
| tree | 74de61896d8a339300b7d86c61158250d4cddefe | |
| parent | bab17d75208ffca043ff85c258ec42507d955a1e (diff) | |
| download | opencode-e35ea2d448d1a3c9cf0a6fba1318e522fc61d1eb.tar.gz opencode-e35ea2d448d1a3c9cf0a6fba1318e522fc61d1eb.zip | |
fix: log page nav
| -rw-r--r-- | internal/tui/tui.go | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/internal/tui/tui.go b/internal/tui/tui.go index 8a8b5f56c..24bae83e8 100644 --- a/internal/tui/tui.go +++ b/internal/tui/tui.go @@ -226,14 +226,12 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { }) a.status = s.(core.StatusCmp) cmds = append(cmds, cmd) - case "warn": s, cmd := a.status.Update(util.InfoMsg{ Type: util.InfoTypeWarn, Msg: msg.Payload.Message, TTL: msg.Payload.PersistTime, }) - a.status = s.(core.StatusCmp) cmds = append(cmds, cmd) default: @@ -490,6 +488,7 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { return a, tea.Batch(cmds...) } } + if a.showPermissions { d, permissionsCmd := a.permissions.Update(msg) a.permissions = d.(dialog.PermissionDialogCmp) @@ -569,20 +568,7 @@ func (a *appModel) moveToPage(pageID page.PageID) tea.Cmd { return util.ReportWarn("Agent is busy, please wait...") } - var cmds []tea.Cmd - if _, ok := a.loadedPages[pageID]; !ok { - cmd := a.pages[pageID].Init() - cmds = append(cmds, cmd) - a.loadedPages[pageID] = true - } - a.previousPage = a.currentPage - a.currentPage = pageID - if sizable, ok := a.pages[a.currentPage].(layout.Sizeable); ok { - cmd := sizable.SetSize(a.width, a.height) - cmds = append(cmds, cmd) - } - - return tea.Batch(cmds...) + return a.moveToPageUnconditional(pageID) } // moveToPageUnconditional is like moveToPage but doesn't check if the agent is busy @@ -820,13 +806,13 @@ If there are Cursor rules (in .cursor/rules/ or .cursorrules) or Copilot rules ( if model.currentPage != page.ChatPage { return util.ReportWarn("Please navigate to a chat session first.") } - + // Return a message that will be handled by the chat page return tea.Batch( util.CmdHandler(chat.CompactSessionMsg{}), util.ReportInfo("Compacting conversation...")) }, }) - + return model } |
