@tduncan / Cortana / commits / 34608c3

feat: add tab persistence in chat settings and fixes #13

abdulmominsakib committed May 27, 2026 at 08:56 UTC 34608c3bfe0ce1cae77d65f8eb337c09f0c64af6
2 files changed +15 -2
lib/features/chat/views/components/chat_settings_sheet.dart
+9 -1
@@ -19,6 +19,13 @@ class ChatSettingsSheet extends ConsumerStatefulWidget {
19 class _ChatSettingsSheetState extends ConsumerState<ChatSettingsSheet> {
20 final _serverLabelController = TextEditingController();
21 final _serverUrlController = TextEditingController();
22 + late String _currentTab;
23 +
24 + @override
25 + void initState() {
26 + super.initState();
27 + _currentTab = widget.initialTab;
28 + }
29
30 @override
31 void dispose() {
@@ -101,7 +108,8 @@ class _ChatSettingsSheetState extends ConsumerState<ChatSettingsSheet> {
108 ),
109 const SizedBox(height: 20),
110 ShadTabs<String>(
104 - value: widget.initialTab,
111 + value: _currentTab,
112 + onChanged: (v) => setState(() => _currentTab = v),
113 tabs: [
114 ShadTab(
115 value: 'parameters',
lib/features/servers/data/server_api_service.dart
+6 -1
@@ -327,7 +327,12 @@ class ServerApiService {
327 final List<ModelInfo> models = [];
328 if (data['data'] != null) {
329 for (final item in data['data']) {
330 - if (item['architecture']?['modality'] == 'text->text') {
330 + final modality = item['architecture']?['modality'] as String?;
331 + final isTextModel = modality == null ||
332 + modality.isEmpty ||
333 + !modality.contains('->') ||
334 + modality.split('->').last.contains('text');
335 + if (isTextModel) {
336 models.add(
337 ModelInfo(
338 id: item['id'] ?? '',