{"record":{"id":"df98fdb5622030a8","repo":"zed-industries/zed","slug":"edited-sub-entry-should-be-an-ancestor-of-selected","errorCode":null,"errorMessage":"Edited sub-entry should be an ancestor of selected leaf entry","messagePattern":"Edited sub-entry should be an ancestor of selected leaf entry","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/project_panel/src/project_panel.rs","lineNumber":5253,"sourceCode":"                continue;\n            }\n\n            let end_ix = range.end.min(ix + visible.entries.len());\n            let entry_range = range.start.saturating_sub(ix)..end_ix - ix;\n            let entries = visible\n                .index\n                .get_or_init(|| visible.entries.iter().map(|e| e.path.clone()).collect());\n            let base_index = ix + entry_range.start;\n            for (i, entry) in visible.entries[entry_range].iter().enumerate() {\n                let global_index = base_index + i;\n                callback(entry, global_index, entries, window, cx);\n            }\n            ix = end_ix;\n        }\n    }\n\n    fn for_each_visible_entry(\n        &self,\n        range: Range<usize>,\n        window: &mut Window,\n        cx: &mut Context<ProjectPanel>,\n        callback: &mut dyn FnMut(\n            ProjectEntryId,\n            EntryDetails,\n            &mut Window,\n            &mut Context<ProjectPanel>,\n        ),\n    ) {\n        let mut ix = 0;\n        for visible in &self.state.visible_entries {\n            if ix >= range.end {\n                return;\n            }\n\n            if ix + visible.entries.len() <= range.start {\n                ix += visible.entries.len();","sourceCodeStart":5235,"sourceCodeEnd":5271,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/project_panel/src/project_panel.rs#L5235-L5271","documentation":"An assertion in project panel editing: the entry being edited (new or renamed) must be the selected leaf entry or one of its ancestors; a mismatch means the edit state and the tree selection diverged, usually a state-sync bug after folding or ancestor-tracking changes.","triggerScenarios":"Thrown at crates/project_panel/src/project_panel.rs:5248 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Recompute edit_state from the current selection when the tree changes","Ensure ancestors map is updated whenever entries are folded/unfolded","Cancel any active edit when selection changes to an unrelated entry"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}