{"record":{"id":"880b30da6717c456","repo":"wagoodman/dive","slug":"controller-unable-to-update-view-w","errorCode":null,"errorMessage":"controller unable to update view: %w","messagePattern":"controller unable to update view: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/dive/cli/internal/ui/v1/app/controller.go","lineNumber":134,"sourceCode":"\terr := c.Update()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"controller failed update: %w\", err)\n\t}\n\n\terr = c.Render()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"controller failed render: %w\", err)\n\t}\n\n\treturn nil\n}\n\n// Update refreshes the state objects for future rendering.\nfunc (c *controller) Update() error {\n\tfor _, v := range c.views.Renderers() {\n\t\terr := v.Update()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"controller unable to update view: %w\", err)\n\t\t}\n\t}\n\treturn nil\n}\n\n// Render flushes the state objects to the screen.\nfunc (c *controller) Render() error {\n\tfor _, v := range c.views.Renderers() {\n\t\tif v.IsVisible() {\n\t\t\terr := v.Render()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/cmd/dive/cli/internal/ui/v1/app/controller.go#L116-L152","documentation":"The root cause wrapped by errors 25/26: controller.Update() iterates all registered view renderers and this wraps the first view whose Update() returns an error. It identifies the state-refresh phase of the TUI loop, immediately before rendering.","triggerScenarios":"Any of the views (layer list, layer details, image details, filetree, filter, status) failing to recompute its display state — commonly nil-pointer access on analysis data or an invalid current-layer index after the user switches layers or toggles aggregation.","commonSituations":"Images where a layer has no file data (foreign/scratch layers); switching between aggregated and per-layer views on images with a single layer; stale view state after rapid key input.","solutions":["Capture the full error chain (fmt %w preserves the view-level cause) and note which interaction triggered it (layer switch, filter, toggle).","Re-run with the same image avoiding that interaction to confirm the trigger, then report upstream.","Try a newer dive release; several view-state bugs were fixed over time.","Fall back to non-interactive mode (--json or --ci) while the TUI bug blocks you."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use --json/--ci modes when automating; view update errors only occur in the TUI.","Note which keypress precedes the failure to include in bug reports.","Keep dive updated; view-state fixes land regularly."],"tags":["dive","tui","gocui","controller","internal"],"backgroundTag":null,"analyzedSha":"d6c691947f8fda635c952a17ee3b7555379d58f0","analyzedAt":"2026-08-15T09:42:35.293Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}