fix(preview): Save-Icon als Lucide, Query in URL persistent
All checks were successful
Build & Publish Docker Image / build-and-push (push) Successful in 1m19s
All checks were successful
Build & Publish Docker Image / build-and-push (push) Successful in 1m19s
1. "💾 In meine Sammlung speichern" → Lucide BookmarkPlus + Text.
Letzter Emoji auf den wichtigen UI-Flächen ist damit weg.
2. Query auf der Startseite wird per history.replaceState nach ?q=…
in die URL gespiegelt. Folge:
- User tippt "Pizza" → Ergebnisse erscheinen
- Klick auf Vorschau pusht neue History-Entry /preview?url=…
- "Zurück" landet wieder auf /?q=Pizza
- onMount liest q aus URL, setzt query, Debounce-Effekt feuert,
Ergebnisse sind wieder da.
replaceState statt pushState beim Tippen → keine History-Spam-Einträge.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { goto } from '$app/navigation';
|
||||
import { BookmarkPlus } from 'lucide-svelte';
|
||||
import RecipeView from '$lib/components/RecipeView.svelte';
|
||||
import { alertAction } from '$lib/client/confirm.svelte';
|
||||
import type { Recipe } from '$lib/types';
|
||||
@@ -85,7 +86,12 @@
|
||||
{#snippet showActions()}
|
||||
<div class="save-bar">
|
||||
<button class="btn primary" onclick={save} disabled={saving}>
|
||||
{saving ? 'Speichern…' : '💾 In meine Sammlung speichern'}
|
||||
{#if saving}
|
||||
<span>Speichern…</span>
|
||||
{:else}
|
||||
<BookmarkPlus size={18} strokeWidth={2} />
|
||||
<span>In meine Sammlung speichern</span>
|
||||
{/if}
|
||||
</button>
|
||||
<button type="button" class="btn ghost" onclick={() => history.back()}>Zurück</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user