refactor: simplify chat input and drawer layout

This commit is contained in:
cogwheel0
2025-08-24 21:41:18 +05:30
parent 5bc67b7287
commit e1ee94f2f3
2 changed files with 323 additions and 332 deletions

View File

@@ -217,9 +217,6 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
// Main input area with unified 2-row design
Container(
clipBehavior: Clip.antiAlias,
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).padding.bottom,
),
decoration: BoxDecoration(
color: context.conduitTheme.inputBackground,
borderRadius: const BorderRadius.vertical(
@@ -243,14 +240,16 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
boxShadow: ConduitShadows.input,
),
width: double.infinity,
child: SafeArea(
top: false,
child: ConstrainedBox(
constraints: BoxConstraints(
// cap the input area to 40% of screen height to avoid bottom overflow
maxHeight: MediaQuery.of(context).size.height * 0.4,
),
child: AnimatedSize(
duration:
AnimationDuration.fast, // Faster for better responsiveness
duration: AnimationDuration
.fast, // Faster for better responsiveness
curve: Curves.fastOutSlowIn, // More efficient curve
alignment: Alignment.topCenter,
child: SingleChildScrollView(
@@ -307,8 +306,9 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
context,
)!.messageHintText,
hintStyle: TextStyle(
color:
context.conduitTheme.inputPlaceholder,
color: context
.conduitTheme
.inputPlaceholder,
fontSize: AppTypography.bodyLarge,
fontWeight: _isRecording
? FontWeight.w500
@@ -444,7 +444,9 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
onTap: widget.enabled
? _showUnifiedToolsModal
: null,
tooltip: AppLocalizations.of(context)!.tools,
tooltip: AppLocalizations.of(
context,
)!.tools,
isActive:
ref
.watch(selectedToolIdsProvider)
@@ -484,6 +486,7 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
),
),
),
),
],
),
);

View File

@@ -65,8 +65,7 @@ class _ChatsDrawerState extends ConsumerState<ChatsDrawer> {
// Bottom section now only shows navigation actions
final theme = context.conduitTheme;
return SafeArea(
child: Container(
return Container(
color: theme.surfaceBackground,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -101,7 +100,6 @@ class _ChatsDrawerState extends ConsumerState<ChatsDrawer> {
_buildBottomSection(context),
],
),
),
);
}
@@ -1118,15 +1116,8 @@ class _ChatsDrawerState extends ConsumerState<ChatsDrawer> {
Widget _buildBottomSection(BuildContext context) {
final theme = context.conduitTheme;
final user = ref.watch(authUserProvider);
return SafeArea(
top: false,
child: Padding(
padding: const EdgeInsets.fromLTRB(
Spacing.sm,
0,
Spacing.sm,
Spacing.sm,
),
return Padding(
padding: const EdgeInsets.fromLTRB(Spacing.sm, 0, Spacing.sm, Spacing.sm),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
@@ -1190,9 +1181,7 @@ class _ChatsDrawerState extends ConsumerState<ChatsDrawer> {
onPressed: () {
Navigator.of(context).maybePop();
Navigator.of(context).push(
MaterialPageRoute(
builder: (_) => const ProfilePage(),
),
MaterialPageRoute(builder: (_) => const ProfilePage()),
);
},
child: Text(AppLocalizations.of(context)!.manage),
@@ -1203,7 +1192,6 @@ class _ChatsDrawerState extends ConsumerState<ChatsDrawer> {
],
],
),
),
);
}