From ac16cfd3bf14559e43c301e970388614de796a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thea=20Sch=C3=B6bl?= Date: Fri, 14 Feb 2025 14:52:07 +0100 Subject: [PATCH] feat: use factory default meta feat: clear chords button resolves #64 --- icons.config.js | 4 ++ src/lib/backup/backup.ts | 10 ++--- .../components/layout/GenericLayout.svelte | 14 +++--- src/lib/components/layout/Layout.svelte | 28 ++++++++++-- src/lib/setting.ts | 12 ++--- src/lib/undo-redo.ts | 34 +++++++------- src/routes/(app)/config/Navigation.svelte | 1 - src/routes/(app)/config/chords/+page.svelte | 44 ++++++++++++++++--- .../config/chords/ChordActionEdit.svelte | 28 +++++++----- .../(app)/config/chords/ChordEdit.svelte | 40 ++++++++++------- .../config/chords/ChordPhraseEdit.svelte | 28 +++++++----- src/routes/(app)/config/settings/+page.svelte | 17 +++++-- 12 files changed, 173 insertions(+), 87 deletions(-) diff --git a/icons.config.js b/icons.config.js index f90fc075..9678c836 100644 --- a/icons.config.js +++ b/icons.config.js @@ -73,6 +73,10 @@ const config = { "reply", "navigate_before", "navigate_next", + "library_add", + "reset_wrench", + "reset_settings", + "delete_sweep", "print", "restore_from_trash", "history", diff --git a/src/lib/backup/backup.ts b/src/lib/backup/backup.ts index e523f924..42687d2e 100644 --- a/src/lib/backup/backup.ts +++ b/src/lib/backup/backup.ts @@ -107,32 +107,32 @@ export function restoreFromFile( } changes.update((changes) => { - changes.push( + changes.push([ ...getChangesFromChordFile(recent[0]), ...getChangesFromLayoutFile(recent[1]), ...getChangesFromSettingsFile(recent[2]), - ); + ]); return changes; }); break; } case "chords": { changes.update((changes) => { - changes.push(...getChangesFromChordFile(file)); + changes.push(getChangesFromChordFile(file)); return changes; }); break; } case "layout": { changes.update((changes) => { - changes.push(...getChangesFromLayoutFile(file)); + changes.push(getChangesFromLayoutFile(file)); return changes; }); break; } case "settings": { changes.update((changes) => { - changes.push(...getChangesFromSettingsFile(file)); + changes.push(getChangesFromSettingsFile(file)); return changes; }); break; diff --git a/src/lib/components/layout/GenericLayout.svelte b/src/lib/components/layout/GenericLayout.svelte index bc2d0e8b..f33a41d7 100644 --- a/src/lib/components/layout/GenericLayout.svelte +++ b/src/lib/components/layout/GenericLayout.svelte @@ -137,12 +137,14 @@ }, onselect(action) { changes.update((changes) => { - changes.push({ - type: ChangeType.Layout, - id: keyInfo.id, - layer: get(activeLayer), - action, - }); + changes.push([ + { + type: ChangeType.Layout, + id: keyInfo.id, + layer: get(activeLayer), + action, + }, + ]); return changes; }); closed(); diff --git a/src/lib/components/layout/Layout.svelte b/src/lib/components/layout/Layout.svelte index 9b897f48..dbe62742 100644 --- a/src/lib/components/layout/Layout.svelte +++ b/src/lib/components/layout/Layout.svelte @@ -1,11 +1,12 @@