mirror of
https://github.com/PR0M3TH3AN/Artstr-Studio.git
synced 2026-10-27 08:40:39 +00:00
book: layers panel scopes to the active book page
The layers sidebar fell through to the case-cover sections (Back / Spine / Front) when in book mode because templateLayerTargetsForMode() had no book branch. It now returns a single panel labeled "Page N" keyed to the active entry's target (`book-page:<entryId>`), so the layers listed and the Add-layer actions are scoped to the page the user is editing. When no page is open (Pages overview is showing) the helper returns an empty list and renderLayerList() naturally renders nothing — consistent with the deck-sorter view that also hides the layers fieldset until a slide is open.
This commit is contained in:
1 parent
0a1ff5f8da
commit
38f28fb397
1 file changed
+12
@@ -8727,6 +8727,18 @@
|
||||
if (isCanvasMode(state.templateMode)) return [
|
||||
{ key: 'canvas', label: 'Canvas' }
|
||||
];
|
||||
if (state.templateMode === 'book') {
|
||||
// Book mode: the layers panel scopes to whichever page is
|
||||
// open in the per-page editor. No page open → no panels
|
||||
// (Pages overview shows tiles, not layer rows).
|
||||
const editId = state.book?.editingEntryId;
|
||||
if (editId) {
|
||||
const idx = (state.book?.pages || []).findIndex(p => p.id === editId);
|
||||
const human = idx >= 0 ? `Page ${idx + 1}` : 'Current page';
|
||||
return [{ key: `book-page:${editId}`, label: human }];
|
||||
}
|
||||
return [];
|
||||
}
|
||||
// Cover mode. In combined-wrap mode the artwork is one open canvas, so
|
||||
// back/spine/front sub-regions aren't meaningful — collapse to a single
|
||||
// "Cover trim area" panel that still lists any pre-existing back/spine/
|
||||
|
||||
Reference in new issue
Block a user