{"record":{"id":"ce4445457c4c155a","repo":"wagoodman/dive","slug":"unable-to-layout-q-w","errorCode":null,"errorMessage":"unable to layout %q: %w","messagePattern":"unable to layout %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/dive/cli/internal/ui/v1/layout/compound/layer_details_column.go","lineNumber":82,"sourceCode":"\t\t\treturn fmt.Errorf(\"unable to setup row layout for %s: %w\", viewName, err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (cl *LayerDetailsCompoundLayout) Layout(g *gocui.Gui, minX, minY, maxX, maxY int) error {\n\tlog.WithFields(\"ui\", cl.Name()).Tracef(\"layout(minX: %d, minY: %d, maxX: %d, maxY: %d)\", minX, minY, maxX, maxY)\n\n\tlayouts := []view.View{\n\t\tcl.layer,\n\t\tcl.layerDetails,\n\t\tcl.imageDetails,\n\t}\n\n\trowHeight := maxY / 3\n\tfor i := 0; i < 3; i++ {\n\t\tif err := cl.layoutRow(g, minX, i*rowHeight, maxX, (i+1)*rowHeight, layouts[i].Name(), layouts[i].Setup); err != nil {\n\t\t\treturn fmt.Errorf(\"unable to layout %q: %w\", layouts[i].Name(), err)\n\t\t}\n\t}\n\n\tif g.CurrentView() == nil {\n\t\tif _, err := g.SetCurrentView(cl.layer.Name()); err != nil {\n\t\t\treturn fmt.Errorf(\"unable to set view to layer %q: %w\", cl.layer.Name(), err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (cl *LayerDetailsCompoundLayout) RequestedSize(available int) *int {\n\t// \"available\" is the entire screen real estate, so we can guess when its a bit too small and take action.\n\t// This isn't perfect, but it gets the job done for now without complicated layout constraint solvers\n\tif available < 90 {\n\t\tcl.layer.ConstrainLayout()\n\t\tcl.constrainRealEstate = true\n\t\tsize := 8","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/cmd/dive/cli/internal/ui/v1/layout/compound/layer_details_column.go#L64-L100","documentation":"This error is raised by the LayerDetailsCompoundLayout.Layout method when cl.layoutRow() fails for one of the three stacked views (layer, layerDetails, imageDetails) that share the left column in dive's TUI. layoutRow calls gocui's Gui.SetView and then the view's Setup hook, so the wrapped error is either a gocui view-geometry failure or a controller setup/render failure. The %q names which of the three views failed.","triggerScenarios":"Gui.SetView returning an error for the 'layer', 'layerDetails', or 'imageDetails' view (e.g. degenerate geometry such as maxX<=minX or maxY<=minY when the terminal is resized extremely small), or the view's Setup returning an error (keybinding registration, writing to the view buffer). It fires on first layout and on every resize because Layout is called by the layout manager on each redraw cycle.","commonSituations":"Running dive in a tiny terminal window or a CI runner without a real TTY; shrinking the terminal below three usable rows (rowHeight = maxY/3 becomes 0); custom keybinding configs that collide during Setup; running inside a multiplexer that reports a 1x1 screen during startup.","solutions":["Enlarge the terminal so the left column has at least a few rows per pane (maxY >= 3) and re-run dive","Check the wrapped error text: if it mentions another view or keybinding, fix that config (dive.yaml keybindings) or free the conflicting key","Reproduce with a normal-size terminal; if it only fails on resize, resize once more — layout is idempotent and SetView will recreate valid geometry","If embedding dive's UI, ensure the layout manager passes a valid Area with maxX>minX and maxY>minY to this column"],"exampleFix":"// terminal too small: run in a >= 90x10 window instead of e.g. 80x2\ndive nginx:latest   # in a resized, adequately tall terminal","handlingStrategy":"validation","validationCode":"// before layout, ensure the column area is usable (3 rows minimum)\nif maxY-minY < 3 || maxX-minX < 1 {\n    return fmt.Errorf(\"screen too small for layer details column: %dx%d\", maxX-minX, maxY-minY)\n}","typeGuard":null,"tryCatchPattern":"// Go: check the returned error from Layout and surface it to the TUI error loop\nif err := columnLayout.Layout(g, minX, minY, maxX, maxY); err != nil {\n    return fmt.Errorf(\"layout failed: %w\", err)\n}","preventionTips":["Keep terminal at least ~90x10 when running dive","Do not embed the compound layout without guaranteed minimum dimensions","Log the wrapped error verbatim — it names the failing sub-view"],"tags":["ui","terminal","gocui","layout"],"backgroundTag":null,"analyzedSha":"d6c691947f8fda635c952a17ee3b7555379d58f0","analyzedAt":"2026-08-15T09:42:35.293Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}