feat(editor): a clear final state once the engine spent its three recoveries (canvas and action alerts)

This commit is contained in:
bchanot committed 2026-10-15 17:58:11 +02:00
1 parent f0580922b5
commit 0279953e9e
19 files changed
+101 -16

No files matched your search

@@ -20,6 +20,7 @@ import { pickLabel } from '@/i18n/pickLocaleLabel'
import { useT } from '@/i18n/useT'
import { useLocaleStore } from '@/state/localeStore'
import type { Locale } from '@/i18n/types'
import { coreFailureMessage } from '@/core/failure'
export interface ObservationCardProps {
observation: Observation
@@ -168,7 +169,7 @@ export default function ObservationCard({
...(side ? { side } : {}),
})
if (outcome.ok) onChange(outcome.value)
else window.alert(t('core.action_failed'))
else window.alert(coreFailureMessage(t))
}
const removeFinding = (target: Finding) =>
onChange({
@@ -10,6 +10,7 @@ import { useLocaleStore } from '@/state/localeStore'
import { isObservable, type SheetIndex } from '@/services/sheetIndex'
import { pickLabel } from '@/i18n/pickLocaleLabel'
import { useT } from '@/i18n/useT'
import { coreFailureMessage } from '@/core/failure'
/** The zone the vertebra picker edits, with its initial selection (computed on open). */
export interface VertebraTarget {
@@ -63,7 +64,7 @@ export default function ObservationPickers({
if (!fresh) return
const outcome = run(fresh)
if (outcome.ok) updateObservation(activeIndex, outcome.value)
else window.alert(t('core.action_failed'))
else window.alert(coreFailureMessage(t))
}
return (
@@ -11,6 +11,7 @@ import { pickLabel } from '@/i18n/pickLocaleLabel'
import { reportOps } from '@/core/reportOps'
import { useT } from '@/i18n/useT'
import { useLocaleStore } from '@/state/localeStore'
import { coreFailureMessage } from '@/core/failure'
export interface VertebraPickerProps {
open: boolean
@@ -68,7 +69,7 @@ export default function VertebraPicker({
const apply = (action: VertebraAction) => {
const outcome = reportOps.selectVertebrae(selected, action)
if (outcome.ok) setSelected(outcome.value)
else window.alert(t('core.action_failed'))
else window.alert(coreFailureMessage(t))
}
const toggle = (region: string, index: number) =>
apply({ kind: 'toggle', region, index })