From d9b2b4591f3097b234207029a41d328f81e551c4 Mon Sep 17 00:00:00 2001 From: Wes Date: Mon, 29 Jun 2026 08:34:05 -0600 Subject: [PATCH] desktop: move ChannelPane props out of oversized file Move the ChannelPane prop type into a sibling type-only module so the main component file stays below the desktop file-size guard. No runtime behavior changes. Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co> Signed-off-by: Wes --- .../src/features/channels/ui/ChannelPane.tsx | 136 +----------------- .../features/channels/ui/ChannelPane.types.ts | 127 ++++++++++++++++ 2 files changed, 131 insertions(+), 132 deletions(-) create mode 100644 desktop/src/features/channels/ui/ChannelPane.types.ts diff --git a/desktop/src/features/channels/ui/ChannelPane.tsx b/desktop/src/features/channels/ui/ChannelPane.tsx index 588f19ae3..e04c9bff5 100644 --- a/desktop/src/features/channels/ui/ChannelPane.tsx +++ b/desktop/src/features/channels/ui/ChannelPane.tsx @@ -1,4 +1,5 @@ import * as React from "react"; +import type { ChannelPaneProps } from "./ChannelPane.types"; import { Bot, Hash, LogIn, Plus, Sparkles, UserPlus } from "lucide-react"; import { useMediaUpload } from "@/features/messages/lib/useMediaUpload"; import { MessageComposer } from "@/features/messages/ui/MessageComposer"; @@ -11,7 +12,6 @@ import { MessageTimeline, type MessageTimelineHandle, } from "@/features/messages/ui/MessageTimeline"; -import type { ImetaMedia } from "@/features/messages/lib/imetaMediaMarkdown"; import { buildDirectMessageIntro } from "@/features/channels/lib/dmParticipantDisplay"; import { getDmHuddleMemberPubkeys, @@ -23,20 +23,12 @@ import { } from "@/features/messages/lib/videoReviewContext"; import { useComposerHeightPadding } from "@/features/messages/ui/useComposerHeightPadding"; import { TypingIndicatorRow } from "@/features/messages/ui/TypingIndicatorRow"; -import type { TypingIndicatorEntry } from "@/features/messages/useChannelTyping"; -import { - type ProfilePanelTab, - type ProfilePanelView, - UserProfilePanel, -} from "@/features/profile/ui/UserProfilePanel"; +import { UserProfilePanel } from "@/features/profile/ui/UserProfilePanel"; import { ChannelFindBar } from "@/features/search/ui/ChannelFindBar"; import { AgentSessionThreadPanel } from "@/features/channels/ui/AgentSessionThreadPanel"; import { ChannelManagementAuxiliaryPanel } from "@/features/channels/ui/ChannelManagementAuxiliaryPanel"; import { RightAuxiliaryPane } from "@/features/channels/ui/RightAuxiliaryPane"; -import { - BotActivityComposerAction, - type BotActivityAgent, -} from "@/features/channels/ui/BotActivityBar"; +import { BotActivityComposerAction } from "@/features/channels/ui/BotActivityBar"; import { containsWelcomePersonaMention, WelcomeComposerBanner, @@ -53,135 +45,15 @@ import { mentionsKnownAgent, } from "@/features/channels/ui/ChannelPane.helpers"; import * as agentSessionSelection from "@/features/channels/ui/agentSessionSelection"; -import type { ChannelAgentSessionAgent } from "@/features/channels/ui/useChannelAgentSessions"; import { Button } from "@/shared/ui/button"; -import type { useChannelFind } from "@/features/search/useChannelFind"; -import { - buildMainTimelineEntries, - type MainTimelineEntry, -} from "@/features/messages/lib/threadPanel"; +import { buildMainTimelineEntries } from "@/features/messages/lib/threadPanel"; import { useRenderScopedReactionHydration } from "@/features/messages/lib/useRenderScopedReactionHydration"; import type { TimelineMessage } from "@/features/messages/types"; -import type { UserProfileLookup } from "@/features/profile/lib/identity"; import { isWelcomeChannel } from "@/features/onboarding/welcome"; import { KIND_SYSTEM_MESSAGE } from "@/shared/constants/kinds"; -import type { Channel } from "@/shared/api/types"; import { useIsThreadPanelOverlay } from "@/shared/hooks/use-mobile"; import { channelChrome } from "@/shared/layout/chromeLayout"; import { cn } from "@/shared/lib/cn"; -type ChannelPaneProps = { - activeChannel: Channel | null; - activityAgents?: BotActivityAgent[]; - agentPubkeys?: ReadonlySet; - agentPubkeysPending?: boolean; - agentSessionAgents: ChannelAgentSessionAgent[]; - botTypingEntries: TypingIndicatorEntry[]; - channelFind: ReturnType; - channelManagementOpen?: boolean; - currentPubkey?: string; - editTarget?: { - author: string; - body: string; - id: string; - imetaMedia?: ImetaMedia[]; - } | null; - fetchOlder?: () => Promise; - header?: React.ReactNode; - hasOlderMessages?: boolean; - isFetchingOlder?: boolean; - isJoining?: boolean; - isSinglePanelView?: boolean; - isSending: boolean; - isTimelineLoading: boolean; - messages: TimelineMessage[]; - firstUnreadMessageId?: string | null; - unreadCount?: number; - canResetThreadPanelWidth: boolean; - onCancelEdit?: () => void; - onCancelThreadReply: () => void; - onCloseAgentSession: () => void; - onCloseChannelManagement?: () => void; - onChannelManagementDeleted?: () => void; - onCloseProfilePanel: () => void; - onAddAgent?: () => void; - onCreateChannel?: () => void; - onCloseThread: () => void; - onDelete?: (message: TimelineMessage) => void; - onEdit?: (message: TimelineMessage) => void; - onEditSave?: (content: string, mediaTags?: string[][]) => Promise; - onMarkUnread?: (message: TimelineMessage) => void; - onMarkRead?: (message: TimelineMessage) => void; - onExpandThreadReplies: (message: TimelineMessage) => void; - onJoinChannel?: () => Promise; - onOpenAgentSession: (pubkey: string) => void; - onOpenDm?: (pubkeys: string[]) => Promise | void; - onOpenMembers?: () => void; - onOpenProfilePanel: (pubkey: string) => void; - onOpenThread: (message: TimelineMessage) => void; - onResetThreadPanelWidth: () => void; - onSelectThreadReplyTarget: (message: TimelineMessage) => void; - onSendMessage: ( - content: string, - mentionPubkeys: string[], - mediaTags?: string[][], - ) => Promise; - onSendVideoReviewComment?: ( - message: TimelineMessage, - content: string, - mentionPubkeys: string[], - mediaTags?: string[][], - parentEventId?: string, - ) => Promise; - onSendThreadReply: ( - content: string, - mentionPubkeys: string[], - mediaTags?: string[][], - ) => Promise; - onTargetReached?: (messageId: string) => void; - onToggleReaction?: ( - message: TimelineMessage, - emoji: string, - remove: boolean, - ) => Promise; - onThreadScrollTargetResolved: () => void; - onThreadPanelResizeStart: ( - event: React.PointerEvent, - ) => void; - personaLookup?: Map; - profiles?: UserProfileLookup; - openThreadHeadId: string | null; - shouldShowThreadSkeleton: boolean; - openAgentSessionPubkey: string | null; - onProfilePanelViewChange: ( - view: ProfilePanelView, - options?: { replace?: boolean }, - ) => void; - onProfilePanelTabChange: ( - tab: ProfilePanelTab, - options?: { replace?: boolean }, - ) => void; - profilePanelPubkey?: string | null; - profilePanelTab: ProfilePanelTab; - profilePanelView: ProfilePanelView; - threadHeadMessage: TimelineMessage | null; - threadMessages: MainTimelineEntry[]; - threadPanelWidthPx: number; - threadTypingPubkeys: string[]; - threadReplyTargetMessage: TimelineMessage | null; - threadScrollTargetId: string | null; - threadUnreadCounts?: ReadonlyMap; - threadReplyUnreadCounts?: ReadonlyMap; - threadFirstUnreadReplyId?: string | null; - targetMessageId: string | null; - typingPubkeys: string[]; - isFollowingThread?: boolean; - onFollowThread?: () => void; - onUnfollowThread?: () => void; - followThreadById?: (rootId: string) => void; - unfollowThreadById?: (rootId: string) => void; - isFollowingThreadById?: (rootId: string) => boolean; - isMessageUnreadById?: (messageId: string) => boolean; -}; export const ChannelPane = React.memo(function ChannelPane({ activeChannel, agentPubkeys, diff --git a/desktop/src/features/channels/ui/ChannelPane.types.ts b/desktop/src/features/channels/ui/ChannelPane.types.ts new file mode 100644 index 000000000..3fbd44e9a --- /dev/null +++ b/desktop/src/features/channels/ui/ChannelPane.types.ts @@ -0,0 +1,127 @@ +import type { ChannelAgentSessionAgent } from "@/features/channels/ui/useChannelAgentSessions"; +import type { ImetaMedia } from "@/features/messages/lib/imetaMediaMarkdown"; +import type { MainTimelineEntry } from "@/features/messages/lib/threadPanel"; +import type { TimelineMessage } from "@/features/messages/types"; +import type { TypingIndicatorEntry } from "@/features/messages/useChannelTyping"; +import type { UserProfileLookup } from "@/features/profile/lib/identity"; +import type { + ProfilePanelTab, + ProfilePanelView, +} from "@/features/profile/ui/UserProfilePanel"; +import type { useChannelFind } from "@/features/search/useChannelFind"; +import type { Channel } from "@/shared/api/types"; +import type { BotActivityAgent } from "./BotActivityBar"; + +export type ChannelPaneProps = { + activeChannel: Channel | null; + activityAgents?: BotActivityAgent[]; + agentPubkeys?: ReadonlySet; + agentPubkeysPending?: boolean; + agentSessionAgents: ChannelAgentSessionAgent[]; + botTypingEntries: TypingIndicatorEntry[]; + channelFind: ReturnType; + channelManagementOpen?: boolean; + currentPubkey?: string; + editTarget?: { + author: string; + body: string; + id: string; + imetaMedia?: ImetaMedia[]; + } | null; + fetchOlder?: () => Promise; + header?: React.ReactNode; + hasOlderMessages?: boolean; + isFetchingOlder?: boolean; + isJoining?: boolean; + isSinglePanelView?: boolean; + isSending: boolean; + isTimelineLoading: boolean; + messages: TimelineMessage[]; + firstUnreadMessageId?: string | null; + unreadCount?: number; + canResetThreadPanelWidth: boolean; + onCancelEdit?: () => void; + onCancelThreadReply: () => void; + onCloseAgentSession: () => void; + onCloseChannelManagement?: () => void; + onChannelManagementDeleted?: () => void; + onCloseProfilePanel: () => void; + onAddAgent?: () => void; + onCreateChannel?: () => void; + onCloseThread: () => void; + onDelete?: (message: TimelineMessage) => void; + onEdit?: (message: TimelineMessage) => void; + onEditSave?: (content: string, mediaTags?: string[][]) => Promise; + onMarkUnread?: (message: TimelineMessage) => void; + onMarkRead?: (message: TimelineMessage) => void; + onExpandThreadReplies: (message: TimelineMessage) => void; + onJoinChannel?: () => Promise; + onOpenAgentSession: (pubkey: string) => void; + onOpenDm?: (pubkeys: string[]) => Promise | void; + onOpenMembers?: () => void; + onOpenProfilePanel: (pubkey: string) => void; + onOpenThread: (message: TimelineMessage) => void; + onResetThreadPanelWidth: () => void; + onSelectThreadReplyTarget: (message: TimelineMessage) => void; + onSendMessage: ( + content: string, + mentionPubkeys: string[], + mediaTags?: string[][], + ) => Promise; + onSendVideoReviewComment?: ( + message: TimelineMessage, + content: string, + mentionPubkeys: string[], + mediaTags?: string[][], + parentEventId?: string, + ) => Promise; + onSendThreadReply: ( + content: string, + mentionPubkeys: string[], + mediaTags?: string[][], + ) => Promise; + onTargetReached?: (messageId: string) => void; + onToggleReaction?: ( + message: TimelineMessage, + emoji: string, + remove: boolean, + ) => Promise; + onThreadScrollTargetResolved: () => void; + onThreadPanelResizeStart: ( + event: React.PointerEvent, + ) => void; + personaLookup?: Map; + profiles?: UserProfileLookup; + openThreadHeadId: string | null; + shouldShowThreadSkeleton: boolean; + openAgentSessionPubkey: string | null; + onProfilePanelViewChange: ( + view: ProfilePanelView, + options?: { replace?: boolean }, + ) => void; + onProfilePanelTabChange: ( + tab: ProfilePanelTab, + options?: { replace?: boolean }, + ) => void; + profilePanelPubkey?: string | null; + profilePanelTab: ProfilePanelTab; + profilePanelView: ProfilePanelView; + threadHeadMessage: TimelineMessage | null; + threadMessages: MainTimelineEntry[]; + threadPanelWidthPx: number; + threadTypingPubkeys: string[]; + threadReplyTargetMessage: TimelineMessage | null; + threadScrollTargetId: string | null; + threadUnreadCounts?: ReadonlyMap; + threadReplyUnreadCounts?: ReadonlyMap; + threadFirstUnreadReplyId?: string | null; + targetMessageId: string | null; + typingPubkeys: string[]; + isFollowingThread?: boolean; + onFollowThread?: () => void; + onUnfollowThread?: () => void; + followThreadById?: (rootId: string) => void; + unfollowThreadById?: (rootId: string) => void; + isFollowingThreadById?: (rootId: string) => boolean; + isMessageUnreadById?: (messageId: string) => boolean; +};