Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

FreshSessionNotice.tsx

24 lines895 Bytes

1import { useGT } from "gt-react-native";
2import { View } from "react-native";
3​
4import { Notice } from "../../components/ui/Notice";
5import { setFreshSessionPending, useComposerDraftSettings } from "../../state/use-composer-drafts";
6​
7/** Shown while `/clear` is armed; dismissing it keeps the current session. */
8export function FreshSessionNotice(props: { readonly threadKey: string }) {
9 const gt = useGT();
10 if (useComposerDraftSettings(props.threadKey).freshContext !== true) return null;
11 return (
12 <View className="px-4 pb-3">
13 <Notice
14 message={gt(
15 "Your next message starts a fresh session. The agent won't see earlier messages in this thread.",
16 )}
17 icon="arrow.clockwise"
18 floating
19 onDismiss={() => setFreshSessionPending(props.threadKey, false)}
20 dismissLabel={gt("Keep the current session")}
21 />
22 </View>
23 );