Merge pull request #343 from cogwheel0/fix-chat-input-layout

fix(chat): chat input layout with prompt overlay
This commit is contained in:
cogwheel
2026-01-13 11:54:07 +08:00
committed by GitHub
2 changed files with 33 additions and 21 deletions

View File

@@ -1067,7 +1067,8 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
f.status == FileUploadStatus.uploading || f.status == FileUploadStatus.uploading ||
f.status == FileUploadStatus.pending, f.status == FileUploadStatus.pending,
); );
final allUploadsComplete = attachedFiles.isEmpty || final allUploadsComplete =
attachedFiles.isEmpty ||
attachedFiles.every((f) => f.status == FileUploadStatus.completed); attachedFiles.every((f) => f.status == FileUploadStatus.completed);
final webSearchEnabled = ref.watch(webSearchEnabledProvider); final webSearchEnabled = ref.watch(webSearchEnabledProvider);
@@ -1410,26 +1411,37 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
Spacing.screenPadding, Spacing.screenPadding,
bottomPadding + Spacing.md, bottomPadding + Spacing.md,
), ),
child: Row( child: Column(
crossAxisAlignment: CrossAxisAlignment.end, mainAxisSize: MainAxisSize.min,
children: [ children: [
_buildOverflowButton( // Show prompt overlay above the compact input row when active
tooltip: AppLocalizations.of(context)!.more, if (_showPromptOverlay)
webSearchActive: webSearchEnabled, Padding(
imageGenerationActive: imageGenEnabled, padding: const EdgeInsets.only(bottom: Spacing.xs),
toolsActive: selectedToolIds.isNotEmpty, child: _buildPromptOverlay(context),
filtersActive: selectedFilterIds.isNotEmpty, ),
), Row(
const SizedBox(width: Spacing.sm), crossAxisAlignment: CrossAxisAlignment.end,
Expanded(child: textFieldShell), children: [
const SizedBox(width: Spacing.sm), _buildOverflowButton(
_buildPrimaryButton( tooltip: AppLocalizations.of(context)!.more,
_hasText, webSearchActive: webSearchEnabled,
isGenerating, imageGenerationActive: imageGenEnabled,
stopGeneration, toolsActive: selectedToolIds.isNotEmpty,
voiceAvailable, filtersActive: selectedFilterIds.isNotEmpty,
allUploadsComplete, ),
hasUploadsInProgress, const SizedBox(width: Spacing.sm),
Expanded(child: textFieldShell),
const SizedBox(width: Spacing.sm),
_buildPrimaryButton(
_hasText,
isGenerating,
stopGeneration,
voiceAvailable,
allUploadsComplete,
hasUploadsInProgress,
),
],
), ),
], ],
), ),