The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { useGT } from "gt-react-native"; |
| 2 | import { View } from "react-native"; |
| 3 | |
| 4 | import { Notice } from "../../components/ui/Notice"; |
| 5 | import { setFreshSessionPending, useComposerDraftSettings } from "../../state/use-composer-drafts"; |
| 6 | |
| 7 | /** Shown while `/clear` is armed; dismissing it keeps the current session. */ |
| 8 | export 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 | ); |
| 24 | } |