Checkpoint
A line in the chat that marks a safe point to go back to.
SourcePackage @weft-js/warp
Preview
tsx
import { state } from '@weft-js/core'import { Checkpoint, Stack, Text } from '@weft-js/warp'export function Restore() { const restored = state(false) return ( <Stack gap="related"> <Text>Lowered <code>attempts</code> to 2.</Text> <Checkpoint label="Before the retry change" onRestore={() => (restored.value = true)} /> {restored.value ? <Text subtle>Restored. The chat continues on a new branch from here.</Text> : <Text>Redeployed <code>mobile-bff</code>.</Text>} </Stack> )}Installation
npm install @weft-js/warpUsage
tsx
import { Checkpoint } from '@weft-js/warp'Accessibility
- This has no shortcuts of its own: controls inside it use Tab, Enter and Space as usual, and warp's parts keep their roles and labels.
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
label | unknown | — | What this point is. |
| Event | Type | Default | Description |
|---|---|---|---|
onRestore | (() => void) | — | Adds Restore. |
RelatedBranch switcherConversation