Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

✨ feat(channels): let a host cap the conversation column width (#23487)

YuTengjing816e46b93fd4
diff --git a/src/features/Channels/ChannelConversation.tsx b/src/features/Channels/ChannelConversation.tsx
index 44f5394fe67..cb3402810d8 100644
--- a/src/features/Channels/ChannelConversation.tsx
+++ b/src/features/Channels/ChannelConversation.tsx
@@ -42,6 +42,11 @@ interface ChannelConversationProps {
channelId: string;
/** Mounted beside a thread panel that covers it, so keep it out of the tab order. */
inert?: boolean;
+ /**
+ * Caps the feed and composer column width, centered. A Channel spans the full width by default;
+ * a standalone chat page (an Agent share) caps it like a regular Agent conversation.
+ */
+ maxWidth?: number;
onOpenThread?: (threadId: string, toggle?: boolean) => void;
onOpenTopic?: (topic: ReplyTopic) => void;
onStartThread?: (draft: ChannelThreadDraft) => void;
@@ -53,6 +58,7 @@ interface ChannelConversationProps {
const Timeline = ({
channelId,
inert,
+ maxWidth,
starter,
threadId = null,
onOpenThread,
@@ -189,7 +195,7 @@ const Timeline = ({
}}
{...stylex.props(styles.feed)}
>
- <WideScreenContainer fullWidth paddingInline={16}>
+ <WideScreenContainer fullWidth paddingInline={16} style={{ maxWidth }}>
{(detail.hasMore || before !== undefined) && (
<Flexbox horizontal align="center" gap={8} justify="center" paddingBlock={8}>
<Button
@@ -302,6 +308,7 @@ const Timeline = ({
channel={detail.channel}
draftKey={channelDraftKey(channelId, threadId)}
key={channelDraftKey(channelId, threadId)}
+ maxWidth={maxWidth}
members={activeMembers}
replyTarget={reply.target}
starter={threadId ? undefined : starter}
diff --git a/src/features/Channels/Composer.tsx b/src/features/Channels/Composer.tsx
index c911df8f67b..4ea5e6ff026 100644
--- a/src/features/Channels/Composer.tsx
+++ b/src/features/Channels/Composer.tsx
@@ -89,6 +89,7 @@ export function Composer({
activity,
channel,
draftKey,
+ maxWidth,
members,
onQueue,
onSend,
@@ -103,6 +104,8 @@ export function Composer({
channel?: ChannelListItem;
/** Where unsent input is kept; see {@link useComposerDraft}. */
draftKey: string;
+ /** Caps the composer column width, centered; spans the full width when omitted. */
+ maxWidth?: number;
members: ChannelPublicMember[];
placeholder: string;
replyTarget?: ChannelReplyTarget | null;
@@ -237,7 +240,7 @@ export function Composer({
/>
);
return (
- <WideScreenContainer fullWidth paddingInline={8}>
+ <WideScreenContainer fullWidth paddingInline={8} style={{ maxWidth }}>
<Flexbox {...stylex.props(styles.composer)} gap={4} {...getContainerProps()}>
{/* Without an activity line the input meets the feed directly, with no empty strip. */}
{activity != null && (