feat(ui): composer formatting toolbar - bold/italic/code/link (LC-254) #305
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-254-composer-format-toolbar"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Adds a Markdown formatting toolbar above the composer textarea (LC-254). Bold, Italic, Code, and Link buttons help users who do not know Markdown format their messages.
Ctrl/Cmd+BandCtrl/Cmd+Imirror the Bold/Italic buttons.How
server/templates/room/composer.html: a small toolbar row (type="button"buttons,data-lc-fmt="bold|italic|code|link") above the input row, reusing the existing muted-button styling. A new IIFE wraps the selection (or a localized placeholder) in the right Markdown and re-selects the inner text; Link is special-cased to[text](url)withurlselected. Bold**, Italic*, Code backtick.inputevent, so the auto-resize (LC-229), draft autosave (LC-64), and send-enable (__lcRefreshSend) all run, identical to the mention/slash insert path. The IIFE shares#composeras cleanup-root and removes its listeners on form swap.Ctrl/Cmd+B/Ctrl/Cmd+Ikeydown on the textarea (ignored during IME composition / with Alt; never submits). The mention/slash capture-phase handlers onlystopPropagationfor Arrow/Enter/Tab/Escape, so they never swallow these.Pure front-end: the body is already rendered as Markdown server-side. No route, DB, or env change. Not operator-visible.
Tests
routes_drafts::room_page_ships_formatting_toolbarasserts the room page ships the toolbar buttons and handler.just testandjust test-saaspass.QA note
The wrap/link transforms, selection handling, and
Ctrl/Cmd+B/Iare JS-driven, so they want a quick manual click-through before merge: select text and click each button; click with no selection (placeholder inserted + selected); confirm Link selectsurl; confirm the send button enables and the box resizes after an action; confirmCtrl+B/Ctrl+Iapply without submitting.