Skip to content

Remove dead chat composer code #274

Description

@HMarzban

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.ts is an empty file. It sits next to MessageComposer/types.ts, which every import resolves to.
  • apps/webapp/src/components/chatroom/components/MessageComposer/index.ts re-exports ./MessageComposer with export *. No file imports it. Every caller imports MessageComposer.tsx directly, and export * does not carry a default export anyway.
  • apps/webapp/src/components/chatroom/components/ChannelComposer/index.ts is a second barrel that no file imports. Chatroom.tsx imports ChannelComposer.tsx directly.
  • apps/webapp/src/components/chatroom/components/MessageComposer/components/Context/index.ts:1, :3, and :4 use export * on files that have only a default export, so they export nothing.
  • Thirteen statics on MessageComposer have 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 ChannelComposer have no reference (apps/webapp/src/components/chatroom/components/ChannelComposer/ChannelComposer.tsx:67, :71, :72): AccessControl, MsgComposer, SignInPrompt.
  • The .chat_msg_container selector matches no element (apps/webapp/src/styles/_chat-editor.scss:1). The chat prose frame row in .cursor/docs/design-system.md:678 still names it.
  • None of the 12 CHAT_OPEN publishers sets insertContent. The chat-open subscriber only forwards the field (apps/webapp/src/services/eventsHub.ts:56, :75). So insertChatComposerContentWithRetry (apps/webapp/src/services/openHeadingChatroom.ts:62-78), its call (:163), and the insertContent field are dead. The field sits on the chat open payload (apps/webapp/src/services/eventsHub.ts:24), OpenHeadingChatroomParams (openHeadingChatroom.ts:112), and OpenHeadingChatBrowseParams (:176).

Keep

  • The statics MessageComposer.EditorContent, MessageComposer.ComposerLayout, MessageComposer.ComposerDesktopLayout, and MessageComposer.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.md no longer names .chat_msg_container.
  • bun run typecheck, bun run lint, and bun run lint:styles pass.
  • 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 MessageComposer and ChannelComposer statics.
  • The MessageComposer and ChannelComposer barrel files.
  • insertChatComposerContentWithRetry().
  • The insertContent field on the chat open payload, OpenHeadingChatroomParams, and OpenHeadingChatBrowseParams.

Out of scope

  • The parked GifPickerButton and MediaFilterToggle.
  • The SignInToJoinChannel component. 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

  1. added a commit that references this issue on Sep 21, 2026
    f79cde0
  2. added a commit that references this issue on Sep 22, 2026
    6e59004
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions