refactor: Remove deprecated code and unused comments
This commit is contained in:
@@ -2242,11 +2242,7 @@ class _ChatPageState extends ConsumerState<ChatPage> {
|
|||||||
isDestructive: true,
|
isDestructive: true,
|
||||||
).then((confirmed) async {
|
).then((confirmed) async {
|
||||||
if (confirmed == true) {
|
if (confirmed == true) {
|
||||||
// for (final selectedMessage in selectedMessages) {
|
|
||||||
// ref.read(chatMessagesProvider.notifier).removeMessage(selectedMessage.id);
|
|
||||||
// }
|
|
||||||
_clearSelection();
|
_clearSelection();
|
||||||
if (mounted) {}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -2762,7 +2758,6 @@ class _VoiceInputSheetState extends ConsumerState<_VoiceInputSheet> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
_isListening = false;
|
_isListening = false;
|
||||||
});
|
});
|
||||||
if (mounted) {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1181,8 +1181,6 @@ class _AssistantMessageWidgetState extends ConsumerState<AssistantMessageWidget>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: old in-content version switcher replaced by inline controls with action buttons.
|
|
||||||
|
|
||||||
Widget _buildActionButtons() {
|
Widget _buildActionButtons() {
|
||||||
final l10n = AppLocalizations.of(context)!;
|
final l10n = AppLocalizations.of(context)!;
|
||||||
final ttsState = ref.watch(textToSpeechControllerProvider);
|
final ttsState = ref.watch(textToSpeechControllerProvider);
|
||||||
@@ -2292,62 +2290,6 @@ class CodeExecutionListView extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Legacy CitationListView - replaced with OpenWebUISourcesWidget
|
|
||||||
// Keeping for reference, can be removed after testing
|
|
||||||
/*
|
|
||||||
class CitationListView extends StatelessWidget {
|
|
||||||
const CitationListView({super.key, required this.sources});
|
|
||||||
|
|
||||||
final List<ChatSourceReference> sources;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final theme = context.conduitTheme;
|
|
||||||
if (sources.isEmpty) {
|
|
||||||
return const SizedBox.shrink();
|
|
||||||
}
|
|
||||||
|
|
||||||
return Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
sources.length == 1 ? 'Source' : 'Sources',
|
|
||||||
style: TextStyle(
|
|
||||||
color: theme.textPrimary,
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
fontSize: AppTypography.bodyLarge,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: Spacing.xs),
|
|
||||||
...sources.map((source) {
|
|
||||||
final title = source.title?.isNotEmpty == true
|
|
||||||
? source.title!
|
|
||||||
: source.url ?? 'Citation';
|
|
||||||
final subtitle = source.snippet?.isNotEmpty == true
|
|
||||||
? source.snippet!
|
|
||||||
: source.url;
|
|
||||||
|
|
||||||
return Card(
|
|
||||||
margin: const EdgeInsets.only(bottom: Spacing.xs),
|
|
||||||
color: theme.surfaceContainer,
|
|
||||||
child: ListTile(
|
|
||||||
onTap: source.url != null ? () => _launchUri(source.url!) : null,
|
|
||||||
title: Text(title, style: TextStyle(color: theme.textPrimary)),
|
|
||||||
subtitle: subtitle != null
|
|
||||||
? Text(subtitle, style: TextStyle(color: theme.textSecondary))
|
|
||||||
: null,
|
|
||||||
trailing: source.url != null
|
|
||||||
? const Icon(Icons.open_in_new, size: 18)
|
|
||||||
: null,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
class FollowUpSuggestionBar extends StatelessWidget {
|
class FollowUpSuggestionBar extends StatelessWidget {
|
||||||
const FollowUpSuggestionBar({
|
const FollowUpSuggestionBar({
|
||||||
super.key,
|
super.key,
|
||||||
|
|||||||
@@ -102,12 +102,9 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
|
|||||||
final FocusNode _focusNode = FocusNode();
|
final FocusNode _focusNode = FocusNode();
|
||||||
bool _pendingFocus = false;
|
bool _pendingFocus = false;
|
||||||
bool _isRecording = false;
|
bool _isRecording = false;
|
||||||
// final String _voiceInputText = '';
|
|
||||||
bool _hasText = false; // track locally without rebuilding on each keystroke
|
bool _hasText = false; // track locally without rebuilding on each keystroke
|
||||||
StreamSubscription<String>? _voiceStreamSubscription;
|
StreamSubscription<String>? _voiceStreamSubscription;
|
||||||
late VoiceInputService _voiceService;
|
late VoiceInputService _voiceService;
|
||||||
StreamSubscription<int>?
|
|
||||||
_intensitySub; // removed usage; will be cleaned fully
|
|
||||||
StreamSubscription<String>? _textSub;
|
StreamSubscription<String>? _textSub;
|
||||||
String _baseTextAtStart = '';
|
String _baseTextAtStart = '';
|
||||||
bool _isDeactivated = false;
|
bool _isDeactivated = false;
|
||||||
@@ -167,7 +164,6 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
|
|||||||
_focusNode.dispose();
|
_focusNode.dispose();
|
||||||
_pendingFocus = false;
|
_pendingFocus = false;
|
||||||
_voiceStreamSubscription?.cancel();
|
_voiceStreamSubscription?.cancel();
|
||||||
_intensitySub?.cancel();
|
|
||||||
_textSub?.cancel();
|
_textSub?.cancel();
|
||||||
_voiceService.stopListening();
|
_voiceService.stopListening();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
@@ -2949,8 +2945,6 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
|
|||||||
_isRecording = true;
|
_isRecording = true;
|
||||||
_baseTextAtStart = _controller.text;
|
_baseTextAtStart = _controller.text;
|
||||||
});
|
});
|
||||||
_intensitySub?.cancel();
|
|
||||||
// intensity stream no longer used for UI; stop listening
|
|
||||||
_textSub?.cancel();
|
_textSub?.cancel();
|
||||||
_textSub = stream.listen(
|
_textSub = stream.listen(
|
||||||
(text) async {
|
(text) async {
|
||||||
@@ -2965,14 +2959,10 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
|
|||||||
onDone: () {
|
onDone: () {
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
setState(() => _isRecording = false);
|
setState(() => _isRecording = false);
|
||||||
_intensitySub?.cancel();
|
|
||||||
_intensitySub = null;
|
|
||||||
},
|
},
|
||||||
onError: (_) {
|
onError: (_) {
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
setState(() => _isRecording = false);
|
setState(() => _isRecording = false);
|
||||||
_intensitySub?.cancel();
|
|
||||||
_intensitySub = null;
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
_ensureFocusedIfEnabled();
|
_ensureFocusedIfEnabled();
|
||||||
@@ -2987,8 +2977,6 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _stopVoice() async {
|
Future<void> _stopVoice() async {
|
||||||
_intensitySub?.cancel();
|
|
||||||
_intensitySub = null;
|
|
||||||
await _voiceService.stopListening();
|
await _voiceService.stopListening();
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
setState(() => _isRecording = false);
|
setState(() => _isRecording = false);
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import '../../../core/providers/app_providers.dart';
|
|||||||
import '../../auth/providers/unified_auth_providers.dart';
|
import '../../auth/providers/unified_auth_providers.dart';
|
||||||
import '../../../shared/theme/theme_extensions.dart';
|
import '../../../shared/theme/theme_extensions.dart';
|
||||||
import '../../chat/providers/chat_providers.dart' as chat;
|
import '../../chat/providers/chat_providers.dart' as chat;
|
||||||
// import '../../files/views/files_page.dart';
|
|
||||||
import '../../../core/utils/debug_logger.dart';
|
import '../../../core/utils/debug_logger.dart';
|
||||||
import '../../../core/services/navigation_service.dart';
|
import '../../../core/services/navigation_service.dart';
|
||||||
import '../../../shared/widgets/themed_dialogs.dart';
|
import '../../../shared/widgets/themed_dialogs.dart';
|
||||||
@@ -156,12 +155,6 @@ class _ChatsDrawerState extends ConsumerState<ChatsDrawer> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Payload for drag-and-drop of conversations
|
|
||||||
// Kept local to this widget
|
|
||||||
// ignore: unused_element
|
|
||||||
static _DragConversationData _dragData(String id, String title) =>
|
|
||||||
_DragConversationData(id: id, title: title);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// Bottom section now only shows navigation actions
|
// Bottom section now only shows navigation actions
|
||||||
@@ -1141,7 +1134,7 @@ class _ChatsDrawerState extends ConsumerState<ChatsDrawer> {
|
|||||||
String? _conversationId(dynamic item) {
|
String? _conversationId(dynamic item) {
|
||||||
if (item is Conversation) return item.id;
|
if (item is Conversation) return item.id;
|
||||||
try {
|
try {
|
||||||
final value = (item as dynamic).id;
|
final value = item.id;
|
||||||
if (value is String) {
|
if (value is String) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user