Confirmation Dialogs
Actions that delete data or cannot be undone always ask first. Instead of the browser's plain prompt, ThesisLock shows a single, consistent dialog that names what is about to happen and asks you to confirm, so an accidental click never quietly throws work away.
What asks for confirmation
- Deleting a collection, or revoking an API key.
- Removing a member from a group, or removing a watchlist item.
- Clearing data: the audit log, notifications, search and request history, performance data, and the Clear All Data action in settings.
- Anchoring a large batch, which needs several wallet signatures.
- Leaving a page that has staged but unsaved work.
How a dialog signals risk
Each dialog uses one of three variants. danger (a red confirm button) marks irreversible deletions, warning (amber) marks clearing or removing data, and info (blue) marks actions that are merely worth a second look. Only info dialogs can be dismissed by clicking outside; the rest require an explicit choice.
The most destructive actions, such as Clear All Data and deleting a collection, also ask you to type a word like DELETE before the confirm button turns on, so they can never be triggered by a single stray click.
Leaving with unsaved work
If you have added files on the anchor page but not yet anchored them, or generated a report you have not downloaded, ThesisLock warns you before you navigate away, both for in-app links and for closing or reloading the tab.
For contributors
Confirmations are driven by a promise-based useConfirm hook backed by a single ConfirmProvider in the app layout. Any client component can request one without rendering a dialog or threading open and close state through props.
const confirm = useConfirm();
async function onDelete() {
const ok = await confirm({
title: "Delete collection",
message: "Delete this collection? This cannot be undone.",
confirmLabel: "Delete",
variant: "danger",
requireType: "DELETE",
});
if (!ok) return;
// ...perform the irreversible action
}To warn on navigation away from unsaved work, the useUnsavedChanges hook takes a boolean and a message and handles both the browser prompt and in-app link clicks for you.