mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-09 07:42:39 +02:00
perf: add content-visibility: auto to long list items
Apply content-visibility: auto to off-screen list and sidebar items to skip browser layout and painting until they scroll into view. Changes: - globals.css: add .list-item-lazy (48px) and .sidebar-item-lazy (40px) utilities - DocumentsTableShell: apply list-item-lazy to desktop <tr> rows and mobile card divs - AllPrivateChatsSidebar: apply sidebar-item-lazy to thread items - AllSharedChatsSidebar: apply sidebar-item-lazy to thread items - InboxSidebar: apply content-visibility inline (80px intrinsic height) to inbox items Implements Vercel React Best Practices Rule: rendering-content-visibility (6.2)
This commit is contained in:
parent
5bfeda62f2
commit
ae3b69443f
5 changed files with 16 additions and 4 deletions
|
|
@ -630,7 +630,7 @@ export function DocumentsTableShell({
|
|||
return (
|
||||
<tr
|
||||
key={doc.id}
|
||||
className={`group border-b border-border/50 transition-colors ${
|
||||
className={`list-item-lazy group border-b border-border/50 transition-colors ${
|
||||
isMentioned ? "bg-primary/5 hover:bg-primary/8" : "hover:bg-muted/30"
|
||||
} ${canInteract && hasChatMode ? "cursor-pointer" : ""}`}
|
||||
onClick={handleRowClick}
|
||||
|
|
@ -871,7 +871,7 @@ export function DocumentsTableShell({
|
|||
return (
|
||||
<MobileCardWrapper key={doc.id} onLongPress={() => setMobileActionDoc(doc)}>
|
||||
<div
|
||||
className={`relative px-3 py-2 transition-colors ${
|
||||
className={`list-item-lazy relative px-3 py-2 transition-colors ${
|
||||
isMentioned ? "bg-primary/5" : "hover:bg-muted/20"
|
||||
} ${canInteract && hasChatMode ? "cursor-pointer" : ""}`}
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue