feat(studio): a full page says so instead of swallowing the click

This commit is contained in:
Maurice
2026-10-24 09:19:17 +02:00
parent 1050029842
commit e2c00ba18b
34 changed files with 202 additions and 4 deletions
+6 -1
View File
@@ -54,6 +54,7 @@ interface Host {
styleClip: BookCopiedStyle | null;
commit: (fn: (doc: BookDocument) => BookDocument) => void;
apply: (fn: (doc: BookDocument) => BookDocument) => void;
refuseFull: () => void;
}
type Set = (partial: Partial<Host> | ((s: Host) => Partial<Host>)) => void;
@@ -370,7 +371,11 @@ function panelActions(
if (!doc) return;
const chosen = spread.elements.filter((e) => ids.includes(e.id));
// The page's own cap: copies that would make the book unsaveable are not made.
if (!chosen.length || spread.elements.length + chosen.length > MAX_SPREAD_ELEMENTS) return;
if (!chosen.length) return;
if (spread.elements.length + chosen.length > MAX_SPREAD_ELEMENTS) {
get().refuseFull();
return;
}
const copies = chosen.map(
(e) =>
({