Still some AI integration issues
This commit is contained in:
@@ -25,6 +25,8 @@ import '../../widgets/typing_dots.dart';
|
||||
import '../../theme/app_surfaces.dart';
|
||||
import '../../utils/snackbar.dart';
|
||||
import '../../utils/subject_suggestions.dart';
|
||||
import '../../widgets/gemini_button.dart';
|
||||
import '../../widgets/gemini_animated_text_field.dart';
|
||||
|
||||
// request metadata options used in task creation/editing dialogs
|
||||
const List<String> _requestTypeOptions = [
|
||||
@@ -584,6 +586,10 @@ class _TasksListScreenState extends ConsumerState<TasksListScreen>
|
||||
context: context,
|
||||
builder: (dialogContext) {
|
||||
bool saving = false;
|
||||
bool titleProcessing = false;
|
||||
bool descProcessing = false;
|
||||
bool titleDeepSeek = false;
|
||||
bool descDeepSeek = false;
|
||||
final officesAsync = ref.watch(officesProvider);
|
||||
return StatefulBuilder(
|
||||
builder: (context, setState) {
|
||||
@@ -595,39 +601,94 @@ class _TasksListScreenState extends ConsumerState<TasksListScreen>
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
TypeAheadFormField<String>(
|
||||
textFieldConfiguration: TextFieldConfiguration(
|
||||
controller: titleController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Task title',
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: GeminiAnimatedBorder(
|
||||
isProcessing: titleProcessing,
|
||||
useDeepSeekColors: titleDeepSeek,
|
||||
child: TypeAheadFormField<String>(
|
||||
textFieldConfiguration: TextFieldConfiguration(
|
||||
controller: titleController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Task title',
|
||||
),
|
||||
enabled: !saving,
|
||||
),
|
||||
suggestionsCallback: (pattern) async {
|
||||
return SubjectSuggestionEngine.suggest(
|
||||
existingSubjects: existingSubjects,
|
||||
query: pattern,
|
||||
limit: 8,
|
||||
);
|
||||
},
|
||||
itemBuilder: (context, suggestion) => ListTile(
|
||||
dense: true,
|
||||
title: Text(suggestion),
|
||||
),
|
||||
onSuggestionSelected: (suggestion) {
|
||||
titleController
|
||||
..text = suggestion
|
||||
..selection = TextSelection.collapsed(
|
||||
offset: suggestion.length,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
enabled: !saving,
|
||||
),
|
||||
suggestionsCallback: (pattern) async {
|
||||
return SubjectSuggestionEngine.suggest(
|
||||
existingSubjects: existingSubjects,
|
||||
query: pattern,
|
||||
limit: 8,
|
||||
);
|
||||
},
|
||||
itemBuilder: (context, suggestion) =>
|
||||
ListTile(dense: true, title: Text(suggestion)),
|
||||
onSuggestionSelected: (suggestion) {
|
||||
titleController
|
||||
..text = suggestion
|
||||
..selection = TextSelection.collapsed(
|
||||
offset: suggestion.length,
|
||||
);
|
||||
},
|
||||
GeminiButton(
|
||||
textController: titleController,
|
||||
onTextUpdated: (updatedText) {
|
||||
setState(() {
|
||||
titleController.text = updatedText;
|
||||
});
|
||||
},
|
||||
onProcessingStateChanged: (isProcessing) {
|
||||
setState(() {
|
||||
titleProcessing = isProcessing;
|
||||
});
|
||||
},
|
||||
onProviderChanged: (isDeepSeek) {
|
||||
setState(() => titleDeepSeek = isDeepSeek);
|
||||
},
|
||||
tooltip: 'Improve task title with Gemini',
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
TextField(
|
||||
controller: descriptionController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Description',
|
||||
),
|
||||
maxLines: 3,
|
||||
enabled: !saving,
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: GeminiAnimatedTextField(
|
||||
controller: descriptionController,
|
||||
labelText: 'Description',
|
||||
maxLines: 3,
|
||||
enabled: !saving,
|
||||
isProcessing: descProcessing,
|
||||
useDeepSeekColors: descDeepSeek,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: GeminiButton(
|
||||
textController: descriptionController,
|
||||
onTextUpdated: (updatedText) {
|
||||
setState(() {
|
||||
descriptionController.text = updatedText;
|
||||
});
|
||||
},
|
||||
onProcessingStateChanged: (isProcessing) {
|
||||
setState(() {
|
||||
descProcessing = isProcessing;
|
||||
});
|
||||
},
|
||||
onProviderChanged: (isDeepSeek) {
|
||||
setState(() => descDeepSeek = isDeepSeek);
|
||||
},
|
||||
tooltip: 'Improve description with Gemini',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
officesAsync.when(
|
||||
|
||||
Reference in New Issue
Block a user