Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(channel): channel freezing when too many messages (#894)

dev-rb2747410ab691
diff --git a/js/app/packages/block-channel/component/MessageList/MessageList.tsx b/js/app/packages/block-channel/component/MessageList/MessageList.tsx
index 5732b11a16..b137611860 100644
--- a/js/app/packages/block-channel/component/MessageList/MessageList.tsx
+++ b/js/app/packages/block-channel/component/MessageList/MessageList.tsx
@@ -413,10 +413,16 @@ function MessageListImpl(props: MessageListProps) {
const [isPrepend, setIsPrepend] = createSignal(false);
- createEffect(() => {
- props.messages;
- setIsPrepend(true);
- });
+ createEffect(
+ on(
+ () => props.messages,
+ () => {
+ props.messages;
+ setIsPrepend(true);
+ },
+ { defer: true }
+ )
+ );
createEffect(
on(flattenedThreaded, (flat, prev) => {
@@ -761,7 +767,8 @@ function MessageListImpl(props: MessageListProps) {
data-channel-message-list
data={rows() ?? []}
shift={isPrepend()}
- bufferSize={30 * BASE_ITEM_SIZE}
+ itemSize={BASE_ITEM_SIZE}
+ bufferSize={10 * BASE_ITEM_SIZE}
keepMounted={keepMountedIndices()}
onScroll={handleScroll}
onScrollEnd={() => {