fix(backtest): preserve creation work during strategy inspection (RP14)

This commit is contained in:
Boki 2026-10-27 15:17:40 -04:00
parent cf04fb36d0
commit 0d022ecc2e
3 changed files with 309 additions and 6 deletions

View file

@ -124,7 +124,28 @@ export function CreateBacktestDialog({
};
return (
<div className="fixed inset-0 bg-black/50 flex items-center justify-center z-50">
<div
className="fixed inset-0 bg-black/50 flex items-center justify-center z-50"
onClickCapture={event => {
const link = (event.target as Element).closest<HTMLAnchorElement>('a[href]');
if (
!link ||
event.defaultPrevented ||
event.button !== 0 ||
event.ctrlKey ||
event.metaKey ||
event.shiftKey ||
event.altKey ||
(link.target && link.target !== '_self')
) {
return;
}
if (pending.current || !confirmDiscard(edited)) {
event.preventDefault();
event.stopPropagation();
}
}}
>
<div className="bg-surface-secondary rounded-lg p-6 w-full max-w-2xl max-h-[90vh] overflow-y-auto">
<div className="flex justify-between items-center mb-6">
<h2 className="text-lg font-bold text-text-primary">Create New Backtest</h2>