@@ -23,6 +23,7 @@ class DesktopPromptInput extends StatefulWidget {
2323 required this .selectedSourcesNotifier,
2424 required this .onUpdateSelectedSources,
2525 this .hideDecoration = false ,
26+ this .hideFormats = false ,
2627 this .extraBottomActionButton,
2728 });
2829
@@ -34,6 +35,7 @@ class DesktopPromptInput extends StatefulWidget {
3435 final ValueNotifier <List <String >> selectedSourcesNotifier;
3536 final void Function (List <String >) onUpdateSelectedSources;
3637 final bool hideDecoration;
38+ final bool hideFormats;
3739 final Widget ? extraBottomActionButton;
3840
3941 @override
@@ -139,11 +141,11 @@ class _DesktopPromptInputState extends State<DesktopPromptInput> {
139141 children: [
140142 ConstrainedBox (
141143 constraints: getTextFieldConstraints (
142- state.showPredefinedFormats,
144+ state.showPredefinedFormats && ! widget.hideFormats ,
143145 ),
144146 child: inputTextField (),
145147 ),
146- if (state.showPredefinedFormats)
148+ if (state.showPredefinedFormats && ! widget.hideFormats )
147149 Positioned .fill (
148150 bottom: null ,
149151 child: TextFieldTapRegion (
@@ -168,8 +170,9 @@ class _DesktopPromptInputState extends State<DesktopPromptInput> {
168170 top: null ,
169171 child: TextFieldTapRegion (
170172 child: _PromptBottomActions (
171- showPredefinedFormats :
173+ showPredefinedFormatBar :
172174 state.showPredefinedFormats,
175+ showPredefinedFormatButton: ! widget.hideFormats,
173176 onTogglePredefinedFormatSection: () =>
174177 context.read <AIPromptInputBloc >().add (
175178 AIPromptInputEvent
@@ -571,7 +574,8 @@ class PromptInputTextField extends StatelessWidget {
571574class _PromptBottomActions extends StatelessWidget {
572575 const _PromptBottomActions ({
573576 required this .sendButtonState,
574- required this .showPredefinedFormats,
577+ required this .showPredefinedFormatBar,
578+ required this .showPredefinedFormatButton,
575579 required this .onTogglePredefinedFormatSection,
576580 required this .onStartMention,
577581 required this .onSendPressed,
@@ -581,7 +585,8 @@ class _PromptBottomActions extends StatelessWidget {
581585 this .extraBottomActionButton,
582586 });
583587
584- final bool showPredefinedFormats;
588+ final bool showPredefinedFormatBar;
589+ final bool showPredefinedFormatButton;
585590 final void Function () onTogglePredefinedFormatSection;
586591 final void Function () onStartMention;
587592 final SendButtonState sendButtonState;
@@ -600,10 +605,12 @@ class _PromptBottomActions extends StatelessWidget {
600605 builder: (context, state) {
601606 return Row (
602607 children: [
603- _predefinedFormatButton (),
604- const HSpace (
605- DesktopAIChatSizes .inputActionBarButtonSpacing,
606- ),
608+ if (showPredefinedFormatButton) ...[
609+ _predefinedFormatButton (),
610+ const HSpace (
611+ DesktopAIChatSizes .inputActionBarButtonSpacing,
612+ ),
613+ ],
607614 SelectModelMenu (
608615 aiModelStateNotifier:
609616 context.read <AIPromptInputBloc >().aiModelStateNotifier,
@@ -641,7 +648,7 @@ class _PromptBottomActions extends StatelessWidget {
641648
642649 Widget _predefinedFormatButton () {
643650 return PromptInputDesktopToggleFormatButton (
644- showFormatBar: showPredefinedFormats ,
651+ showFormatBar: showPredefinedFormatBar ,
645652 onTap: onTogglePredefinedFormatSection,
646653 );
647654 }
0 commit comments