@@ -1290,8 +1290,16 @@ export class SessionManager {
|
||||
throw new Error(`Entry ${leafId} not found`);
|
||||
}
|
||||
|
||||
// Filter out LabelEntry from path - we'll recreate them from the resolved map
|
||||
const pathWithoutLabels = path.filter((e) => e.type !== "label");
|
||||
// Filter out LabelEntry from path - we'll recreate them from the resolved map.
|
||||
// Because labels are real tree entries, later entries can be children of labels;
|
||||
// removing labels requires re-chaining the retained path to avoid orphaned subtrees.
|
||||
const pathWithoutLabels: SessionEntry[] = [];
|
||||
let pathParentId: string | null = null;
|
||||
for (const entry of path) {
|
||||
if (entry.type === "label") continue;
|
||||
pathWithoutLabels.push({ ...entry, parentId: pathParentId });
|
||||
pathParentId = entry.id;
|
||||
}
|
||||
|
||||
const newSessionId = createSessionId();
|
||||
const timestamp = new Date().toISOString();
|
||||
|
||||
Reference in New Issue
Block a user