From 097c574d9ce021c80e925d2d156fa79719e66a76 Mon Sep 17 00:00:00 2001 From: ayush18pop Date: Tue, 22 Jul 2025 15:27:46 +0530 Subject: [PATCH 1/2] feat: enhance project name input in editor header and improve properties panel display --- apps/web/src/components/editor-header.tsx | 17 ++++++++++------- .../editor/properties-panel/index.tsx | 4 ++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/apps/web/src/components/editor-header.tsx b/apps/web/src/components/editor-header.tsx index ecd2291d..7b915897 100644 --- a/apps/web/src/components/editor-header.tsx +++ b/apps/web/src/components/editor-header.tsx @@ -9,6 +9,7 @@ import { formatTimeCode } from "@/lib/time"; import { useProjectStore } from "@/stores/project-store"; import { KeyboardShortcutsHelp } from "./keyboard-shortcuts-help"; import { useState, useRef, useEffect } from "react"; +import { Input } from "@/components/ui/input"; export function EditorHeader() { const { getTotalDuration } = useTimelineStore(); @@ -62,28 +63,30 @@ export function EditorHeader() { > -
+
{isEditing ? ( - // Editable input for project name - setNewName(e.target.value)} onBlur={handleNameSave} onKeyDown={handleInputKeyDown} + maxLength={64} + aria-label="Project name" + autoFocus /> ) : ( // Display project name as span, click to edit e.key === 'Enter' && handleNameClick()} - > - {activeProject?.name} + >
{activeProject?.name}
)}
diff --git a/apps/web/src/components/editor/properties-panel/index.tsx b/apps/web/src/components/editor/properties-panel/index.tsx index 9e28850f..d96e1e99 100644 --- a/apps/web/src/components/editor/properties-panel/index.tsx +++ b/apps/web/src/components/editor/properties-panel/index.tsx @@ -34,7 +34,7 @@ export function PropertiesPanel() { const emptyView = (
{/* Media Properties */} -
+
- {value} + {value}
); } From 747630ef3f51b8b51aaeb448135925fa3e572788 Mon Sep 17 00:00:00 2001 From: ayush18pop Date: Tue, 22 Jul 2025 15:56:42 +0530 Subject: [PATCH 2/2] fix: handle project renaming errors and adjust input styling in properties panel --- apps/web/src/components/editor-header.tsx | 11 +++++++++-- .../src/components/editor/properties-panel/index.tsx | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/apps/web/src/components/editor-header.tsx b/apps/web/src/components/editor-header.tsx index 7b915897..45414ecc 100644 --- a/apps/web/src/components/editor-header.tsx +++ b/apps/web/src/components/editor-header.tsx @@ -43,7 +43,14 @@ export function EditorHeader() { // Save the new name if changed, exit edit mode const handleNameSave = async () => { if (activeProject && newName.trim() && newName !== activeProject.name) { - await renameProject(activeProject.id, newName.trim()); + try { + await renameProject(activeProject.id, newName.trim()); + } + catch (error) { + console.error('Failed to rename project:', error); + // Reset to original name on error + setNewName(activeProject.name); + } } setIsEditing(false); }; @@ -68,7 +75,7 @@ export function EditorHeader() { // Editable input for project name using standard Input component setNewName(e.target.value)} onBlur={handleNameSave} diff --git a/apps/web/src/components/editor/properties-panel/index.tsx b/apps/web/src/components/editor/properties-panel/index.tsx index d96e1e99..d30cd0ff 100644 --- a/apps/web/src/components/editor/properties-panel/index.tsx +++ b/apps/web/src/components/editor/properties-panel/index.tsx @@ -34,7 +34,7 @@ export function PropertiesPanel() { const emptyView = (
{/* Media Properties */} -
+
- {value} ++ {value}
); }