Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
feat: channels scroll to bottom button (#155)
gbirman332e1a2f41de
diff --git a/js/app/packages/block-channel/component/MessageList/MessageList.tsx b/js/app/packages/block-channel/component/MessageList/MessageList.tsxindex d9e8ae83de..547048741e 100644--- a/js/app/packages/block-channel/component/MessageList/MessageList.tsx+++ b/js/app/packages/block-channel/component/MessageList/MessageList.tsx@@ -362,6 +362,7 @@ export function MessageList(props: MessageListProps) {const [unviewedMessages, setUnviewedMessages] = createSignal<Message[]>();const [dismissUnviewedMessages, setDismissUnviewedMessages] =createSignal(false);+ const [dismissJumpToLatest, setDismissJumpToLatest] = createSignal(false);const [newMessageIndex, setNewMessageIndex] = createSignal<number>();// Record new unviewed messages@@ -441,7 +442,12 @@ export function MessageList(props: MessageListProps) {// Handle vlistscroll eventsconst handleScroll = () => {- setIsNearBottom(checkIfNearBottom());+ const nearBottom = checkIfNearBottom();+ setIsNearBottom(nearBottom);++ if (!nearBottom && dismissJumpToLatest()) {+ setDismissJumpToLatest(false);+ }const messages = unviewedMessages();if (messages?.length) {@@ -474,6 +480,10 @@ export function MessageList(props: MessageListProps) {}};+ const showJumpToUnviewedMessages = createMemo(+ () => !dismissUnviewedMessages() && !!unviewedMessages()?.length+ );+return (<divclass="flex-1 overflow-y-hidden suppress-css-brackets"@@ -555,16 +565,38 @@ export function MessageList(props: MessageListProps) {</VList></Match></Switch>- <Show when={unviewedMessages() && !dismissUnviewedMessages()}>+ <Show when={showJumpToUnviewedMessages() && unviewedMessages()}>+ {(messages) => (+ <TextButton+ icon={ArrowDownIcon}+ theme="base"+ onMouseDown={jumpToUnviewedMessages}+ text={`${messages().length} new message${messages().length === 1 ? '' : 's'}`}+ secondaryIcon={XIcon}+ onOptionClick={() => setDismissUnviewedMessages(true)}+ showSeparator+ class="absolute top-4 left-1/2 -translate-x-1/2"+ />+ )}+ </Show>+ <Show+ when={+ !dismissJumpToLatest() &&+ !showJumpToUnviewedMessages() &&+ !isNearBottom()+ }+ ><TextButtonicon={ArrowDownIcon}- theme="accentOpaque"- onMouseDown={jumpToUnviewedMessages}- text={`${unviewedMessages()?.length} new message${unviewedMessages()?.length === 1 ? '' : 's'}`}+ theme="base"+ text="Jump to latest"+ onMouseDown={() =>+ scrollToBottomOrTarget({ forceBottom: true, onlyBottom: true })+ }secondaryIcon={XIcon}- onOptionClick={() => setDismissUnviewedMessages(true)}+ onOptionClick={() => setDismissJumpToLatest(true)}showSeparator- class="absolute top-4 left-1/2 -translate-x-1/2"+ class="absolute top-4 left-1/2 -translate-x-1/2 transition-opacity duration-200"/></Show></div>diff --git a/js/app/packages/core/component/AI/component/input/ToolsetSelector.tsx b/js/app/packages/core/component/AI/component/input/ToolsetSelector.tsxindex 1c1178ae59..46f79f5c3f 100644--- a/js/app/packages/core/component/AI/component/input/ToolsetSelector.tsx+++ b/js/app/packages/core/component/AI/component/input/ToolsetSelector.tsx@@ -52,7 +52,7 @@ export function ToolsetSelector(props: {const [toolset, setToolset] = props.toolset;const [source, setSource] = props.sources;- const StyledTriggerLabel = (props: ParentProps) => {+ const _StyledTriggerLabel = (props: ParentProps) => {return (<Tooltiptooltip={'Tell the agent which sources to consider in its search'}diff --git a/js/app/packages/macro-entity/src/components/EntityWithEverything.tsx b/js/app/packages/macro-entity/src/components/EntityWithEverything.tsxindex 89ba8ce0a5..5621312171 100644--- a/js/app/packages/macro-entity/src/components/EntityWithEverything.tsx+++ b/js/app/packages/macro-entity/src/components/EntityWithEverything.tsx@@ -29,17 +29,11 @@ import {isProjectContainedEntity,type ProjectContainedEntity,} from '../queries/project';-import type { EntityData, EntityOf } from '../types/entity';+import type { EntityData } from '../types/entity';import type { Notification, WithNotification } from '../types/notification';import type { WithSearch } from '../types/search';import type { EntityClickHandler } from './Entity';-function isEmailEntity(- entity: WithNotification<EntityData>-): entity is WithNotification<EntityOf<'email'>> {- return entity.type === 'email';-}-function UnreadIndicator(props: { active?: boolean }) {return (<div class="flex min-w-5 items-center justify-center">@@ -177,7 +171,7 @@ export function EntityWithEverything(const isLikelyEmail = (value?: string) =>typeof value === 'string' && value.includes('@');const combinedParticipantFirstNames = createMemo(() => {- if (!isEmailEntity(props.entity)) return [];+ if (props.entity.type !== 'email') return [];const me = userEmail();const participantNames = props.entity.participantNames ?? [];return (