fix: create conversations with empty title so server auto-names them
The app was creating conversations with title 'New conversation'. The server only generates a title when conv_title is falsy (empty). With a non-empty title, should_gen_title is False for the first message (msg_count % 10 != 0), so auto-naming never fired. Now creates with empty title (matching web app behaviour). The list still displays 'New conversation' as a UI placeholder until the server-generated title arrives. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -23,7 +23,7 @@ class ConversationsTabScreen extends ConsumerWidget {
|
|||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
final conv = await ref
|
final conv = await ref
|
||||||
.read(conversationsProvider.notifier)
|
.read(conversationsProvider.notifier)
|
||||||
.create('New conversation');
|
.create('');
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
context.push(Routes.chat.replaceFirst(':id', '${conv.id}'));
|
context.push(Routes.chat.replaceFirst(':id', '${conv.id}'));
|
||||||
}
|
}
|
||||||
@@ -52,7 +52,7 @@ class ConversationsTabScreen extends ConsumerWidget {
|
|||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
final conv = await ref
|
final conv = await ref
|
||||||
.read(conversationsProvider.notifier)
|
.read(conversationsProvider.notifier)
|
||||||
.create('New conversation');
|
.create('');
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
context.push(
|
context.push(
|
||||||
Routes.chat.replaceFirst(':id', '${conv.id}'));
|
Routes.chat.replaceFirst(':id', '${conv.id}'));
|
||||||
@@ -71,8 +71,10 @@ class ConversationsTabScreen extends ConsumerWidget {
|
|||||||
final c = convs[i];
|
final c = convs[i];
|
||||||
return ListTile(
|
return ListTile(
|
||||||
leading: const Icon(Icons.chat_bubble_outline),
|
leading: const Icon(Icons.chat_bubble_outline),
|
||||||
title: Text(c.title,
|
title: Text(
|
||||||
maxLines: 1, overflow: TextOverflow.ellipsis),
|
c.title.isEmpty ? 'New conversation' : c.title,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
_relativeTime(c.updatedAt),
|
_relativeTime(c.updatedAt),
|
||||||
style: theme.textTheme.labelSmall,
|
style: theme.textTheme.labelSmall,
|
||||||
|
|||||||
Reference in New Issue
Block a user