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
- On desktop, open a channel.
- Open the insert menu (the + button) and choose Text formatting.
- Type a word, select it, and choose Inline code.
- See the word styled as inline code, and the Inline code button not in its active state.
Acceptance criteria
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.
Problem
The composer's Inline code button never shows its active state.
On
14ab7f9c1:CodeButtonpassestype="code"to the composerToolbarButton(apps/webapp/src/components/chatroom/components/MessageComposer/components/Toolbar/ToolbarButtons/CodeButton.tsx:19).editor.isActive(type)(apps/webapp/src/components/chatroom/components/MessageComposer/components/ui/Button.tsx:39).codemark (apps/webapp/src/components/chatroom/components/MessageComposer/hooks/useTiptapEditor.ts:128). It usesInlineCodeinstead, whose mark name isinlineCode(extensions/extension-inline-code/src/inline-code.ts:27).So
editor.isActive('code')is always false. On desktop, the Bold button works, because itstypematches its mark name. On a phone, the grid's active states are stale for a separate reason, tracked in #269.Steps to reproduce
Acceptance criteria
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
inlineCodemark. On desktop, its active state then follows the selection. On a phone, it follows once #269 lands.Key interfaces:
CodeButton— passes the mark name.ToolbarButton— checkseditor.isActive().InlineCodefrom the inline code extension — mark nameinlineCode.Out of scope
ToolbarButtontypeprop, tracked in Rename the composer ToolbarButton type prop, and drop two dead send props #271.Notes
A scratch harness on
14ab7f9c1used the composer's StarterKit options,InlineCode, a code block, andHyperlink.codeis not in that schema. For a selection inside inline code, and for a caret inside it,isActive('code')was false andisActive('inlineCode')was true. The steps above were not run in a browser.