💄 Optimize embedded section of chat input

This commit is contained in:
2025-11-22 20:11:01 +08:00
parent 77b2effb34
commit 78f14f890f
3 changed files with 26 additions and 4 deletions

View File

@@ -1341,5 +1341,6 @@
"unindexedFiles": "Unindexed files", "unindexedFiles": "Unindexed files",
"folder": "Folder", "folder": "Folder",
"clearCompleted": "Clear Completed", "clearCompleted": "Clear Completed",
"contentCantEmpty": "Content cannot be empty" "contentCantEmpty": "Content cannot be empty",
"features": "Features"
} }

View File

@@ -45,6 +45,8 @@ void _insertPlaceholder(TextEditingController controller, String placeholder) {
const kInputDrawerExpandedHeight = 180.0; const kInputDrawerExpandedHeight = 180.0;
const kExpandedSectionTabHeight = 32.0;
class _ExpandedSection extends StatelessWidget { class _ExpandedSection extends StatelessWidget {
final TextEditingController messageController; final TextEditingController messageController;
final SnPoll? selectedPoll; final SnPoll? selectedPoll;
@@ -75,9 +77,23 @@ class _ExpandedSection extends StatelessWidget {
length: 2, length: 2,
child: Column( child: Column(
children: [ children: [
TabBar( PreferredSize(
splashBorderRadius: const BorderRadius.all(Radius.circular(40)), preferredSize: const Size.fromHeight(kExpandedSectionTabHeight),
tabs: [Tab(text: 'Features'), Tab(text: 'Stickers')], child: TabBar(
splashBorderRadius: const BorderRadius.all(
Radius.circular(40),
),
tabs: [
Tab(
text: 'features'.tr(),
height: kExpandedSectionTabHeight,
),
Tab(
text: 'stickers'.tr(),
height: kExpandedSectionTabHeight,
),
],
),
), ),
SizedBox( SizedBox(
height: kInputDrawerExpandedHeight, height: kInputDrawerExpandedHeight,
@@ -248,6 +264,7 @@ class ChatInput extends HookConsumerWidget {
void send() { void send() {
inputFocusNode.requestFocus(); inputFocusNode.requestFocus();
if (isExpanded.value) isExpanded.value = false;
onSend.call(); onSend.call();
} }

View File

@@ -381,6 +381,10 @@ class _EmbeddedPackSwitcherState extends State<_EmbeddedPackSwitcher> {
return Tooltip( return Tooltip(
message: packs[i].name, message: packs[i].name,
child: FilterChip( child: FilterChip(
visualDensity: const VisualDensity(
horizontal: 0,
vertical: -4,
),
label: Text(packs[i].name, overflow: TextOverflow.ellipsis), label: Text(packs[i].name, overflow: TextOverflow.ellipsis),
selected: selected, selected: selected,
onSelected: (_) { onSelected: (_) {