mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-12 22:42:13 +02:00
feat(sidebar): highlight active chat items for improved user interaction
This commit is contained in:
parent
cd4eb18981
commit
2670ad96c8
1 changed files with 4 additions and 3 deletions
|
|
@ -47,6 +47,7 @@ export function ChatListItem({
|
|||
const dropdownOpen = controlledOpen ?? internalOpen;
|
||||
const setDropdownOpen = onDropdownOpenChange ?? setInternalOpen;
|
||||
const animatedName = useTypewriter(name);
|
||||
const isHighlighted = isActive || dropdownOpen;
|
||||
|
||||
const { handlers: longPressHandlers, wasLongPress } = useLongPress(
|
||||
useCallback(() => setDropdownOpen(true), [setDropdownOpen])
|
||||
|
|
@ -67,9 +68,9 @@ export function ChatListItem({
|
|||
onFocus={onPrefetch}
|
||||
{...(isMobile ? longPressHandlers : {})}
|
||||
className={sidebarListItemClassName({
|
||||
active: isActive,
|
||||
active: isHighlighted,
|
||||
className:
|
||||
"justify-start gap-2 overflow-hidden px-2 py-1.5 font-normal focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
||||
"justify-start gap-2 overflow-hidden px-2 py-1.5 font-normal group-hover/item:bg-accent group-hover/item:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
||||
})}
|
||||
>
|
||||
<span className="min-w-0 flex-1 truncate">{animatedName}</span>
|
||||
|
|
@ -79,7 +80,7 @@ export function ChatListItem({
|
|||
<div
|
||||
className={cn(
|
||||
"pointer-events-none absolute right-0 top-0 bottom-0 flex items-center pr-1 pl-6 rounded-r-md",
|
||||
isActive
|
||||
isHighlighted
|
||||
? "bg-gradient-to-l from-accent from-60% to-transparent"
|
||||
: "bg-gradient-to-l from-sidebar from-60% to-transparent group-hover/item:from-accent",
|
||||
isMobile
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue