refactor: chats drawer ui/ux tweaks

This commit is contained in:
cogwheel0
2025-09-07 18:51:52 +05:30
parent 9f3f02a27e
commit 57ed851753

View File

@@ -79,6 +79,7 @@ class _ChatsDrawerState extends ConsumerState<ChatsDrawer> {
if (Platform.isIOS) { if (Platform.isIOS) {
// Use Cupertino-style pull-to-refresh on iOS // Use Cupertino-style pull-to-refresh on iOS
final scroll = CustomScrollView( final scroll = CustomScrollView(
key: const PageStorageKey<String>('chats_drawer_scroll'),
controller: _listController, controller: _listController,
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
slivers: [ slivers: [
@@ -100,6 +101,7 @@ class _ChatsDrawerState extends ConsumerState<ChatsDrawer> {
child: Scrollbar( child: Scrollbar(
controller: _listController, controller: _listController,
child: ListView( child: ListView(
key: const PageStorageKey<String>('chats_drawer_scroll'),
controller: _listController, controller: _listController,
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
padding: padding, padding: padding,
@@ -1604,14 +1606,19 @@ class _ConversationTile extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final theme = context.conduitTheme; final theme = context.conduitTheme;
return Material( final Color selectedBackground =
color: Colors.transparent, theme.buttonPrimary.withValues(alpha: 0.10); // subtle highlight
final Color selectedBorder = theme.buttonPrimary.withValues(alpha: 0.60);
return Semantics(
selected: selected,
button: true,
child: Material(
color: selected ? selectedBackground : Colors.transparent,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppBorderRadius.md), borderRadius: BorderRadius.circular(AppBorderRadius.md),
side: BorderSide( side: BorderSide(
color: selected color: selected ? selectedBorder : theme.dividerColor,
? theme.buttonPrimary.withValues(alpha: 0.5)
: theme.dividerColor,
width: BorderWidth.regular, width: BorderWidth.regular,
), ),
), ),
@@ -1619,7 +1626,28 @@ class _ConversationTile extends StatelessWidget {
borderRadius: BorderRadius.circular(AppBorderRadius.md), borderRadius: BorderRadius.circular(AppBorderRadius.md),
onTap: isLoading ? null : onTap, onTap: isLoading ? null : onTap,
onLongPress: onLongPress, onLongPress: onLongPress,
child: Padding( child: Stack(
children: [
// Left accent bar for active conversation
AnimatedPositioned(
duration: const Duration(milliseconds: 160),
curve: Curves.easeOut,
left: 0,
top: 0,
bottom: 0,
child: AnimatedContainer(
duration: const Duration(milliseconds: 160),
width: selected ? 3.0 : 0.0,
decoration: BoxDecoration(
color: theme.buttonPrimary,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(AppBorderRadius.md),
bottomLeft: Radius.circular(AppBorderRadius.md),
),
),
),
),
Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: Spacing.md, horizontal: Spacing.md,
vertical: Spacing.sm, vertical: Spacing.sm,
@@ -1633,7 +1661,8 @@ class _ConversationTile extends StatelessWidget {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: AppTypography.standard.copyWith( style: AppTypography.standard.copyWith(
color: theme.textPrimary, color: theme.textPrimary,
fontWeight: selected ? FontWeight.w600 : FontWeight.w500, fontWeight:
selected ? FontWeight.w700 : FontWeight.w500,
), ),
), ),
), ),
@@ -1670,6 +1699,9 @@ class _ConversationTile extends StatelessWidget {
], ],
), ),
), ),
],
),
),
), ),
); );
} }