impr: improve virtual list performance and reliability (#595)
* fix: sometimes missing posts when navigating backl * impr: debounce updates for resize operations * fix: sentient comments
This commit is contained in:
1 parent
2fb3c2675f
commit
a8b65750ca
5 files changed
+38
-26
No files matched your search
@@ -38,11 +38,11 @@
|
||||
actions = true,
|
||||
meta = true,
|
||||
replying = $bindable(false),
|
||||
open = $bindable(),
|
||||
contentClass = '',
|
||||
class: clazz = '',
|
||||
metaSuffix,
|
||||
children,
|
||||
open = $bindable(true),
|
||||
}: Props = $props()
|
||||
|
||||
let editing = $state(false)
|
||||
@@ -74,16 +74,6 @@
|
||||
|
||||
editingLoad = false
|
||||
}
|
||||
|
||||
$effect(() => {
|
||||
if (!open) {
|
||||
// const
|
||||
}
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
open = true
|
||||
}, 500)
|
||||
</script>
|
||||
|
||||
{#if editing}
|
||||
|
||||
@@ -42,7 +42,8 @@
|
||||
{#if offsetEl}
|
||||
<VirtualList
|
||||
class="divide-y divide-slate-200 dark:divide-zinc-800 w-full"
|
||||
overscan={500}
|
||||
overscan={50}
|
||||
estimatedHeight={100}
|
||||
items={nodes}
|
||||
{initialOffset}
|
||||
>
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
node.comment_view.counts.child_count > 0
|
||||
? 'border-l'
|
||||
: ''} ml-2.5 border-slate-200 dark:border-zinc-800 pl-2.5"
|
||||
bind:open={() => node.expanded, value => (node.expanded = value)}
|
||||
bind:open={nodes[index].expanded}
|
||||
>
|
||||
{#if node.children?.length > 0}
|
||||
<Comments {post} nodes={nodes[index].children} isParent={false} />
|
||||
|
||||
Reference in new issue
Block a user