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.
32 lines
847 B
TypeScript
32 lines
847 B
TypeScript
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',
|
|
},
|
|
});
|