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: scroll to bottom of channel on new top level message (#561)

gbirman48049255cd64
diff --git a/js/app/packages/block-channel/component/MessageList/MessageList.tsx b/js/app/packages/block-channel/component/MessageList/MessageList.tsx
index 74652c232b..7b6c5a6762 100644
--- a/js/app/packages/block-channel/component/MessageList/MessageList.tsx
+++ b/js/app/packages/block-channel/component/MessageList/MessageList.tsx
@@ -450,16 +450,19 @@ export function MessageList(props: MessageListProps) {
return messageToReaction[lastMessageId];
});
- // Track updates to the last top-level message's thread count (for scroll behavior)
- const lastMessageThreadCount = createMemo(() => {
+ const lastMessageThread = createMemo(() => {
const base = filteredTopLevelMessages() ?? [];
const lastTopLevelId = base[base.length - 1]?.id;
- return viewThreads[lastTopLevelId]?.length ?? 0;
+ return viewThreads[lastTopLevelId];
});
+ const lastMessageThreadCount = createMemo(
+ () => lastMessageThread()?.length ?? 0
+ );
+
// scroll to bottom on change to last message state (including new messages)
createEffect(
- on([lastMessageReaction, lastMessageThreadCount], () => {
+ on([lastMessageReaction, lastMessageThread, lastMessageThreadCount], () => {
if (!isNearBottom()) return;
scrollToBottomOrTarget({ forceBottom: true });
})