@@ -133,6 +133,7 @@ import {
133133import { attachmentUploadBlockReason } from "../../lib/attachmentUploadState" ;
134134import type { AssistantCitationSourceAnchor } from "~/lib/assistantTextSelection" ;
135135import { shortcutLabelForCommand } from "../../keybindings" ;
136+ import { persistClientSettingsUpdate } from "../../hooks/useSettings" ;
136137import {
137138 type TerminalContextDraft ,
138139 type TerminalContextSelection ,
@@ -198,6 +199,7 @@ import {
198199 ComposerRestingImagePreviews ,
199200} from "./ComposerAttachmentStrip" ;
200201import { ComposerPrimaryActions } from "./ComposerPrimaryActions" ;
202+ import { ComposerRichTextToggle } from "./ComposerRichTextToggle" ;
201203import { ComposerFooterPrimaryActions } from "./ComposerFooterControls" ;
202204import { ComposerPendingUserInputPanel } from "./ComposerPendingUserInputPanel" ;
203205import { ComposerPlanFollowUpBanner } from "./ComposerPlanFollowUpBanner" ;
@@ -304,6 +306,7 @@ export interface ChatComposerHandle {
304306 openModelPicker : ( ) => void ;
305307 stepReasoningEffort : ( direction : 1 | - 1 ) => void ;
306308 toggleModelPicker : ( ) => void ;
309+ toggleRichText : ( ) => void ;
307310 openControl : ( command : KeybindingCommand ) => void ;
308311 isModelPickerOpen : ( ) => boolean ;
309312 isCaretAtStart : ( ) => boolean ;
@@ -2852,6 +2855,13 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
28522855 openModelPickerStable ( ) ;
28532856 }
28542857 } ,
2858+ toggleRichText : ( ) => {
2859+ if ( isLiteralPendingAnswer ) return ;
2860+ persistClientSettingsUpdate ( ( current ) => ( {
2861+ ...current ,
2862+ composerRichTextEnabled : ! current . composerRichTextEnabled ,
2863+ } ) ) . catch ( console . error ) ;
2864+ } ,
28552865 openControl : ( command ) => {
28562866 if ( composerBlurFrameRef . current !== null ) {
28572867 window . cancelAnimationFrame ( composerBlurFrameRef . current ) ;
@@ -3429,7 +3439,23 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
34293439 showMobilePendingAnswerActions && "hidden sm:flex" ,
34303440 ) }
34313441 >
3432- { composerAttachButton ? < div className = "me-2" > { composerAttachButton } </ div > : null }
3442+ { composerAttachButton || ! isLiteralPendingAnswer ? (
3443+ < div className = "me-2 flex items-center gap-0.5" >
3444+ { composerAttachButton }
3445+ { isLiteralPendingAnswer ? null : (
3446+ < ComposerRichTextToggle
3447+ richTextEnabled = { settings . composerRichTextEnabled }
3448+ shortcutLabel = { shortcutLabelForCommand (
3449+ keybindings ,
3450+ "composer.toggleRichText" ,
3451+ {
3452+ context : { terminalFocus : false , terminalOpen, modelPickerOpen : false } ,
3453+ } ,
3454+ ) }
3455+ />
3456+ ) }
3457+ </ div >
3458+ ) : null }
34333459 < div
34343460 data-chat-composer-actions = "right"
34353461 data-chat-composer-transition-actions = "true"
0 commit comments