History

Prompt before reverting thread checkpoint

- Add a confirmation dialog before checkpoint revert - Warn that newer messages and turn diffs will be discarded - Cancel revert when the user does not confirm

Julius Marminge committed 9 months ago

Commit d35ca861 parent 72158ca1 file · +10 −0Browse files

Showing the changes to apps (1 of 1 file). Show all

Unified · Split

apps/web/src/components/ChatView.tsx+10−0
@@ -1533,6 +1533,16 @@ export default function ChatView() { · 1532 unmodified lines
1533 setThreadError(activeThread.id, "Interrupt the current turn before reverting checkpoints.");1533 setThreadError(activeThread.id, "Interrupt the current turn before reverting checkpoints.");
1534 return;1534 return;
1535 }1535 }
1536 const confirmed = await api.dialogs.confirm(
1537 [
1538 `Revert this thread to checkpoint ${turnCount}?`,
1539 "This will discard newer messages and turn diffs in this thread.",
1540 "This action cannot be undone.",
1541 ].join("\n"),
1542 );
1543 if (!confirmed) {
1544 return;
1545 }
1536 1546
1537 setIsRevertingCheckpoint(true);1547 setIsRevertingCheckpoint(true);
1538 setThreadError(activeThread.id, null);1548 setThreadError(activeThread.id, null);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t