@@ -42,7 +42,7 @@ const TemplateList: React.FC<TemplateListProps> = ({ templates, activeTemplateId
4242 renameInputRef . current ?. select ( ) ;
4343 }
4444 } , [ renamingId ] ) ;
45-
45+
4646 const handleDelete = ( e : React . MouseEvent , id : string ) => {
4747 e . stopPropagation ( ) ;
4848 onDeleteTemplate ( id , e . shiftKey ) ;
@@ -54,53 +54,53 @@ const TemplateList: React.FC<TemplateListProps> = ({ templates, activeTemplateId
5454 // Fix: Use template_id instead of id
5555 const isFocused = focusedItemId === template . template_id ;
5656 return (
57- // Fix: Use template_id for key and data-item-id
58- < li key = { template . template_id } data-item-id = { template . template_id } >
57+ // Fix: Use template_id for key and data-item-id
58+ < li key = { template . template_id } data-item-id = { template . template_id } >
5959 { renamingId === template . template_id ? (
60- < div className = "p-1 flex items-center gap-2" >
60+ < div className = "p-1 flex items-center gap-2" >
6161 < DocumentDuplicateIcon className = "w-3.5 h-3.5 flex-shrink-0" />
6262 < input
63- ref = { renameInputRef }
64- type = "text"
65- value = { renameValue }
66- onChange = { ( e ) => setRenameValue ( e . target . value ) }
67- onBlur = { handleRenameSubmit }
68- onKeyDown = { handleRenameKeyDown }
69- className = "w-full text-left text-xs px-1.5 py-1 rounded-md bg-background text-text-main border border-border-color focus:outline-none focus:ring-1 focus:ring-primary"
63+ ref = { renameInputRef }
64+ type = "text"
65+ value = { renameValue }
66+ onChange = { ( e ) => setRenameValue ( e . target . value ) }
67+ onBlur = { handleRenameSubmit }
68+ onKeyDown = { handleRenameKeyDown }
69+ className = "w-full text-left text-xs px-1.5 py-1 rounded-md bg-background text-text-main border border-border-color focus:outline-none focus:ring-1 focus:ring-primary"
7070 />
71- </ div >
71+ </ div >
7272 ) : (
73- < button
73+ < button
7474 // Fix: Use template_id
7575 onClick = { ( ) => onSelectTemplate ( template . template_id ) }
7676 onDoubleClick = { ( e ) => handleRenameStart ( e , template ) }
77- className = { `w-full text-left p -1 rounded-md group flex justify-between items-center transition-colors duration-150 text-xs relative focus:outline-none ${
78- // Fix: Use template_id
79- activeTemplateId === template . template_id
80- ? 'bg-background text-text-main'
81- : 'hover:bg-border-color/30 text-text-secondary hover:text-text-main'
82- } ${ isFocused ? 'ring-2 ring-primary ring-offset-[-2px] ring-offset-secondary ' : '' } `}
83- >
84- < div className = "flex items-center gap-1.5 flex-1 truncate" >
85- < DocumentDuplicateIcon className = " w-3.5 h-3.5 flex-shrink-0" />
86- < span className = "truncate flex-1 px-1" > { template . title } </ span >
77+ className = { `w-full text-left pr -1 flex justify-between items-center transition-colors duration-0 text-[13px] relative focus:outline-none h-[22px] min-h-[22px] cursor-default ${
78+ // Fix: Use template_id
79+ activeTemplateId === template . template_id
80+ ? 'bg-tree-selected/20 text-text-main font-medium '
81+ : 'hover:bg-tree-selected/10 text-text-secondary hover:text-text-main'
82+ } ${ isFocused ? 'ring-1 ring-inset ring-primary ' : '' } `}
83+ >
84+ < div className = "flex items-center gap-1 flex-1 truncate pl-[2px] " >
85+ < DocumentDuplicateIcon className = { ` w-3.5 h-3.5 flex-shrink-0 ${ activeTemplateId === template . template_id ? 'text-text-main' : 'text-text-secondary' } ` } />
86+ < span className = "truncate flex-1 px-1" > { template . title } </ span >
8787 </ div >
8888 { /* Fix: Use template_id */ }
8989 < div className = { `transition-opacity pr-1 flex items-center ${ activeTemplateId === template . template_id ? 'opacity-100' : 'opacity-0 group-hover:opacity-100' } ` } >
90- { /* Fix: Use template_id */ }
91- < IconButton onClick = { ( e ) => handleDelete ( e , template . template_id ) } tooltip = "Delete" size = "xs" variant = "destructive" >
90+ { /* Fix: Use template_id */ }
91+ < IconButton onClick = { ( e ) => handleDelete ( e , template . template_id ) } tooltip = "Delete" size = "xs" variant = "destructive" >
9292 < TrashIcon className = "w-3.5 h-3.5" />
93- </ IconButton >
93+ </ IconButton >
9494 </ div >
95- </ button >
95+ </ button >
9696 ) }
97- </ li >
97+ </ li >
9898 )
9999 } ) }
100- { templates . length === 0 && (
101- < li className = "text-center text-text-secondary p-4 text-xs" >
102- No templates yet.
103- </ li >
100+ { templates . length === 0 && (
101+ < li className = "text-center text-text-secondary p-4 text-xs" >
102+ No templates yet.
103+ </ li >
104104 ) }
105105 </ ul >
106106 ) ;
0 commit comments