Skip to content

Show the active state of the composer's Inline code button #282

Description

@HMarzban

Problem

The composer's Inline code button never shows its active state.

On 14ab7f9c1:

  • CodeButton passes type="code" to the composer ToolbarButton (apps/webapp/src/components/chatroom/components/MessageComposer/components/Toolbar/ToolbarButtons/CodeButton.tsx:19).
  • The button checks editor.isActive(type) (apps/webapp/src/components/chatroom/components/MessageComposer/components/ui/Button.tsx:39).
  • The composer turns off the StarterKit code mark (apps/webapp/src/components/chatroom/components/MessageComposer/hooks/useTiptapEditor.ts:128). It uses InlineCode instead, whose mark name is inlineCode (extensions/extension-inline-code/src/inline-code.ts:27).

So editor.isActive('code') is always false. On desktop, the Bold button works, because its type matches its mark name. On a phone, the grid's active states are stale for a separate reason, tracked in #269.

Steps to reproduce

  1. On desktop, open a channel.
  2. Open the insert menu (the + button) and choose Text formatting.
  3. Type a word, select it, and choose Inline code.
  4. See the word styled as inline code, and the Inline code button not in its active state.

Acceptance criteria

  • On desktop, with the caret or the selection inside inline code, the Inline code button shows its active state.
  • On desktop, with the caret or the selection outside inline code, it does not.

Agent Brief

Category: bug
Summary: The Inline code button must check the composer's real inline code mark name.

Current behavior:
The Inline code button asks for a mark named code, which the composer does not register.

Desired behavior:
The Inline code button asks for the inlineCode mark. On desktop, its active state then follows the selection. On a phone, it follows once #269 lands.

Key interfaces:

  • CodeButton — passes the mark name.
  • The composer ToolbarButton — checks editor.isActive().
  • InlineCode from the inline code extension — mark name inlineCode.

Out of scope

Notes

A scratch harness on 14ab7f9c1 used the composer's StarterKit options, InlineCode, a code block, and Hyperlink. code is not in that schema. For a selection inside inline code, and for a caret inside it, isActive('code') was false and isActive('inlineCode') was true. The steps above were not run in a browser.

Activity

  1. EthemKD commented on Sep 14, 2026

    @EthemKD

    I'd like to take this. I'll keep it scoped to the composer's inline-code active state: update CodeButton to check the actual inlineCode mark, preserve the separate #271 prop-rename scope, and add/adjust focused coverage for caret and selection state on desktop.

  2. added a commit that references this issue on Sep 22, 2026
    7570f5d
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

    ChatRelated to chat featuresUIbugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions