@@ -178,64 +178,57 @@ const ResourceTabItem = memo(function ResourceTabItem({
178178 { showGapBefore && (
179179 < div className = '-translate-x-1/2 -translate-y-1/2 pointer-events-none absolute top-1/2 left-0 z-10 h-[16px] w-[2px] rounded-full bg-[var(--text-subtle)]' />
180180 ) }
181- < Tooltip . Root >
182- < Tooltip . Trigger asChild >
183- < Button
184- variant = 'subtle'
185- draggable
186- data-resource-tab-id = { resource . id }
187- onDragStart = { ( e ) => onDragStart ( e , idx ) }
188- onDragOver = { ( e ) => onDragOver ( e , idx ) }
189- onDragLeave = { onDragLeave }
190- onDragEnd = { onDragEnd }
191- onMouseDown = { ( e ) => {
192- if ( e . button === 1 ) {
193- e . preventDefault ( )
194- if ( chatId ) onRemove ( e , resource )
195- }
181+ < Button
182+ variant = 'subtle'
183+ draggable
184+ data-resource-tab-id = { resource . id }
185+ onDragStart = { ( e ) => onDragStart ( e , idx ) }
186+ onDragOver = { ( e ) => onDragOver ( e , idx ) }
187+ onDragLeave = { onDragLeave }
188+ onDragEnd = { onDragEnd }
189+ onMouseDown = { ( e ) => {
190+ if ( e . button === 1 ) {
191+ e . preventDefault ( )
192+ if ( chatId ) onRemove ( e , resource )
193+ }
194+ } }
195+ onClick = { ( e ) => onTabClick ( e , idx ) }
196+ onMouseEnter = { ( ) => setHoveredTabId ( resource . id ) }
197+ onMouseLeave = { ( ) => setHoveredTabId ( null ) }
198+ className = { cn (
199+ 'group relative shrink-0 bg-transparent px-2 py-[3px] pr-[22px] text-caption transition-colors duration-150' ,
200+ isActive && 'bg-[var(--surface-4)]' ,
201+ isSelected && ! isActive && 'bg-[var(--surface-3)]' ,
202+ isDragging && 'opacity-30'
203+ ) }
204+ >
205+ { config . renderTabIcon ( resource , 'mr-1.5 h-[14px] w-[14px]' ) }
206+ { displayName }
207+ { ( isHovered || isActive ) && chatId && (
208+ < span
209+ role = 'button'
210+ tabIndex = { - 1 }
211+ onClick = { ( e ) => onRemove ( e , resource ) }
212+ onKeyDown = { ( e ) => {
213+ if ( e . key === 'Enter' ) onRemove ( e , resource )
196214 } }
197- onClick = { ( e ) => onTabClick ( e , idx ) }
198- onMouseEnter = { ( ) => setHoveredTabId ( resource . id ) }
199- onMouseLeave = { ( ) => setHoveredTabId ( null ) }
200- className = { cn (
201- 'group relative shrink-0 bg-transparent px-2 py-1 pr-[22px] text-caption transition-opacity duration-150' ,
202- isActive && 'bg-[var(--surface-4)]' ,
203- isSelected && ! isActive && 'bg-[var(--surface-3)]' ,
204- isDragging && 'opacity-30'
205- ) }
215+ className = '-translate-y-1/2 absolute top-1/2 right-[4px] flex items-center justify-center rounded-sm p-[1px] hover-hover:bg-[var(--surface-5)]'
216+ aria-label = { `Close ${ displayName } ` }
206217 >
207- { config . renderTabIcon ( resource , 'mr-1.5 h-[14px] w-[14px]' ) }
208- { displayName }
209- { ( isHovered || isActive ) && chatId && (
210- < span
211- role = 'button'
212- tabIndex = { - 1 }
213- onClick = { ( e ) => onRemove ( e , resource ) }
214- onKeyDown = { ( e ) => {
215- if ( e . key === 'Enter' ) onRemove ( e , resource )
216- } }
217- className = '-translate-y-1/2 absolute top-1/2 right-[4px] flex items-center justify-center rounded-sm p-[1px] hover-hover:bg-[var(--surface-5)]'
218- aria-label = { `Close ${ displayName } ` }
219- >
220- < svg
221- className = 'size-[10px] text-[var(--text-icon)]'
222- viewBox = '0 0 24 24'
223- fill = 'none'
224- stroke = 'currentColor'
225- strokeWidth = '2.5'
226- strokeLinecap = 'round'
227- strokeLinejoin = 'round'
228- >
229- < path d = 'M18 6 6 18M6 6l12 12' />
230- </ svg >
231- </ span >
232- ) }
233- </ Button >
234- </ Tooltip . Trigger >
235- < Tooltip . Content side = 'bottom' >
236- < p > { displayName } </ p >
237- </ Tooltip . Content >
238- </ Tooltip . Root >
218+ < svg
219+ className = 'size-[10px] text-[var(--text-icon)]'
220+ viewBox = '0 0 24 24'
221+ fill = 'none'
222+ stroke = 'currentColor'
223+ strokeWidth = '2.5'
224+ strokeLinecap = 'round'
225+ strokeLinejoin = 'round'
226+ >
227+ < path d = 'M18 6 6 18M6 6l12 12' />
228+ </ svg >
229+ </ span >
230+ ) }
231+ </ Button >
239232 { showGapAfter && (
240233 < div className = '-translate-y-1/2 pointer-events-none absolute top-1/2 right-0 z-10 h-[16px] w-[2px] translate-x-1/2 rounded-full bg-[var(--text-subtle)]' />
241234 ) }
0 commit comments