@tduncan / Cortana / commits / a24db8b

Restore TTS and model-loading settings removed during merge.

Re-add markdown processing, skip interval, and unload-before-load toggles with their descriptions. Co-authored-by: Cursor <cursoragent@cursor.com>

onlypuppy7 committed Jul 1, 2026 at 14:59 UTC a24db8b2ad85c73de43e7152ea197c542b99ca30
1 file changed +100 -10
lib/features/settings/views/settings_screen.dart
+100 -10
@@ -162,6 +162,20 @@ class SettingsViews extends ConsumerWidget {
162 valueFormat: (value) => '${value.toStringAsFixed(2)}x',
163 ),
164 ],
165 + _ToggleSetting(
166 + label: l10n.tts_process_markdown,
167 + description: l10n.tts_process_markdown_desc,
168 + value: settings.ttsProcessMarkdown,
169 + onChanged: (value) => ref
170 + .read(settingsProvider.notifier)
171 + .setTtsProcessMarkdown(value),
172 + ),
173 + _TtsSkipSecondsSetting(
174 + value: settings.ttsSkipSeconds,
175 + onChanged: (value) => ref
176 + .read(settingsProvider.notifier)
177 + .setTtsSkipSeconds(value),
178 + ),
179 ],
180 );
181
@@ -266,6 +280,13 @@ class SettingsViews extends ConsumerWidget {
280 label: l10n.manage_on_device_models,
281 onPressed: () => context.push(AppRoutes.onDeviceModels),
282 ),
283 + _ToggleSetting(
284 + label: l10n.unload_models_before_load,
285 + value: settings.unloadModelsBeforeLoad,
286 + onChanged: (value) => ref
287 + .read(settingsProvider.notifier)
288 + .setUnloadModelsBeforeLoad(value),
289 + ),
290 const _OnDeviceEngineStatusCard(),
291 ],
292 );
@@ -1083,10 +1104,12 @@ class _ToggleSetting extends StatelessWidget {
1104 required this.label,
1105 required this.value,
1106 required this.onChanged,
1107 + this.description,
1108 this.badges = const [],
1109 });
1110
1111 final String label;
1112 + final String? description;
1113 final bool value;
1114 final ValueChanged<bool> onChanged;
1115 final List<Widget> badges;
@@ -1100,18 +1123,32 @@ class _ToggleSetting extends StatelessWidget {
1123 crossAxisAlignment: CrossAxisAlignment.center,
1124 children: [
1125 Expanded(
1103 - child: Wrap(
1104 - spacing: 8,
1105 - runSpacing: 6,
1106 - crossAxisAlignment: WrapCrossAlignment.center,
1126 + child: Column(
1127 + crossAxisAlignment: CrossAxisAlignment.start,
1128 children: [
1108 - Text(
1109 - label,
1110 - style: theme.textTheme.titleSmall?.copyWith(
1111 - fontWeight: FontWeight.w700,
1112 - ),
1129 + Wrap(
1130 + spacing: 8,
1131 + runSpacing: 6,
1132 + crossAxisAlignment: WrapCrossAlignment.center,
1133 + children: [
1134 + Text(
1135 + label,
1136 + style: theme.textTheme.titleSmall?.copyWith(
1137 + fontWeight: FontWeight.w700,
1138 + ),
1139 + ),
1140 + ...badges,
1141 + ],
1142 ),
1114 - ...badges,
1143 + if (description != null) ...[
1144 + const SizedBox(height: 4),
1145 + Text(
1146 + description!,
1147 + style: theme.textTheme.bodySmall?.copyWith(
1148 + color: theme.colorScheme.onSurfaceVariant,
1149 + ),
1150 + ),
1151 + ],
1152 ],
1153 ),
1154 ),
@@ -1123,6 +1160,59 @@ class _ToggleSetting extends StatelessWidget {
1160 }
1161 }
1162
1163 +class _TtsSkipSecondsSetting extends StatelessWidget {
1164 + const _TtsSkipSecondsSetting({
1165 + required this.value,
1166 + required this.onChanged,
1167 + });
1168 +
1169 + final int value;
1170 + final ValueChanged<int> onChanged;
1171 +
1172 + static const _options = [5, 10, 15, 30];
1173 +
1174 + @override
1175 + Widget build(BuildContext context) {
1176 + final l10n = AppLocalizations.of(context)!;
1177 + final theme = Theme.of(context);
1178 +
1179 + return _SettingPanel(
1180 + child: Column(
1181 + crossAxisAlignment: CrossAxisAlignment.start,
1182 + children: [
1183 + Text(
1184 + l10n.tts_skip_seconds,
1185 + style: theme.textTheme.titleSmall?.copyWith(
1186 + fontWeight: FontWeight.w700,
1187 + ),
1188 + ),
1189 + const SizedBox(height: 4),
1190 + Text(
1191 + l10n.tts_skip_seconds_desc,
1192 + style: theme.textTheme.bodySmall?.copyWith(
1193 + color: theme.colorScheme.onSurfaceVariant,
1194 + ),
1195 + ),
1196 + const SizedBox(height: 10),
1197 + Wrap(
1198 + spacing: 8,
1199 + runSpacing: 8,
1200 + children: _options.map((seconds) {
1201 + final selected = value == seconds;
1202 + return FilterChip(
1203 + label: Text(l10n.tts_skip_seconds_value(seconds)),
1204 + selected: selected,
1205 + onSelected: (_) => onChanged(seconds),
1206 + showCheckmark: false,
1207 + );
1208 + }).toList(),
1209 + ),
1210 + ],
1211 + ),
1212 + );
1213 + }
1214 +}
1215 +
1216 class _FeatureBadge extends StatelessWidget {
1217 const _FeatureBadge({required this.label});
1218