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): drill participant list into inline edit input (#4237)

Seamus90c64b4dd387
diff --git a/js/app/packages/channel/Channel/Channel.tsx b/js/app/packages/channel/Channel/Channel.tsx
index 7aa2edc3f8..9d363c023c 100644
--- a/js/app/packages/channel/Channel/Channel.tsx
+++ b/js/app/packages/channel/Channel/Channel.tsx
@@ -527,6 +527,7 @@ export function Channel(props: ChannelProps) {
setReplyInputHandle={state.setReplyInputHandle}
listMeta={listMetaByMessageId()[item.id]}
messageEditor={messageEditor}
+ participants={participants.users}
threadActions={{
onDismissNewMessages:
activityTracker.dismissNewMessages,
diff --git a/js/app/packages/channel/Channel/InlineMessageEditor.tsx b/js/app/packages/channel/Channel/InlineMessageEditor.tsx
index 0f268d9da9..4dc058e64c 100644
--- a/js/app/packages/channel/Channel/InlineMessageEditor.tsx
+++ b/js/app/packages/channel/Channel/InlineMessageEditor.tsx
@@ -1,6 +1,8 @@
import { registerHotkey, useHotkeyDOMScope } from '@core/hotkey/hotkeys';
import { TOKENS } from '@core/hotkey/tokens';
+import type { IUser } from '@core/user/types';
import { cn } from '@ui';
+import type { Accessor } from 'solid-js';
import { ChannelInput, createInputAttachmentTracker, Input } from '../Input';
import { useMessage } from '../Message';
import type { MessageEditor } from './create-message-editor';
@@ -8,6 +10,7 @@ import type { MessageEditor } from './create-message-editor';
type MessageEditorContentProps = {
channelId: string;
messageEditor: MessageEditor;
+ participants?: Accessor<IUser[]>;
class?: string;
};
@@ -47,6 +50,7 @@ export function MessageEditorContent(props: MessageEditorContentProps) {
placeholder: 'Edit message',
}}
attachmentTracker={attachmentTracker}
+ participants={props.participants}
markdownNamespace={`edit-message-${props.channelId}-${message().id}`}
onChange={(nextSnapshot) =>
props.messageEditor.update(message(), nextSnapshot)
diff --git a/js/app/packages/channel/Message/ChannelMessage.tsx b/js/app/packages/channel/Message/ChannelMessage.tsx
index 6f7a5cd5b3..1a4565ed3e 100644
--- a/js/app/packages/channel/Message/ChannelMessage.tsx
+++ b/js/app/packages/channel/Message/ChannelMessage.tsx
@@ -1,9 +1,10 @@
import { useMessageActionDrawer } from '@channel/Mobile/message-action-drawer-context';
import { touchHandler } from '@core/directive/touchHandler';
import { isTouchDevice } from '@core/mobile/isTouchDevice';
+import type { IUser } from '@core/user/types';
import TrashIcon from '@icon/square-trash.svg';
import { cn } from '@ui';
-import { type JSX, Match, Show, Switch } from 'solid-js';
+import { type Accessor, type JSX, Match, Show, Switch } from 'solid-js';
import type { MessageEditor } from '../Channel/create-message-editor';
import { MessageEditorContent } from '../Channel/InlineMessageEditor';
import type { MessageSelectionState } from './context';
@@ -18,6 +19,7 @@ type ChannelMessageProps = {
actions?: MessageActions;
listMeta?: ChannelMessageListMeta;
messageEditor?: MessageEditor;
+ participants?: Accessor<IUser[]>;
highlighted?: boolean;
selectionState?: MessageSelectionState;
onClick?: JSX.EventHandlerUnion<HTMLDivElement, MouseEvent>;
@@ -33,6 +35,7 @@ function isEditingMessage(
function MessageContentSlot(props: {
channelId: string;
messageEditor?: MessageEditor;
+ participants?: Accessor<IUser[]>;
class?: string;
}) {
const message = useMessage();
@@ -45,6 +48,7 @@ function MessageContentSlot(props: {
<MessageEditorContent
channelId={props.channelId}
messageEditor={messageEditor()}
+ participants={props.participants}
class={props.class}
/>
)}
@@ -115,6 +119,7 @@ function DeletedMessageLayout() {
function RegularMessageLayout(props: {
channelId: string;
messageEditor?: MessageEditor;
+ participants?: Accessor<IUser[]>;
}) {
return (
<Message.Layout class="pt-(--regular-message-padding-t)">
@@ -134,6 +139,7 @@ function RegularMessageLayout(props: {
<MessageContentSlot
channelId={props.channelId}
messageEditor={props.messageEditor}
+ participants={props.participants}
/>
</Message.Slot>
<Message.Slot
@@ -150,6 +156,7 @@ function RegularMessageLayout(props: {
function GroupedMessageLayout(props: {
channelId: string;
messageEditor?: MessageEditor;
+ participants?: Accessor<IUser[]>;
}) {
return (
<Message.Layout>
@@ -161,6 +168,7 @@ function GroupedMessageLayout(props: {
<MessageContentSlot
channelId={props.channelId}
messageEditor={props.messageEditor}
+ participants={props.participants}
class="min-w-0 flex-1"
/>
{/* TODO (seamus): hiding the grouped meta for now */}
@@ -207,12 +215,14 @@ export function ChannelMessage(props: ChannelMessageProps) {
<GroupedMessageLayout
channelId={props.channelId}
messageEditor={props.messageEditor}
+ participants={props.participants}
/>
</Match>
<Match when={true}>
<RegularMessageLayout
channelId={props.channelId}
messageEditor={props.messageEditor}
+ participants={props.participants}
/>
</Match>
</Switch>
diff --git a/js/app/packages/channel/Thread/ChannelThread.tsx b/js/app/packages/channel/Thread/ChannelThread.tsx
index 19a7cb26ee..7a0745cfb9 100644
--- a/js/app/packages/channel/Thread/ChannelThread.tsx
+++ b/js/app/packages/channel/Thread/ChannelThread.tsx
@@ -233,6 +233,7 @@ export function ChannelThread(props: ThreadProps) {
actions={props.getMessageActions?.(props.data())}
listMeta={props.listMeta}
messageEditor={props.messageEditor}
+ participants={props.participants}
onClick={selectThreadMessage}
highlighted={isSelected() && !isThreadFocused()}
selectionState={
@@ -260,6 +261,7 @@ export function ChannelThread(props: ThreadProps) {
replies={displayReplies()}
getMessageActions={props.getMessageActions}
messageEditor={props.messageEditor}
+ participants={props.participants}
isNewMessage={props.isNewMessage}
onReady={setReplyListHandle}
selectedReplyId={replySelection.selectedId}
diff --git a/js/app/packages/channel/Thread/ThreadReplyList.tsx b/js/app/packages/channel/Thread/ThreadReplyList.tsx
index 160dabdb27..a0e4c960a1 100644
--- a/js/app/packages/channel/Thread/ThreadReplyList.tsx
+++ b/js/app/packages/channel/Thread/ThreadReplyList.tsx
@@ -1,3 +1,4 @@
+import type { IUser } from '@core/user/types';
import { MarkMessageNotifications } from '@notifications/components/MarkMessageNotifications';
import type { ApiThreadReply } from '@service-storage/generated/schemas/apiThreadReply';
import { type Accessor, createMemo, For, onMount } from 'solid-js';
@@ -29,6 +30,7 @@ export function ThreadReplyList(props: {
replies: Array<ApiThreadReply>;
getMessageActions?: (message: MessageData) => MessageActions | undefined;
messageEditor?: MessageEditor;
+ participants?: Accessor<IUser[]>;
isNewMessage?: (message: NewMessageCheckable) => boolean;
onReady?: (handle: ThreadReplyListHandle) => void;
selectedReplyId?: Accessor<string | undefined>;
@@ -85,6 +87,7 @@ export function ThreadReplyList(props: {
actions={props.getMessageActions?.(replyMessage())}
listMeta={listMetaByReplyId()[reply.id]}
messageEditor={props.messageEditor}
+ participants={props.participants}
onClick={() => props.onSelectReply?.(reply.id)}
highlighted={isReplySelected()}
selectionState={
diff --git a/js/app/packages/channel/Thread/types.ts b/js/app/packages/channel/Thread/types.ts
index ba96b2f1ed..0d5dc3eab8 100644
--- a/js/app/packages/channel/Thread/types.ts
+++ b/js/app/packages/channel/Thread/types.ts
@@ -1,6 +1,7 @@
import type { MessageEditor } from '@channel/Channel/create-message-editor';
import type { NewMessageCheckable } from '@channel/Channel/util';
import type { InputHandle, InputSnapshot } from '@channel/Input';
+import type { IUser } from '@core/user/types';
import type { ApiChannelMessage } from '@service-storage/generated/schemas/apiChannelMessage';
import type { Accessor, Setter } from 'solid-js';
import type {
@@ -38,6 +39,7 @@ export type ThreadProps = {
listMeta?: ChannelMessageListMeta;
threadActions?: ThreadActions;
messageEditor?: MessageEditor;
+ participants?: Accessor<IUser[]>;
targetThreadId?: string;
/** One-shot scroll target. Caller must clear via `onTargetReplyScrolled`. */
targetReplyId?: string;