fix(ui): make preview error more actionable
Explains that the page was likely a forum/listing, not a recipe, and offers 'Zurück zur Trefferliste' plus 'Seite im Browser öffnen' as escape hatches. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -57,11 +57,20 @@
|
|||||||
<p class="muted">Vorschau wird geladen…</p>
|
<p class="muted">Vorschau wird geladen…</p>
|
||||||
{:else if errored}
|
{:else if errored}
|
||||||
<section class="error-box">
|
<section class="error-box">
|
||||||
<h2>Vorschau nicht möglich</h2>
|
<h2>Diese Seite enthält kein Rezept</h2>
|
||||||
<p>{errored}</p>
|
<p class="detail">{errored}</p>
|
||||||
<p class="hint">
|
<p class="explain">
|
||||||
<button type="button" class="link" onclick={() => history.back()}>← Zurück</button>
|
Wahrscheinlich hast du eine Forum- oder Übersichtsseite erwischt, kein einzelnes
|
||||||
|
Rezept. Geh zurück und wähle einen anderen Treffer.
|
||||||
</p>
|
</p>
|
||||||
|
<div class="actions">
|
||||||
|
<button type="button" class="back-btn" onclick={() => history.back()}>
|
||||||
|
← Zurück zur Trefferliste
|
||||||
|
</button>
|
||||||
|
<a class="src-link" href={targetUrl} target="_blank" rel="noopener">
|
||||||
|
Seite im Browser öffnen ↗
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
{:else if recipe}
|
{:else if recipe}
|
||||||
<div class="banner">
|
<div class="banner">
|
||||||
@@ -87,25 +96,57 @@
|
|||||||
margin: 3rem 0;
|
margin: 3rem 0;
|
||||||
}
|
}
|
||||||
.error-box {
|
.error-box {
|
||||||
text-align: center;
|
padding: 1.5rem 1.25rem;
|
||||||
padding: 2rem 1rem;
|
background: #fff6d7;
|
||||||
background: #fdf3f3;
|
border: 1px solid #e6d48a;
|
||||||
border: 1px solid #f1b4b4;
|
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
}
|
}
|
||||||
.error-box h2 {
|
.error-box h2 {
|
||||||
color: #c53030;
|
color: #6d5400;
|
||||||
margin: 0 0 0.5rem;
|
margin: 0 0 0.5rem;
|
||||||
|
font-size: 1.15rem;
|
||||||
}
|
}
|
||||||
.link {
|
.detail {
|
||||||
background: none;
|
color: #6d5400;
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
background: rgba(255, 255, 255, 0.55);
|
||||||
|
padding: 0.5rem 0.75rem;
|
||||||
|
border-radius: 6px;
|
||||||
|
margin: 0 0 0.75rem;
|
||||||
|
}
|
||||||
|
.explain {
|
||||||
|
color: #5c4800;
|
||||||
|
line-height: 1.45;
|
||||||
|
margin: 0 0 1rem;
|
||||||
|
}
|
||||||
|
.actions {
|
||||||
|
display: flex;
|
||||||
|
gap: 0.5rem;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
.back-btn {
|
||||||
|
padding: 0.7rem 1rem;
|
||||||
|
min-height: 44px;
|
||||||
|
background: #2b6a3d;
|
||||||
|
color: white;
|
||||||
border: 0;
|
border: 0;
|
||||||
color: #666;
|
border-radius: 10px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
padding: 0;
|
font-size: 0.95rem;
|
||||||
font: inherit;
|
}
|
||||||
text-decoration: underline;
|
.src-link {
|
||||||
|
padding: 0.7rem 1rem;
|
||||||
|
min-height: 44px;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
background: white;
|
||||||
|
border: 1px solid #cfd9d1;
|
||||||
|
border-radius: 10px;
|
||||||
|
text-decoration: none;
|
||||||
|
color: #444;
|
||||||
|
font-size: 0.95rem;
|
||||||
}
|
}
|
||||||
.banner {
|
.banner {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
Reference in New Issue
Block a user