💄 UX Optimizations
This commit is contained in:
@@ -494,7 +494,6 @@ class ChatListScreen extends HookConsumerWidget {
|
|||||||
const Gap(8),
|
const Gap(8),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
floatingActionButton: const FabMenu(),
|
|
||||||
body: ChatListBodyWidget(
|
body: ChatListBodyWidget(
|
||||||
isFloating: false,
|
isFloating: false,
|
||||||
tabController: tabController,
|
tabController: tabController,
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ class RealmListScreen extends HookConsumerWidget {
|
|||||||
const Gap(8),
|
const Gap(8),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
floatingActionButton: const FabMenu(),
|
|
||||||
body: ExtendedRefreshIndicator(
|
body: ExtendedRefreshIndicator(
|
||||||
child: realms.when(
|
child: realms.when(
|
||||||
data:
|
data:
|
||||||
|
|||||||
@@ -332,6 +332,7 @@ class ThoughtScreen extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return AppScaffold(
|
return AppScaffold(
|
||||||
|
isNoBackground: false,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text(currentTopic.value ?? 'aiThought'.tr()),
|
title: Text(currentTopic.value ?? 'aiThought'.tr()),
|
||||||
actions: [
|
actions: [
|
||||||
@@ -367,94 +368,105 @@ class ThoughtScreen extends HookConsumerWidget {
|
|||||||
const Gap(8),
|
const Gap(8),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Center(
|
||||||
children: [
|
child: Container(
|
||||||
Expanded(
|
constraints: BoxConstraints(maxWidth: 640),
|
||||||
child: thoughts.when(
|
child: Column(
|
||||||
data:
|
children: [
|
||||||
(thoughtList) => SuperListView.builder(
|
Expanded(
|
||||||
listController: listController,
|
child: thoughts.when(
|
||||||
controller: scrollController,
|
data:
|
||||||
padding: const EdgeInsets.only(top: 16, bottom: 16),
|
(thoughtList) => SuperListView.builder(
|
||||||
reverse: true,
|
listController: listController,
|
||||||
itemCount:
|
controller: scrollController,
|
||||||
localThoughts.value.length +
|
padding: const EdgeInsets.only(top: 16, bottom: 16),
|
||||||
(isStreaming.value ? 1 : 0),
|
reverse: true,
|
||||||
itemBuilder: (context, index) {
|
itemCount:
|
||||||
if (isStreaming.value && index == 0) {
|
localThoughts.value.length +
|
||||||
return streamingThoughtItem();
|
(isStreaming.value ? 1 : 0),
|
||||||
}
|
itemBuilder: (context, index) {
|
||||||
final thoughtIndex =
|
if (isStreaming.value && index == 0) {
|
||||||
isStreaming.value ? index - 1 : index;
|
return streamingThoughtItem();
|
||||||
final thought = localThoughts.value[thoughtIndex];
|
}
|
||||||
return thoughtItem(thought, thoughtIndex);
|
final thoughtIndex =
|
||||||
},
|
isStreaming.value ? index - 1 : index;
|
||||||
),
|
final thought = localThoughts.value[thoughtIndex];
|
||||||
loading: () => const Center(child: CircularProgressIndicator()),
|
return thoughtItem(thought, thoughtIndex);
|
||||||
error:
|
},
|
||||||
(error, _) => ResponseErrorWidget(
|
),
|
||||||
error: error,
|
loading:
|
||||||
onRetry:
|
() => const Center(child: CircularProgressIndicator()),
|
||||||
() =>
|
error:
|
||||||
selectedSequenceId.value != null
|
(error, _) => ResponseErrorWidget(
|
||||||
? ref.invalidate(
|
error: error,
|
||||||
thoughtSequenceProvider(
|
onRetry:
|
||||||
selectedSequenceId.value!,
|
() =>
|
||||||
),
|
selectedSequenceId.value != null
|
||||||
)
|
? ref.invalidate(
|
||||||
: null,
|
thoughtSequenceProvider(
|
||||||
),
|
selectedSequenceId.value!,
|
||||||
),
|
),
|
||||||
),
|
)
|
||||||
Container(
|
: null,
|
||||||
margin: EdgeInsets.only(
|
|
||||||
left: 16,
|
|
||||||
right: 16,
|
|
||||||
bottom: 16 + MediaQuery.of(context).padding.bottom,
|
|
||||||
),
|
|
||||||
child: Material(
|
|
||||||
elevation: 2,
|
|
||||||
color: Theme.of(context).colorScheme.surfaceContainerHighest,
|
|
||||||
borderRadius: BorderRadius.circular(32),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 8),
|
|
||||||
child: Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: TextField(
|
|
||||||
controller: messageController,
|
|
||||||
keyboardType: TextInputType.multiline,
|
|
||||||
enabled: !isStreaming.value,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
hintText:
|
|
||||||
isStreaming.value
|
|
||||||
? 'thoughtStreamingHint'.tr()
|
|
||||||
: 'thoughtInputHint'.tr(),
|
|
||||||
border: InputBorder.none,
|
|
||||||
isDense: true,
|
|
||||||
contentPadding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 12,
|
|
||||||
vertical: 12,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
maxLines: 5,
|
|
||||||
minLines: 1,
|
|
||||||
textInputAction: TextInputAction.send,
|
|
||||||
onSubmitted: (_) => sendMessage(),
|
|
||||||
),
|
),
|
||||||
),
|
|
||||||
IconButton(
|
|
||||||
icon: Icon(isStreaming.value ? Symbols.stop : Icons.send),
|
|
||||||
color: Theme.of(context).colorScheme.primary,
|
|
||||||
onPressed: sendMessage,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Container(
|
||||||
|
margin: EdgeInsets.only(
|
||||||
|
left: 16,
|
||||||
|
right: 16,
|
||||||
|
bottom: 16 + MediaQuery.of(context).padding.bottom,
|
||||||
|
),
|
||||||
|
child: Material(
|
||||||
|
elevation: 2,
|
||||||
|
color: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||||
|
borderRadius: BorderRadius.circular(32),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 6,
|
||||||
|
horizontal: 8,
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: TextField(
|
||||||
|
controller: messageController,
|
||||||
|
keyboardType: TextInputType.multiline,
|
||||||
|
enabled: !isStreaming.value,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText:
|
||||||
|
isStreaming.value
|
||||||
|
? 'thoughtStreamingHint'.tr()
|
||||||
|
: 'thoughtInputHint'.tr(),
|
||||||
|
border: InputBorder.none,
|
||||||
|
isDense: true,
|
||||||
|
contentPadding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 12,
|
||||||
|
vertical: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
maxLines: 5,
|
||||||
|
minLines: 1,
|
||||||
|
textInputAction: TextInputAction.send,
|
||||||
|
onSubmitted: (_) => sendMessage(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
icon: Icon(
|
||||||
|
isStreaming.value ? Symbols.stop : Icons.send,
|
||||||
|
),
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
|
onPressed: sendMessage,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user