From 43fa4fc487f2914d26edb884dbba57e6bc3177c9 Mon Sep 17 00:00:00 2001 From: Dotta Date: Mon, 16 Mar 2026 09:58:33 -0500 Subject: [PATCH] fix: show rename indicator on folder, not AGENTS.md file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the rename indicator (→ newName) in the file tree to only display on the parent directory node, not on the individual file. The preview header still shows the rename when viewing the file. Co-Authored-By: Paperclip --- ui/src/pages/CompanyImport.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ui/src/pages/CompanyImport.tsx b/ui/src/pages/CompanyImport.tsx index e9fefde3..62c4d747 100644 --- a/ui/src/pages/CompanyImport.tsx +++ b/ui/src/pages/CompanyImport.tsx @@ -133,7 +133,8 @@ function FrontmatterCard({ data }: { data: FrontmatterData }) { // ── Import file tree customization ─────────────────────────────────── function renderImportFileExtra(node: FileTreeNode, checked: boolean, renameMap: Map) { - const renamedTo = renameMap.get(node.path); + // Show rename indicator only on directories (folders), not individual files + const renamedTo = node.kind === "dir" ? renameMap.get(node.path) : undefined; const actionBadge = node.action ? ( { const map = new Map(); if (!importPreview) return map; @@ -683,11 +685,11 @@ export function CompanyImport() { if (isSkipped) continue; const renamedTo = nameOverrides[c.slug] ?? c.plannedName; if (renamedTo === c.originalName) continue; - // Map the file itself - map.set(c.filePath, renamedTo); - // Map the parent directory (e.g. agents/ceo → gstack-ceo) + // Map the parent directory (e.g. agents/ceo → gstack-ceo) for the file tree const parentDir = c.filePath.split("/").slice(0, -1).join("/"); if (parentDir) map.set(parentDir, renamedTo); + // Map the file path too — used by the preview header, not shown in tree + map.set(c.filePath, renamedTo); } return map; }, [importPreview, conflicts, nameOverrides, skippedSlugs]);