{"record":{"id":"03fca7597a745767","repo":"wagoodman/dive","slug":"controller-unable-to-switch-to-previous-pane-w","errorCode":null,"errorMessage":"controller unable to switch to previous pane: %w","messagePattern":"controller unable to switch to previous pane: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/dive/cli/internal/ui/v1/app/controller.go","lineNumber":195,"sourceCode":"//nolint:dupl\nfunc (c *controller) PrevPane() (err error) {\n\tv := c.gui.CurrentView()\n\tif v == nil {\n\t\tpanic(\"Current view is nil\")\n\t}\n\tif v.Name() == c.views.Layer.Name() {\n\t\t_, err = c.gui.SetCurrentView(c.views.ImageDetails.Name())\n\t\tc.views.Status.SetCurrentView(c.views.ImageDetails)\n\t} else if v.Name() == c.views.LayerDetails.Name() {\n\t\t_, err = c.gui.SetCurrentView(c.views.Layer.Name())\n\t\tc.views.Status.SetCurrentView(c.views.Layer)\n\t} else if v.Name() == c.views.ImageDetails.Name() {\n\t\t_, err = c.gui.SetCurrentView(c.views.LayerDetails.Name())\n\t\tc.views.Status.SetCurrentView(c.views.LayerDetails)\n\t}\n\n\tif err != nil {\n\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)","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/cmd/dive/cli/internal/ui/v1/app/controller.go#L177-L213","documentation":"Mirror of error 28 for PrevPane(): it cycles focus in reverse (Layer -> ImageDetails -> LayerDetails -> Layer) and wraps a failure of gocui SetCurrentView() when the target pane view cannot be made current. Same failure surface as NextPane, opposite direction.","triggerScenarios":"Pressing the previous-pane keybinding when the destination view is not registered with the gui (startup race, torn-down layout), producing a non-nil error from SetCurrentView.","commonSituations":"Fast keyboard input at startup; terminal resize destroying views; inconsistent view registration in modified builds.","solutions":["Let the TUI finish its initial layout before switching panes.","Keep the terminal at a reasonable size; avoid minimizing/restoring mid-session.","Upgrade dive to pick up view-lifecycle fixes.","Reproduce with debug logging and report upstream if repeatable."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Delay pane navigation until the UI is fully drawn.","Keep terminal geometry stable during the session.","Report deterministic PrevPane failures with a keypress transcript."],"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"}