{"record":{"id":"b505514216f3b69a","repo":"wagoodman/dive","slug":"unknown-diff-hide-value-s","errorCode":null,"errorMessage":"unknown diff.hide value: %s","messagePattern":"unknown diff\\.hide value: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/dive/cli/internal/ui/v1/viewmodel/filetree.go","lineNumber":70,"sourceCode":"\ttreeViewModel.CollapseAll = cfg.Preferences.CollapseFiletreeDirectory\n\ttreeViewModel.ModelTree = cfg.Analysis.RefTrees[initialLayer]\n\ttreeViewModel.RefTrees = cfg.Analysis.RefTrees\n\ttreeViewModel.comparer = comparer\n\ttreeViewModel.HiddenDiffTypes = make([]bool, 4)\n\n\thiddenTypes := cfg.Preferences.FiletreeDiffHide\n\tfor _, hType := range hiddenTypes {\n\t\tswitch t := strings.ToLower(hType); t {\n\t\tcase \"added\":\n\t\t\ttreeViewModel.HiddenDiffTypes[filetree.Added] = true\n\t\tcase \"removed\":\n\t\t\ttreeViewModel.HiddenDiffTypes[filetree.Removed] = true\n\t\tcase \"modified\":\n\t\t\ttreeViewModel.HiddenDiffTypes[filetree.Modified] = true\n\t\tcase \"unmodified\":\n\t\t\ttreeViewModel.HiddenDiffTypes[filetree.Unmodified] = true\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"unknown diff.hide value: %s\", t)\n\t\t}\n\t}\n\n\treturn treeViewModel, treeViewModel.SetTreeByLayer(0, 0, initialLayer, initialLayer)\n}\n\n// Setup initializes the UI concerns within the context of a global [gocui] view object.\nfunc (vm *FileTreeViewModel) Setup(lowerBound, height int) {\n\tvm.bufferIndexLowerBound = lowerBound\n\tvm.refHeight = height\n}\n\n// height returns the current height and considers the header\nfunc (vm *FileTreeViewModel) height() int {\n\tif vm.ShowAttributes {\n\t\treturn vm.refHeight - 1\n\t}\n\treturn vm.refHeight","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/cmd/dive/cli/internal/ui/v1/viewmodel/filetree.go#L52-L88","documentation":"NewFileTreeViewModel validates the diff.hide preference entries (case-insensitive) against the fixed set added/removed/modified/unmodified and rejects anything else at startup. This is a pure config-validation error: the value shown is the lowercased offending token from your dive.yaml (or CLI --diff.hide flag), so the app refuses to start the TUI.","triggerScenarios":"Setting FiletreeDiffHide / diff.hide in dive.yaml or via CLI to any string outside {added, removed, modified, unmodified} (case-insensitive), e.g. 'changed', 'add', 'Modified ' with a typo, or a YAML list entry that parses to a non-string.","commonSituations":"Hand-edited dive.yaml with intuitive-but-wrong names like 'changed', 'new', 'deleted'; copy-pasted configs from older dive versions or blog posts; YAML indentation mistakes turning the list into a single garbled string; CLI flag --diff.hide=changed.","solutions":["Edit dive.yaml and set diff.hide entries to only: added, removed, modified, or unmodified (any capitalization)","Remove the diff.hide key entirely if you don't want to hide any diff types","If using the CLI flag, correct it: --diff.hide=modified or a comma list of valid values","Validate config after editing: run dive with a trivial image to confirm startup"],"exampleFix":"# before (dive.yaml)\ndiff:\n  hide:\n    - changed\n    - new\n# after\ndiff:\n  hide:\n    - modified\n    - added","handlingStrategy":"validation","validationCode":"// validate diff.hide entries before constructing the viewmodel\nvalid := map[string]bool{\"added\": true, \"removed\": true, \"modified\": true, \"unmodified\": true}\nfor _, v := range cfg.Preferences.FiletreeDiffHide {\n    if !valid[strings.ToLower(v)] {\n        return fmt.Errorf(\"invalid diff.hide %q (want added|removed|modified|unmodified)\", v)\n    }\n}","typeGuard":"// simple set-membership check for config values\nfunc isValidDiffHide(s string) bool {\n    switch strings.ToLower(s) {\n    case \"added\", \"removed\", \"modified\", \"unmodified\":\n        return true\n    }\n    return false\n}","tryCatchPattern":"vm, err := viewmodel.NewFileTreeViewModel(cfg, initialLayer)\nif err != nil {\n    if strings.Contains(err.Error(), \"unknown diff.hide value\") {\n        // fix config and restart\n    }\n}","preventionTips":["Use only the four documented diff.hide tokens","Add a config lint step (CI) for dive.yaml","Copy config examples from the current dive docs, not old blogs"],"tags":["config","yaml","validation","filetree"],"backgroundTag":null,"analyzedSha":"d6c691947f8fda635c952a17ee3b7555379d58f0","analyzedAt":"2026-08-15T09:42:35.293Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}