{"record":{"id":"8016eb0ab83901a1","repo":"wagoodman/dive","slug":"controller-unable-to-toggle-view-w","errorCode":null,"errorMessage":"controller unable to toggle view: %w","messagePattern":"controller unable to toggle view: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/dive/cli/internal/ui/v1/app/controller.go","lineNumber":213,"sourceCode":"\t\treturn fmt.Errorf(\"controller unable to switch to previous pane: %w\", err)\n\t}\n\n\treturn c.UpdateAndRender()\n}\n\n// ToggleView switches between the file view and the layer view and re-renders the screen.\nfunc (c *controller) ToggleView() (err error) {\n\tv := c.gui.CurrentView()\n\tif v == nil || v.Name() == c.views.Layer.Name() {\n\t\t_, err = c.gui.SetCurrentView(c.views.Tree.Name())\n\t\tc.views.Status.SetCurrentView(c.views.Tree)\n\t} else {\n\t\t_, err = c.gui.SetCurrentView(c.views.Layer.Name())\n\t\tc.views.Status.SetCurrentView(c.views.Layer)\n\t}\n\n\tif err != nil {\n\t\treturn fmt.Errorf(\"controller unable to toggle view: %w\", err)\n\t}\n\n\treturn c.UpdateAndRender()\n}\n\nfunc (c *controller) CloseFilterView() error {\n\t// filter view needs to be visible\n\tif c.views.Filter.IsVisible() {\n\t\t// toggle filter view\n\t\treturn c.ToggleFilterView()\n\t}\n\treturn nil\n}\n\nfunc (c *controller) ToggleFilterView() error {\n\t// delete all user input from the tree view\n\terr := c.views.Filter.ToggleVisible()\n\tif err != nil {","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/cmd/dive/cli/internal/ui/v1/app/controller.go#L195-L231","documentation":"TUI controller error from ToggleView(): it switches focus between the filetree view and the layer view, and wraps a failure of gocui SetCurrentView() for whichever destination view applies. Note the subtle behavior: if the current view is nil or is the Layer view it targets Tree, otherwise it targets Layer.","triggerScenarios":"Pressing the toggle-view keybinding when the destination view (usually Tree, the largest pane) has not been created by gocui yet, or was destroyed by a layout pass; also reachable from ToggleFilterView hiding the filter and re-focusing.","commonSituations":"Pressing Tab/space (toggle binding) immediately at startup; toggling while the filter view is closing (error 32 chains through here); degenerate terminal sizes.","solutions":["Wait until the full UI (including the filetree) is drawn before toggling views.","If triggered right after closing the filter, retry the toggle — transient focus races usually clear on the next keypress.","Resize the terminal to a normal dimension and re-run.","Upgrade dive; report upstream with a keypress transcript if reproducible."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Toggle views only after the filetree has rendered once.","Retry a failed toggle once; transient focus races often clear.","File upstream issues for reproducible toggle-view errors."],"tags":["dive","tui","gocui","navigation","internal"],"backgroundTag":null,"analyzedSha":"d6c691947f8fda635c952a17ee3b7555379d58f0","analyzedAt":"2026-08-15T09:42:35.293Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}