fix(editor): final review round, history, dialogs, Plus and limits

I1 scroll restored at once on a Back into layers; I2 Aller a opens the target dialog in one push; M1-M9, criteria 8 and 17 (left-draft notice), entry caps, no exhaustive-deps disables, locals within 5.
This commit is contained in:
bchanot committed 2026-11-13 23:42:32 +01:00
1 parent ce171427c0
commit 6bf9290da7
25 files changed
+1002 -202

No files matched your search

+13 -6
View File
@@ -56,10 +56,9 @@ function useOpening({ dispatch, mark }: LayerContext, held: RefObject<Opener>) {
return { open, start }
}
/** The moves that take it away: a user close, and the replace that is no Back step. */
function useClosing(ctx: LayerContext) {
const { dispatch, announce, guards, mark } = ctx
const close = useCallback(
/** A user close: the form may refuse it (a dirty draft asks first). */
function useClose({ dispatch, guards, mark }: LayerContext) {
return useCallback(
(forced = false) => {
if (!guards.ask('reference', forced).allowed) return false
mark()
@@ -68,7 +67,11 @@ function useClosing(ctx: LayerContext) {
},
[guards, dispatch, mark],
)
const replace = useCallback(
}
/** The replace that is no Back step; with `text`, forced and said with a dropped draft. */
function useReplace({ dispatch, announce, guards, mark }: LayerContext) {
return useCallback(
(id: string | null, text?: string) => {
const note = text ? guards.ask('reference', true).note : undefined
if (text) announce(note ? `${note}. ${text}` : text)
@@ -79,7 +82,11 @@ function useClosing(ctx: LayerContext) {
},
[guards, announce, dispatch, mark],
)
return { close, replace }
}
/** The moves that take it away: a user close, and the replace that is no Back step. */
function useClosing(ctx: LayerContext) {
return { close: useClose(ctx), replace: useReplace(ctx) }
}
/** A creation that succeeded: its entry becomes the reference's own, then it closes. */