@tduncan / Cortana / commits / 035c01d

Restore persona system-prompt preview and fix create persona save button.

Bring back the visibility toggle on the personas screen and style the bottom save action with proper primary/onPrimary contrast. Co-authored-by: Cursor <cursoragent@cursor.com>

onlypuppy7 committed Jul 1, 2026 at 14:59 UTC 035c01dd19e8960b82961eacf069735890c93358
2 files changed +55 -17
lib/features/personas/views/create_persona_screen.dart
+24 -9
@@ -447,15 +447,30 @@ class _CreatePersonaScreenState extends ConsumerState<CreatePersonaScreen> {
447 ),
448 ],
449 const SizedBox(height: 32),
450 - ElevatedButton(
451 - onPressed: _isSaving ? null : _save,
452 - child: _isSaving
453 - ? const SizedBox(
454 - width: 20,
455 - height: 20,
456 - child: CircularProgressIndicator(strokeWidth: 2),
457 - )
458 - : Text(_isEditing ? l10n.save_changes : l10n.create_persona_button),
450 + SizedBox(
451 + width: double.infinity,
452 + child: FilledButton(
453 + onPressed: _isSaving ? null : _save,
454 + style: FilledButton.styleFrom(
455 + backgroundColor: theme.colorScheme.primary,
456 + foregroundColor: theme.colorScheme.onPrimary,
457 + padding: const EdgeInsets.symmetric(vertical: 14),
458 + ),
459 + child: _isSaving
460 + ? SizedBox(
461 + width: 20,
462 + height: 20,
463 + child: CircularProgressIndicator(
464 + strokeWidth: 2,
465 + color: theme.colorScheme.onPrimary,
466 + ),
467 + )
468 + : Text(
469 + _isEditing
470 + ? l10n.save_changes
471 + : l10n.create_persona_button,
472 + ),
473 + ),
474 ),
475 ],
476 ),
lib/features/personas/views/persona_list_screen.dart
+31 -8
@@ -17,6 +17,7 @@ class PersonaListScreen extends ConsumerWidget {
17 final builtIn = filteredPersonas.where((p) => p.isBuiltIn).toList();
18 final userCreated = filteredPersonas.where((p) => !p.isBuiltIn).toList();
19 final selectedCategory = ref.watch(personaCategoryFilterProvider);
20 + final previewSystemPrompts = ref.watch(personaPreviewSystemPromptsProvider);
21 final theme = Theme.of(context);
22 final isDark = theme.brightness == Brightness.dark;
23 final topPadding = MediaQuery.of(context).padding.top;
@@ -61,6 +62,18 @@ class PersonaListScreen extends ConsumerWidget {
62 color: isDark ? Colors.white : Colors.black,
63 ),
64 ),
65 + const Spacer(),
66 + IconButton(
67 + icon: Icon(
68 + previewSystemPrompts
69 + ? Icons.visibility
70 + : Icons.visibility_outlined,
71 + ),
72 + tooltip: l10n.preview_system_prompts,
73 + onPressed: () => ref
74 + .read(personaPreviewSystemPromptsProvider.notifier)
75 + .toggle(),
76 + ),
77 ],
78 ),
79 ),
@@ -148,6 +161,7 @@ class PersonaListScreen extends ConsumerWidget {
161 persona: p,
162 isDark: isDark,
163 l10n: l10n,
164 + showSystemPrompt: previewSystemPrompts,
165 onLongPress: () => _showActions(
166 context,
167 ref,
@@ -308,6 +322,7 @@ class _PersonaCard extends StatelessWidget {
322 required this.persona,
323 required this.isDark,
324 required this.l10n,
325 + this.showSystemPrompt = false,
326 this.onTap,
327 this.onLongPress,
328 });
@@ -315,6 +330,7 @@ class _PersonaCard extends StatelessWidget {
330 final Persona persona;
331 final bool isDark;
332 final AppLocalizations l10n;
333 + final bool showSystemPrompt;
334 final VoidCallback? onTap;
335 final VoidCallback? onLongPress;
336
@@ -401,19 +417,26 @@ class _PersonaCard extends StatelessWidget {
417 ),
418 const SizedBox(height: 2),
419 Text(
404 - persona.description ??
405 - persona.systemPrompt.substring(
406 - 0,
407 - persona.systemPrompt.length.clamp(0, 60),
408 - ),
420 + showSystemPrompt && persona.isBuiltIn
421 + ? persona.systemPrompt
422 + : (persona.description ??
423 + persona.systemPrompt.substring(
424 + 0,
425 + persona.systemPrompt.length.clamp(0, 60),
426 + )),
427 style: TextStyle(
410 - fontSize: 13,
428 + fontSize: showSystemPrompt && persona.isBuiltIn ? 12 : 13,
429 color: isDark
430 ? const Color(0xFF888888)
431 : const Color(0xFF999999),
432 + fontFamily: showSystemPrompt && persona.isBuiltIn
433 + ? 'monospace'
434 + : null,
435 ),
415 - maxLines: 1,
416 - overflow: TextOverflow.ellipsis,
436 + maxLines: showSystemPrompt && persona.isBuiltIn ? 8 : 1,
437 + overflow: showSystemPrompt && persona.isBuiltIn
438 + ? TextOverflow.fade
439 + : TextOverflow.ellipsis,
440 ),
441 if (persona.category != null) ...[
442 const SizedBox(height: 4),