From 5bd52cc89b36d9d5ed0638f7671a788cc41cabc8 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Sun, 18 Jan 2026 14:02:37 -0600 Subject: [PATCH] feat(phase4.3): add favorites edit modal component - Create FavoritesEditModal with preset icon grid - Add custom image upload button - Add tab reorder UI with up/down buttons - Integrate edit button in Favorites page header (top-right) - Add i18n keys for EN and ES - Wire modal save handler to backend cc --- src/lib/components/FavoritesEditModal.svelte | 368 ++++++++++++++++++ src/lib/components/views/FavoritesView.svelte | 63 ++- src/lib/i18n/locales/en.json | 20 +- src/lib/i18n/locales/es.json | 20 +- src/lib/types/index.ts | 8 + 5 files changed, 476 insertions(+), 3 deletions(-) create mode 100644 src/lib/components/FavoritesEditModal.svelte diff --git a/src/lib/components/FavoritesEditModal.svelte b/src/lib/components/FavoritesEditModal.svelte new file mode 100644 index 000000000..83298bf52 --- /dev/null +++ b/src/lib/components/FavoritesEditModal.svelte @@ -0,0 +1,368 @@ + + + + {#snippet children()} + + Icon + Choose an icon for the Favorites page header + + + {#each presetIcons as preset} + selectPreset(preset.id)} + title={preset.label} + > + + + {/each} + + + + + + Upload Custom Image + + {#if useCustomImage && customIconPath} + {customIconPath.split('/').pop()} + {/if} + + + + + Tab Order + Reorder tabs in the Favorites page navigation + + + {#each tabOrder as tab, index} + + + + + {tabLabels[tab] || tab} + + moveUp(index)} + disabled={index === 0} + title="Move up" + > + ↑ + + moveDown(index)} + disabled={index === tabOrder.length - 1} + title="Move down" + > + ↓ + + + + {/each} + + + {/snippet} + + {#snippet footer()} + + + Cancel + + + {saving ? 'Saving...' : 'Save'} + + + {/snippet} + + + diff --git a/src/lib/components/views/FavoritesView.svelte b/src/lib/components/views/FavoritesView.svelte index d86844c1b..df5dd32d5 100644 --- a/src/lib/components/views/FavoritesView.svelte +++ b/src/lib/components/views/FavoritesView.svelte @@ -1,12 +1,14 @@
Choose an icon for the Favorites page header
Reorder tabs in the Favorites page navigation