From f47ea989671ac53958a226f9ff419423863c596a Mon Sep 17 00:00:00 2001
From: blackhao <13851610112@163.com>
Date: Wed, 10 Dec 2025 22:26:41 -0600
Subject: fix: hide .json extension when renaming blueprints

---
 frontend/src/components/LeftSidebar.tsx | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

(limited to 'frontend/src/components/LeftSidebar.tsx')

diff --git a/frontend/src/components/LeftSidebar.tsx b/frontend/src/components/LeftSidebar.tsx
index 4a0ac7b..668f75a 100644
--- a/frontend/src/components/LeftSidebar.tsx
+++ b/frontend/src/components/LeftSidebar.tsx
@@ -206,9 +206,16 @@ const LeftSidebar: React.FC<LeftSidebarProps> = ({ isOpen, onToggle }) => {
   };
 
   const handleRename = async (item: FSItem) => {
-    const newName = promptName('Rename to', item.name);
-    if (!newName || newName === item.name) return;
-    await renameProjectItem(item.path, newName);
+    // For .json files, show name without extension
+    const isJsonFile = item.type === 'file' && item.name.endsWith('.json');
+    const displayName = isJsonFile ? item.name.replace(/\.json$/, '') : item.name;
+    
+    const newName = promptName('Rename to', displayName);
+    if (!newName || newName === displayName) return;
+    
+    // Add .json extension back for json files
+    const finalName = isJsonFile ? `${newName}.json` : newName;
+    await renameProjectItem(item.path, finalName);
   };
 
   const handleDelete = async (item: FSItem) => {
-- 
cgit v1.2.3

