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(channels): channel scroll should highlight from soup click + not highlight unwanted target message on message send (#685)

gbirman0e6afddf9ec4
diff --git a/js/app/packages/app/component/UnifiedListView.tsx b/js/app/packages/app/component/UnifiedListView.tsx
index 0171d742df..75223da35e 100644
--- a/js/app/packages/app/component/UnifiedListView.tsx
+++ b/js/app/packages/app/component/UnifiedListView.tsx
@@ -1131,12 +1131,12 @@ export function UnifiedListView(props: UnifiedListViewProps) {
switch (location.type) {
case 'channel': {
- // NOTE: this is handled by the channel block params
- // const blockHandle = await blockOrchestrator.getBlockHandle(entity.id);
- // await blockHandle?.goToLocationFromParams({
- // [CHANNEL_PARAMS.thread]: location.threadId,
- // [CHANNEL_PARAMS.message]: location.messageId,
- // });
+ // NOTE: this is handled by the channel block params but this can be used to re-flash an open channel
+ const blockHandle = await blockOrchestrator.getBlockHandle(entity.id);
+ await blockHandle?.goToLocationFromParams({
+ [CHANNEL_PARAMS.thread]: location.threadId,
+ [CHANNEL_PARAMS.message]: location.messageId,
+ });
break;
}
case 'email': {
diff --git a/js/app/packages/block-channel/component/MessageList/MessageList.tsx b/js/app/packages/block-channel/component/MessageList/MessageList.tsx
index 3e74700247..e3c7d5a539 100644
--- a/js/app/packages/block-channel/component/MessageList/MessageList.tsx
+++ b/js/app/packages/block-channel/component/MessageList/MessageList.tsx
@@ -537,27 +537,26 @@ export function MessageList(props: MessageListProps) {
on(props.targetMessage, (target) => {
if (!target) return;
setLastTargetMessageTimestamp(Date.now());
+ debouncedScrollToBottomOrTarget();
})
);
// initial scroll
createRenderEffect(
on(
- [
- virtualHandle,
- props.targetMessage,
- listContainerRef,
- props.orderedMessages,
- ],
+ [virtualHandle, listContainerRef, props.orderedMessages],
// NOTE: ordered messages gets updated on initial load due to thread layout calculations
// so we need to keep scrolling down until it settles
- ([handle, target, listContainerRef, orderedMessages]) => {
- if (!handle || !listContainerRef || orderedMessages.length === 0)
+ ([handle, listContainerRef, orderedMessages]) => {
+ if (
+ !handle ||
+ !listContainerRef ||
+ !orderedMessages.length ||
+ initialScrollComplete()
+ )
return;
- const forceBottom = target === undefined;
-
- scrollToBottomOrTarget({ forceBottom });
+ scrollToBottomOrTarget({ forceBottom: true });
}
)
);