Skip to content
Source
Sign inSign up

FreshSessionNotice.tsx

20 lines799 Bytes

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