refactor(chat): split ChatScreen and reuse regenerateResponse after editing a message

The edit path duplicated the streaming flow with inline require() calls; it now reuses regenerateResponse, which also fixes:
- edited conversations were never saved to History
- the answer generated after an edit could not be stopped (no abort handle kept)
Stopping a stream now saves the partial conversation, like finishing or failing does.
Adds characterization tests for ChatScreen and useLMStudio.
This commit is contained in:
evandro committed 2026-10-10 04:16:29 -03:00
1 parent 808cb1610b
commit cb6eda0562
8 files changed
+678 -176

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
import { useThemeColor } from '@/hooks/useThemeColor';
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
export function OfflineBanner() {
const colors = useThemeColor();
return (
<View
accessibilityRole="alert"
style={[styles.banner, { backgroundColor: colors.bannerBg, borderBottomColor: colors.bannerBg }]}
>
<Text style={[styles.bannerText, { color: colors.bannerText }]}>
⚠️ Server offline. Check Settings → Server Connection.
</Text>
</View>
);
}
const styles = StyleSheet.create({
banner: {
paddingHorizontal: 16,
paddingVertical: 10,
borderBottomWidth: 1,
},
bannerText: {
fontSize: 13,
textAlign: 'center',
fontWeight: '500',
},
});