Repository navigation
Remove dead chat composer code #274
Description
Problem
The composer folders carry code that nothing uses. It costs reading time and hides the real entry points.
A code trace on 14ab7f9c1 shows:
apps/webapp/src/components/chatroom/components/MessageComposer/types/index.tsis an empty file. It sits next toMessageComposer/types.ts, which every import resolves to.apps/webapp/src/components/chatroom/components/MessageComposer/index.tsre-exports./MessageComposerwithexport *. No file imports it. Every caller importsMessageComposer.tsxdirectly, andexport *does not carry a default export anyway.apps/webapp/src/components/chatroom/components/ChannelComposer/index.tsis a second barrel that no file imports.Chatroom.tsximportsChannelComposer.tsxdirectly.apps/webapp/src/components/chatroom/components/MessageComposer/components/Context/index.ts:1,:3, and:4useexport *on files that have only a default export, so they export nothing.- Thirteen statics on
MessageComposerhave no reference (apps/webapp/src/components/chatroom/components/MessageComposer/MessageComposer.tsx:295-303,:305-307,:310):BlockquoteButton,BoldButton,BulletListButton,CodeBlockButton,CodeButton,CommentContext,EditContext,HyperlinkButton,ItalicButton,MentionButton,OrderedListButton,ReplyContext,StrikethroughButton. - Three statics on
ChannelComposerhave no reference (apps/webapp/src/components/chatroom/components/ChannelComposer/ChannelComposer.tsx:67,:71,:72):AccessControl,MsgComposer,SignInPrompt. - The
.chat_msg_containerselector matches no element (apps/webapp/src/styles/_chat-editor.scss:1). The chat prose frame row in.cursor/docs/design-system.md:678still names it. - None of the 12
CHAT_OPENpublishers setsinsertContent. The chat-open subscriber only forwards the field (apps/webapp/src/services/eventsHub.ts:56,:75). SoinsertChatComposerContentWithRetry(apps/webapp/src/services/openHeadingChatroom.ts:62-78), its call (:163), and theinsertContentfield are dead. The field sits on the chat open payload (apps/webapp/src/services/eventsHub.ts:24),OpenHeadingChatroomParams(openHeadingChatroom.ts:112), andOpenHeadingChatBrowseParams(:176).
Keep
- The statics
MessageComposer.EditorContent,MessageComposer.ComposerLayout,MessageComposer.ComposerDesktopLayout, andMessageComposer.ComposerMobileLayout. AGENTS.md §Code Quality names them as the canonical composer exports. Three of them have no reference today, and they stay anyway. GifPickerButton. The chatroom docs say it is unmounted only for now (apps/webapp/src/components/chatroom/CLAUDE.md:88).
Acceptance criteria
- Each item in the Problem list is deleted. For a static, delete the assignment and any import that only it used. The button and context-bar component files stay, because the format toolbar and the context bars still use them.
- Each item under Keep is still present.
-
.cursor/docs/design-system.mdno longer names.chat_msg_container. -
bun run typecheck,bun run lint, andbun run lint:stylespass. - On desktop and on a phone, the composer renders, the format toolbar opens, and the reply bar shows for a reply.
Agent Brief
Category: enhancement
Summary: Delete composer code with no references, and keep the exports that AGENTS.md names.
Current behavior:
Two unused barrels, three export * lines that export nothing, and an empty types file sit in the composer folders. Thirteen MessageComposer statics and three ChannelComposer statics have no reference. One selector matches no element. No CHAT_OPEN publisher sets insertContent, so the field and insertChatComposerContentWithRetry are dead.
Desired behavior:
Every item in the Problem list is gone. The Keep items remain. The composer looks and behaves as before.
Key interfaces:
- The
MessageComposerandChannelComposerstatics. - The
MessageComposerandChannelComposerbarrel files. insertChatComposerContentWithRetry().- The
insertContentfield on the chat open payload,OpenHeadingChatroomParams, andOpenHeadingChatBrowseParams.
Out of scope
- The parked
GifPickerButtonandMediaFilterToggle. - The
SignInToJoinChannelcomponent. Nothing mounts it, but the chatroom docs and the design system still name it. - Renaming live statics.
Notes
Re-run the reference search with git grep before each deletion. The tree may change between filing and fixing.
After this issue and #294 land, nothing calls retryWithBackoff. The change that lands last deletes it.
Activity
refactor(chatroom): remove dead composer exports and insertContent field
fix(webapp): focus the requested chat composer when it mounts