feat(ui): Improve text overflow and spacing in chat drawer

This commit is contained in:
cogwheel0
2025-11-28 14:59:38 +05:30
parent e15ce5b7b6
commit 98ae65d08f
3 changed files with 220 additions and 198 deletions

View File

@@ -29,6 +29,7 @@ import '../../../core/models/folder.dart';
import '../../../core/persistence/persistence_keys.dart';
import '../../../core/persistence/hive_boxes.dart';
import 'package:hive_ce/hive.dart';
import '../../../shared/widgets/middle_ellipsis_text.dart';
/// Defines the section types that can be collapsed in the chats drawer
enum _SectionType { pinned, recent }
@@ -418,17 +419,19 @@ class _ChatsDrawerState extends ConsumerState<ChatsDrawer> {
modelsById: modelsById,
),
);
out.add(
const SliverToBoxAdapter(
child: SizedBox(height: Spacing.sm),
),
);
} else {
// Only add spacing after collapsed folders
out.add(
const SliverToBoxAdapter(
child: SizedBox(height: Spacing.xs),
),
);
}
out.add(
const SliverToBoxAdapter(
child: SizedBox(height: Spacing.xs),
),
);
}
return out.isEmpty
? <Widget>[
@@ -665,6 +668,13 @@ class _ChatsDrawerState extends ConsumerState<ChatsDrawer> {
child: SizedBox(height: Spacing.sm),
),
);
} else {
// Only add spacing after collapsed folders
out.add(
const SliverToBoxAdapter(
child: SizedBox(height: Spacing.xs),
),
);
}
}
return out.isEmpty
@@ -1903,11 +1913,10 @@ class _ConversationTileContent extends StatelessWidget {
],
Flexible(
fit: textFit,
child: Text(
child: MiddleEllipsisText(
title,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: textStyle,
semanticsLabel: title,
),
),
...trailing,