[40] Ausschnitte duplizieren (Ausschnitte-Panel)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NTYBZBvLYCtugMJoKXaB67
This commit is contained in:
Claude committed 2026-11-04 13:18:39 +00:00
1 parent 8c3d5f233b
commit a037cbf8a3
7 files changed
+49 -1

No files matched your search

+10
View File
@@ -1288,6 +1288,16 @@ export function usePanelHostBase(opts: {
applyChange((p) => patchItem(p, "viewSnapshots", id, { name: trimmed }));
},
onDuplicateViewSnapshot: (id: string) => {
// [40] Kopie gleich hinter dem Original, gleicher Ordner, „… Kopie"; danach angewählt.
const list = project.viewSnapshots ?? [];
const i = list.findIndex((v) => v.id === id);
if (i < 0) return;
const copy = { ...list[i], id: `vs-${Date.now()}`, name: t("viewsnap.copyName", { name: list[i].name }) };
applyChange(() => addItems("viewSnapshots", [copy], i + 1));
setSelectedViewSnapshotId(copy.id);
},
onDeleteViewSnapshot: (id: string) => {
applyChange((p) => removeItems(p, "viewSnapshots", [id]));
if (selectedViewSnapshotId === id) setSelectedViewSnapshotId(null);