{"record":{"id":"4e0b7507c6c2adaf","repo":"wagoodman/dive","slug":"unable-to-setup-layer-controller-onlayoutchange","errorCode":null,"errorMessage":"unable to setup layer controller onLayoutChange: %w","messagePattern":"unable to setup layer controller onLayoutChange: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/dive/cli/internal/ui/v1/layout/compound/layer_details_column.go","lineNumber":34,"sourceCode":"}\n\nfunc NewLayerDetailsCompoundLayout(layer *view.Layer, layerDetails *view.LayerDetails, imageDetails *view.ImageDetails) *LayerDetailsCompoundLayout {\n\treturn &LayerDetailsCompoundLayout{\n\t\tlayer:        layer,\n\t\tlayerDetails: layerDetails,\n\t\timageDetails: imageDetails,\n\t}\n}\n\nfunc (cl *LayerDetailsCompoundLayout) Name() string {\n\treturn \"layer-details-compound-column\"\n}\n\n// OnLayoutChange is called whenever the screen dimensions are changed\nfunc (cl *LayerDetailsCompoundLayout) OnLayoutChange() error {\n\terr := cl.layer.OnLayoutChange()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to setup layer controller onLayoutChange: %w\", err)\n\t}\n\n\terr = cl.layerDetails.OnLayoutChange()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to setup layer details controller onLayoutChange: %w\", err)\n\t}\n\n\terr = cl.imageDetails.OnLayoutChange()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to setup image details controller onLayoutChange: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc (cl *LayerDetailsCompoundLayout) layoutRow(g *gocui.Gui, minX, minY, maxX, maxY int, viewName string, setup func(*gocui.View, *gocui.View) error) error {\n\tlog.WithFields(\"ui\", cl.Name()).Tracef(\"layoutRow(g, minX: %d, minY: %d, maxX: %d, maxY: %d, viewName: %s, <setup func>)\", minX, minY, maxX, maxY, viewName)\n\t// header + border\n\theaderHeight := 2","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/cmd/dive/cli/internal/ui/v1/layout/compound/layer_details_column.go#L16-L52","documentation":"TUI layout error from the LayerDetailsCompoundLayout: during OnLayoutChange (invoked when screen dimensions change) the layer view's OnLayoutChange() failed and is wrapped with this message. It is the first of three sequential child-layout propagations (layer, layerDetails, imageDetails).","triggerScenarios":"A terminal resize event triggering the layer view's relayout, which fails — typically because the recomputed dimensions are degenerate (zero height/width) or the underlying gocui view operations error during relayout.","commonSituations":"Resizing the terminal to a very small size; running the TUI in a terminal pane without adequate rows; resize events delivered during startup.","solutions":["Resize the terminal back to normal dimensions (>= 80x24) and continue.","Run the TUI in a full-size terminal window or tmux pane with fixed size.","Use --json/--ci mode in constrained environments instead of the interactive UI.","If it reproduces at normal sizes, capture the wrapped error and report upstream."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run the TUI at stable, adequate terminal sizes.","Use --json in constrained or headless environments.","Report resize-triggered layout errors upstream with terminal emulator details."],"tags":["dive","tui","gocui","layout","resize","internal"],"backgroundTag":null,"analyzedSha":"d6c691947f8fda635c952a17ee3b7555379d58f0","analyzedAt":"2026-08-15T09:42:35.293Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}