feat(chat): Add folder support in new chat screen
This commit is contained in:
@@ -853,6 +853,21 @@ class SelectedModel extends _$SelectedModel {
|
||||
void clear() => state = null;
|
||||
}
|
||||
|
||||
/// Tracks a pending folder ID for the next new conversation.
|
||||
///
|
||||
/// When a user starts a new chat from within a folder context menu,
|
||||
/// this provider holds the folder ID so that the conversation is
|
||||
/// automatically placed in that folder upon creation.
|
||||
@Riverpod(keepAlive: true)
|
||||
class PendingFolderId extends _$PendingFolderId {
|
||||
@override
|
||||
String? build() => null;
|
||||
|
||||
void set(String? folderId) => state = folderId;
|
||||
|
||||
void clear() => state = null;
|
||||
}
|
||||
|
||||
// Track if the current model selection is manual (user-selected) or automatic (default)
|
||||
@Riverpod(keepAlive: true)
|
||||
class IsManualModelSelection extends _$IsManualModelSelection {
|
||||
|
||||
@@ -812,6 +812,7 @@ class ApiService {
|
||||
required List<ChatMessage> messages,
|
||||
String? model,
|
||||
String? systemPrompt,
|
||||
String? folderId,
|
||||
}) async {
|
||||
_traceApi('Creating new conversation on OpenWebUI server');
|
||||
_traceApi('Title: $title, Messages: ${messages.length}');
|
||||
@@ -893,7 +894,7 @@ class ApiService {
|
||||
'tags': [],
|
||||
'timestamp': DateTime.now().millisecondsSinceEpoch,
|
||||
},
|
||||
'folder_id': null,
|
||||
'folder_id': folderId,
|
||||
};
|
||||
|
||||
_traceApi('Sending chat data with proper parent-child structure');
|
||||
|
||||
Reference in New Issue
Block a user