spa(phase 3, tasks 15-22): routing, komponenten, home, postview
Phase 3 komplett:
- Task 15: LoadingOrError-Komponente (loading/error-states, Habla-Fallback)
- Task 16: app.html mit CSS-Variablen (light/dark), Base-Typography
- Task 17: +layout.svelte mit Container + bootstrapReadRelays onMount
- Task 18: ProfileCard-Komponente (Avatar, Name, About, NIP-05, Website)
- Task 19: PostCard-Komponente (Thumbnail + Titel/Summary/Datum), responsive
- Task 20: +page.svelte als Home (Profil + Liste, Promise.all für beides)
- Task 21: PostView-Komponente (Titel, Meta, Cover, Summary, Markdown-Body)
- Task 22: [...slug]/+page.ts+svelte — Catch-all-Route mit Legacy-301-Redirect
Alle $props()-abhängigen Werte via $derived() (Svelte-5-Runes-Konformität).
npm run check: 0 errors, 0 warnings, 592 files. npm run build grün.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 17:39:24 +02:00
|
|
|
|
<script lang="ts">
|
|
|
|
|
|
import type { NostrEvent } from '$lib/nostr/loaders';
|
spa(phase 5, tasks 26-32): reactions, replies, nip-07 kommentare, e2e
Neue Komponenten unter $lib/components/:
- Reactions.svelte: lädt kind:7-Aggregation via loadReactions, rendert
Chips mit Emoji + Count. +/- werden zu 👍/👎 gemappt.
- ReplyItem.svelte: einzelner Kommentar mit Author-Npub-Prefix + Datum.
- ReplyList.svelte: lädt kind:1-Replies, merged mit optimistic-Props
(dedup per id), sortiert chronologisch.
- ReplyComposer.svelte: Textarea + Senden-Button. Nutzt NIP-07-Wrapper
(getPublicKey, signEvent), baut kind:1-Event mit a/e/p-Tags, pusht
via pool.publish() zu allen Read-Relays. Fehlertolerant: zeigt
Hinweis, wenn NIP-07-Extension fehlt.
Integration in PostView: Reactions, Composer, ReplyList unterhalb des
Artikel-Bodys. Optimistisches Reply-Pattern: Composer.onPublished
pushed signed event in PostView-local $state, ReplyList merged mit
fetched events.
Playwright-E2E:
- playwright.config.ts mit Dev-Server-Auto-Start
- home.test.ts: Profil + Beitragsliste sichtbar
- post.test.ts: Titel + Body + Legacy-URL-Redirect
Alle 3 E2E-Tests grün. npm run check: 600 files, 0 errors.
Deploy live auf svelte.joerg-lohrer.de (Phase 5 inklusive).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 17:51:57 +02:00
|
|
|
|
import type { SignedEvent } from '$lib/nostr/signer';
|
spa(phase 3, tasks 15-22): routing, komponenten, home, postview
Phase 3 komplett:
- Task 15: LoadingOrError-Komponente (loading/error-states, Habla-Fallback)
- Task 16: app.html mit CSS-Variablen (light/dark), Base-Typography
- Task 17: +layout.svelte mit Container + bootstrapReadRelays onMount
- Task 18: ProfileCard-Komponente (Avatar, Name, About, NIP-05, Website)
- Task 19: PostCard-Komponente (Thumbnail + Titel/Summary/Datum), responsive
- Task 20: +page.svelte als Home (Profil + Liste, Promise.all für beides)
- Task 21: PostView-Komponente (Titel, Meta, Cover, Summary, Markdown-Body)
- Task 22: [...slug]/+page.ts+svelte — Catch-all-Route mit Legacy-301-Redirect
Alle $props()-abhängigen Werte via $derived() (Svelte-5-Runes-Konformität).
npm run check: 0 errors, 0 warnings, 592 files. npm run build grün.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 17:39:24 +02:00
|
|
|
|
import { renderMarkdown } from '$lib/render/markdown';
|
spa(phase 5, tasks 26-32): reactions, replies, nip-07 kommentare, e2e
Neue Komponenten unter $lib/components/:
- Reactions.svelte: lädt kind:7-Aggregation via loadReactions, rendert
Chips mit Emoji + Count. +/- werden zu 👍/👎 gemappt.
- ReplyItem.svelte: einzelner Kommentar mit Author-Npub-Prefix + Datum.
- ReplyList.svelte: lädt kind:1-Replies, merged mit optimistic-Props
(dedup per id), sortiert chronologisch.
- ReplyComposer.svelte: Textarea + Senden-Button. Nutzt NIP-07-Wrapper
(getPublicKey, signEvent), baut kind:1-Event mit a/e/p-Tags, pusht
via pool.publish() zu allen Read-Relays. Fehlertolerant: zeigt
Hinweis, wenn NIP-07-Extension fehlt.
Integration in PostView: Reactions, Composer, ReplyList unterhalb des
Artikel-Bodys. Optimistisches Reply-Pattern: Composer.onPublished
pushed signed event in PostView-local $state, ReplyList merged mit
fetched events.
Playwright-E2E:
- playwright.config.ts mit Dev-Server-Auto-Start
- home.test.ts: Profil + Beitragsliste sichtbar
- post.test.ts: Titel + Body + Legacy-URL-Redirect
Alle 3 E2E-Tests grün. npm run check: 600 files, 0 errors.
Deploy live auf svelte.joerg-lohrer.de (Phase 5 inklusive).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 17:51:57 +02:00
|
|
|
|
import Reactions from './Reactions.svelte';
|
|
|
|
|
|
import ReplyList from './ReplyList.svelte';
|
|
|
|
|
|
import ReplyComposer from './ReplyComposer.svelte';
|
spa: kommentar-author klickbar (njump) + external-client-links am post
Zwei Erweiterungen, die Community-Interaktion an Nostr-native Clients
auslagern statt in der SPA nachzubauen:
1. ReplyItem-Header ist jetzt ein <a href=https://njump.me/<npub>
target=_blank>. Klick auf Avatar/Name öffnet das vollständige
Profil des Kommentar-Authors mit allen Events.
2. Neue ExternalClientLinks.svelte zwischen Reactions und Composer:
dezente Box mit "In Nostr-Client öffnen" — drei Links (Habla,
Yakihonne, njump) über naddr, damit Leser Thread-Replies,
Reactions, Teilen dort nutzen können, wo die volle Nostr-Social-
Layer läuft.
Nostr-Helper erweitert:
- buildNpub(hex) — npub1…-Bech32-Encoding
- buildNjumpProfileUrl(hex) — njump.me/<npub>
- externalClientLinks({pubkey, kind, identifier}) — Liste der drei
etablierten Langform-Viewer mit naddr1…-URLs.
npm run check: 0 errors, 611 files. Deploy live.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 18:04:23 +02:00
|
|
|
|
import ExternalClientLinks from './ExternalClientLinks.svelte';
|
2026-04-21 12:49:59 +02:00
|
|
|
|
import LanguageAvailability from './LanguageAvailability.svelte';
|
2026-04-21 14:13:59 +02:00
|
|
|
|
import { t, activeLocale } from '$lib/i18n';
|
spa(phase 3, tasks 15-22): routing, komponenten, home, postview
Phase 3 komplett:
- Task 15: LoadingOrError-Komponente (loading/error-states, Habla-Fallback)
- Task 16: app.html mit CSS-Variablen (light/dark), Base-Typography
- Task 17: +layout.svelte mit Container + bootstrapReadRelays onMount
- Task 18: ProfileCard-Komponente (Avatar, Name, About, NIP-05, Website)
- Task 19: PostCard-Komponente (Thumbnail + Titel/Summary/Datum), responsive
- Task 20: +page.svelte als Home (Profil + Liste, Promise.all für beides)
- Task 21: PostView-Komponente (Titel, Meta, Cover, Summary, Markdown-Body)
- Task 22: [...slug]/+page.ts+svelte — Catch-all-Route mit Legacy-301-Redirect
Alle $props()-abhängigen Werte via $derived() (Svelte-5-Runes-Konformität).
npm run check: 0 errors, 0 warnings, 592 files. npm run build grün.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 17:39:24 +02:00
|
|
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
|
|
event: NostrEvent;
|
|
|
|
|
|
}
|
|
|
|
|
|
let { event }: Props = $props();
|
|
|
|
|
|
|
|
|
|
|
|
function tagValue(e: NostrEvent, name: string): string {
|
|
|
|
|
|
return e.tags.find((t) => t[0] === name)?.[1] ?? '';
|
|
|
|
|
|
}
|
|
|
|
|
|
function tagsAll(e: NostrEvent, name: string): string[] {
|
|
|
|
|
|
return e.tags.filter((t) => t[0] === name).map((t) => t[1]);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
spa(phase 5, tasks 26-32): reactions, replies, nip-07 kommentare, e2e
Neue Komponenten unter $lib/components/:
- Reactions.svelte: lädt kind:7-Aggregation via loadReactions, rendert
Chips mit Emoji + Count. +/- werden zu 👍/👎 gemappt.
- ReplyItem.svelte: einzelner Kommentar mit Author-Npub-Prefix + Datum.
- ReplyList.svelte: lädt kind:1-Replies, merged mit optimistic-Props
(dedup per id), sortiert chronologisch.
- ReplyComposer.svelte: Textarea + Senden-Button. Nutzt NIP-07-Wrapper
(getPublicKey, signEvent), baut kind:1-Event mit a/e/p-Tags, pusht
via pool.publish() zu allen Read-Relays. Fehlertolerant: zeigt
Hinweis, wenn NIP-07-Extension fehlt.
Integration in PostView: Reactions, Composer, ReplyList unterhalb des
Artikel-Bodys. Optimistisches Reply-Pattern: Composer.onPublished
pushed signed event in PostView-local $state, ReplyList merged mit
fetched events.
Playwright-E2E:
- playwright.config.ts mit Dev-Server-Auto-Start
- home.test.ts: Profil + Beitragsliste sichtbar
- post.test.ts: Titel + Body + Legacy-URL-Redirect
Alle 3 E2E-Tests grün. npm run check: 600 files, 0 errors.
Deploy live auf svelte.joerg-lohrer.de (Phase 5 inklusive).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 17:51:57 +02:00
|
|
|
|
const dtag = $derived(tagValue(event, 'd'));
|
2026-04-21 14:13:59 +02:00
|
|
|
|
let currentLocale = $state('de');
|
|
|
|
|
|
activeLocale.subscribe((v) => (currentLocale = v));
|
|
|
|
|
|
|
|
|
|
|
|
const title = $derived(tagValue(event, 'title') || $t('post.untitled'));
|
spa(phase 3, tasks 15-22): routing, komponenten, home, postview
Phase 3 komplett:
- Task 15: LoadingOrError-Komponente (loading/error-states, Habla-Fallback)
- Task 16: app.html mit CSS-Variablen (light/dark), Base-Typography
- Task 17: +layout.svelte mit Container + bootstrapReadRelays onMount
- Task 18: ProfileCard-Komponente (Avatar, Name, About, NIP-05, Website)
- Task 19: PostCard-Komponente (Thumbnail + Titel/Summary/Datum), responsive
- Task 20: +page.svelte als Home (Profil + Liste, Promise.all für beides)
- Task 21: PostView-Komponente (Titel, Meta, Cover, Summary, Markdown-Body)
- Task 22: [...slug]/+page.ts+svelte — Catch-all-Route mit Legacy-301-Redirect
Alle $props()-abhängigen Werte via $derived() (Svelte-5-Runes-Konformität).
npm run check: 0 errors, 0 warnings, 592 files. npm run build grün.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 17:39:24 +02:00
|
|
|
|
const summary = $derived(tagValue(event, 'summary'));
|
|
|
|
|
|
const image = $derived(tagValue(event, 'image'));
|
|
|
|
|
|
const publishedAt = $derived(
|
|
|
|
|
|
parseInt(tagValue(event, 'published_at') || `${event.created_at}`, 10)
|
|
|
|
|
|
);
|
|
|
|
|
|
const date = $derived(
|
2026-04-21 14:13:59 +02:00
|
|
|
|
new Date(publishedAt * 1000).toLocaleDateString(
|
|
|
|
|
|
currentLocale === 'en' ? 'en-US' : 'de-DE',
|
|
|
|
|
|
{ year: 'numeric', month: 'long', day: 'numeric' }
|
|
|
|
|
|
)
|
spa(phase 3, tasks 15-22): routing, komponenten, home, postview
Phase 3 komplett:
- Task 15: LoadingOrError-Komponente (loading/error-states, Habla-Fallback)
- Task 16: app.html mit CSS-Variablen (light/dark), Base-Typography
- Task 17: +layout.svelte mit Container + bootstrapReadRelays onMount
- Task 18: ProfileCard-Komponente (Avatar, Name, About, NIP-05, Website)
- Task 19: PostCard-Komponente (Thumbnail + Titel/Summary/Datum), responsive
- Task 20: +page.svelte als Home (Profil + Liste, Promise.all für beides)
- Task 21: PostView-Komponente (Titel, Meta, Cover, Summary, Markdown-Body)
- Task 22: [...slug]/+page.ts+svelte — Catch-all-Route mit Legacy-301-Redirect
Alle $props()-abhängigen Werte via $derived() (Svelte-5-Runes-Konformität).
npm run check: 0 errors, 0 warnings, 592 files. npm run build grün.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 17:39:24 +02:00
|
|
|
|
);
|
|
|
|
|
|
const tags = $derived(tagsAll(event, 't'));
|
|
|
|
|
|
const bodyHtml = $derived(renderMarkdown(event.content));
|
|
|
|
|
|
|
spa(phase 5, tasks 26-32): reactions, replies, nip-07 kommentare, e2e
Neue Komponenten unter $lib/components/:
- Reactions.svelte: lädt kind:7-Aggregation via loadReactions, rendert
Chips mit Emoji + Count. +/- werden zu 👍/👎 gemappt.
- ReplyItem.svelte: einzelner Kommentar mit Author-Npub-Prefix + Datum.
- ReplyList.svelte: lädt kind:1-Replies, merged mit optimistic-Props
(dedup per id), sortiert chronologisch.
- ReplyComposer.svelte: Textarea + Senden-Button. Nutzt NIP-07-Wrapper
(getPublicKey, signEvent), baut kind:1-Event mit a/e/p-Tags, pusht
via pool.publish() zu allen Read-Relays. Fehlertolerant: zeigt
Hinweis, wenn NIP-07-Extension fehlt.
Integration in PostView: Reactions, Composer, ReplyList unterhalb des
Artikel-Bodys. Optimistisches Reply-Pattern: Composer.onPublished
pushed signed event in PostView-local $state, ReplyList merged mit
fetched events.
Playwright-E2E:
- playwright.config.ts mit Dev-Server-Auto-Start
- home.test.ts: Profil + Beitragsliste sichtbar
- post.test.ts: Titel + Body + Legacy-URL-Redirect
Alle 3 E2E-Tests grün. npm run check: 600 files, 0 errors.
Deploy live auf svelte.joerg-lohrer.de (Phase 5 inklusive).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 17:51:57 +02:00
|
|
|
|
// Optimistisch gesendete Replies: der Composer pusht sie rein,
|
|
|
|
|
|
// ReplyList merged sie mit den vom Relay geladenen Replies (dedup per id).
|
|
|
|
|
|
let optimisticReplies: NostrEvent[] = $state([]);
|
|
|
|
|
|
function handlePublished(signed: SignedEvent) {
|
|
|
|
|
|
optimisticReplies = [...optimisticReplies, signed as unknown as NostrEvent];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
spa(phase 3, tasks 15-22): routing, komponenten, home, postview
Phase 3 komplett:
- Task 15: LoadingOrError-Komponente (loading/error-states, Habla-Fallback)
- Task 16: app.html mit CSS-Variablen (light/dark), Base-Typography
- Task 17: +layout.svelte mit Container + bootstrapReadRelays onMount
- Task 18: ProfileCard-Komponente (Avatar, Name, About, NIP-05, Website)
- Task 19: PostCard-Komponente (Thumbnail + Titel/Summary/Datum), responsive
- Task 20: +page.svelte als Home (Profil + Liste, Promise.all für beides)
- Task 21: PostView-Komponente (Titel, Meta, Cover, Summary, Markdown-Body)
- Task 22: [...slug]/+page.ts+svelte — Catch-all-Route mit Legacy-301-Redirect
Alle $props()-abhängigen Werte via $derived() (Svelte-5-Runes-Konformität).
npm run check: 0 errors, 0 warnings, 592 files. npm run build grün.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 17:39:24 +02:00
|
|
|
|
$effect(() => {
|
|
|
|
|
|
document.title = `${title} – Jörg Lohrer`;
|
|
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<h1 class="post-title">{title}</h1>
|
|
|
|
|
|
<div class="meta">
|
2026-04-21 14:13:59 +02:00
|
|
|
|
{$t('post.published_on', { values: { date } })}
|
spa(phase 3, tasks 15-22): routing, komponenten, home, postview
Phase 3 komplett:
- Task 15: LoadingOrError-Komponente (loading/error-states, Habla-Fallback)
- Task 16: app.html mit CSS-Variablen (light/dark), Base-Typography
- Task 17: +layout.svelte mit Container + bootstrapReadRelays onMount
- Task 18: ProfileCard-Komponente (Avatar, Name, About, NIP-05, Website)
- Task 19: PostCard-Komponente (Thumbnail + Titel/Summary/Datum), responsive
- Task 20: +page.svelte als Home (Profil + Liste, Promise.all für beides)
- Task 21: PostView-Komponente (Titel, Meta, Cover, Summary, Markdown-Body)
- Task 22: [...slug]/+page.ts+svelte — Catch-all-Route mit Legacy-301-Redirect
Alle $props()-abhängigen Werte via $derived() (Svelte-5-Runes-Konformität).
npm run check: 0 errors, 0 warnings, 592 files. npm run build grün.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 17:39:24 +02:00
|
|
|
|
{#if tags.length > 0}
|
|
|
|
|
|
<div class="tags">
|
|
|
|
|
|
{#each tags as t}
|
|
|
|
|
|
<a class="tag" href="/tag/{encodeURIComponent(t)}/">{t}</a>
|
|
|
|
|
|
{/each}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
{/if}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-04-21 12:49:59 +02:00
|
|
|
|
<LanguageAvailability {event} />
|
|
|
|
|
|
|
spa(phase 3, tasks 15-22): routing, komponenten, home, postview
Phase 3 komplett:
- Task 15: LoadingOrError-Komponente (loading/error-states, Habla-Fallback)
- Task 16: app.html mit CSS-Variablen (light/dark), Base-Typography
- Task 17: +layout.svelte mit Container + bootstrapReadRelays onMount
- Task 18: ProfileCard-Komponente (Avatar, Name, About, NIP-05, Website)
- Task 19: PostCard-Komponente (Thumbnail + Titel/Summary/Datum), responsive
- Task 20: +page.svelte als Home (Profil + Liste, Promise.all für beides)
- Task 21: PostView-Komponente (Titel, Meta, Cover, Summary, Markdown-Body)
- Task 22: [...slug]/+page.ts+svelte — Catch-all-Route mit Legacy-301-Redirect
Alle $props()-abhängigen Werte via $derived() (Svelte-5-Runes-Konformität).
npm run check: 0 errors, 0 warnings, 592 files. npm run build grün.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 17:39:24 +02:00
|
|
|
|
{#if image}
|
|
|
|
|
|
<p class="cover"><img src={image} alt="Cover-Bild" /></p>
|
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
|
|
{#if summary}
|
|
|
|
|
|
<p class="summary">{summary}</p>
|
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
|
|
<article>{@html bodyHtml}</article>
|
|
|
|
|
|
|
spa(phase 5, tasks 26-32): reactions, replies, nip-07 kommentare, e2e
Neue Komponenten unter $lib/components/:
- Reactions.svelte: lädt kind:7-Aggregation via loadReactions, rendert
Chips mit Emoji + Count. +/- werden zu 👍/👎 gemappt.
- ReplyItem.svelte: einzelner Kommentar mit Author-Npub-Prefix + Datum.
- ReplyList.svelte: lädt kind:1-Replies, merged mit optimistic-Props
(dedup per id), sortiert chronologisch.
- ReplyComposer.svelte: Textarea + Senden-Button. Nutzt NIP-07-Wrapper
(getPublicKey, signEvent), baut kind:1-Event mit a/e/p-Tags, pusht
via pool.publish() zu allen Read-Relays. Fehlertolerant: zeigt
Hinweis, wenn NIP-07-Extension fehlt.
Integration in PostView: Reactions, Composer, ReplyList unterhalb des
Artikel-Bodys. Optimistisches Reply-Pattern: Composer.onPublished
pushed signed event in PostView-local $state, ReplyList merged mit
fetched events.
Playwright-E2E:
- playwright.config.ts mit Dev-Server-Auto-Start
- home.test.ts: Profil + Beitragsliste sichtbar
- post.test.ts: Titel + Body + Legacy-URL-Redirect
Alle 3 E2E-Tests grün. npm run check: 600 files, 0 errors.
Deploy live auf svelte.joerg-lohrer.de (Phase 5 inklusive).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 17:51:57 +02:00
|
|
|
|
{#if dtag}
|
|
|
|
|
|
<Reactions {dtag} />
|
spa: kommentar-author klickbar (njump) + external-client-links am post
Zwei Erweiterungen, die Community-Interaktion an Nostr-native Clients
auslagern statt in der SPA nachzubauen:
1. ReplyItem-Header ist jetzt ein <a href=https://njump.me/<npub>
target=_blank>. Klick auf Avatar/Name öffnet das vollständige
Profil des Kommentar-Authors mit allen Events.
2. Neue ExternalClientLinks.svelte zwischen Reactions und Composer:
dezente Box mit "In Nostr-Client öffnen" — drei Links (Habla,
Yakihonne, njump) über naddr, damit Leser Thread-Replies,
Reactions, Teilen dort nutzen können, wo die volle Nostr-Social-
Layer läuft.
Nostr-Helper erweitert:
- buildNpub(hex) — npub1…-Bech32-Encoding
- buildNjumpProfileUrl(hex) — njump.me/<npub>
- externalClientLinks({pubkey, kind, identifier}) — Liste der drei
etablierten Langform-Viewer mit naddr1…-URLs.
npm run check: 0 errors, 611 files. Deploy live.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 18:04:23 +02:00
|
|
|
|
<ExternalClientLinks {dtag} />
|
spa(phase 5, tasks 26-32): reactions, replies, nip-07 kommentare, e2e
Neue Komponenten unter $lib/components/:
- Reactions.svelte: lädt kind:7-Aggregation via loadReactions, rendert
Chips mit Emoji + Count. +/- werden zu 👍/👎 gemappt.
- ReplyItem.svelte: einzelner Kommentar mit Author-Npub-Prefix + Datum.
- ReplyList.svelte: lädt kind:1-Replies, merged mit optimistic-Props
(dedup per id), sortiert chronologisch.
- ReplyComposer.svelte: Textarea + Senden-Button. Nutzt NIP-07-Wrapper
(getPublicKey, signEvent), baut kind:1-Event mit a/e/p-Tags, pusht
via pool.publish() zu allen Read-Relays. Fehlertolerant: zeigt
Hinweis, wenn NIP-07-Extension fehlt.
Integration in PostView: Reactions, Composer, ReplyList unterhalb des
Artikel-Bodys. Optimistisches Reply-Pattern: Composer.onPublished
pushed signed event in PostView-local $state, ReplyList merged mit
fetched events.
Playwright-E2E:
- playwright.config.ts mit Dev-Server-Auto-Start
- home.test.ts: Profil + Beitragsliste sichtbar
- post.test.ts: Titel + Body + Legacy-URL-Redirect
Alle 3 E2E-Tests grün. npm run check: 600 files, 0 errors.
Deploy live auf svelte.joerg-lohrer.de (Phase 5 inklusive).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 17:51:57 +02:00
|
|
|
|
<ReplyComposer {dtag} eventId={event.id} onPublished={handlePublished} />
|
|
|
|
|
|
<ReplyList {dtag} optimistic={optimisticReplies} />
|
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
spa(phase 3, tasks 15-22): routing, komponenten, home, postview
Phase 3 komplett:
- Task 15: LoadingOrError-Komponente (loading/error-states, Habla-Fallback)
- Task 16: app.html mit CSS-Variablen (light/dark), Base-Typography
- Task 17: +layout.svelte mit Container + bootstrapReadRelays onMount
- Task 18: ProfileCard-Komponente (Avatar, Name, About, NIP-05, Website)
- Task 19: PostCard-Komponente (Thumbnail + Titel/Summary/Datum), responsive
- Task 20: +page.svelte als Home (Profil + Liste, Promise.all für beides)
- Task 21: PostView-Komponente (Titel, Meta, Cover, Summary, Markdown-Body)
- Task 22: [...slug]/+page.ts+svelte — Catch-all-Route mit Legacy-301-Redirect
Alle $props()-abhängigen Werte via $derived() (Svelte-5-Runes-Konformität).
npm run check: 0 errors, 0 warnings, 592 files. npm run build grün.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 17:39:24 +02:00
|
|
|
|
<style>
|
|
|
|
|
|
.post-title {
|
|
|
|
|
|
font-size: 1.5rem;
|
|
|
|
|
|
line-height: 1.25;
|
|
|
|
|
|
margin: 0 0 0.4rem;
|
|
|
|
|
|
word-wrap: break-word;
|
|
|
|
|
|
}
|
|
|
|
|
|
@media (min-width: 640px) {
|
|
|
|
|
|
.post-title {
|
|
|
|
|
|
font-size: 2rem;
|
|
|
|
|
|
line-height: 1.2;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.meta {
|
|
|
|
|
|
color: var(--muted);
|
|
|
|
|
|
font-size: 0.92rem;
|
|
|
|
|
|
margin-bottom: 2rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.tags {
|
|
|
|
|
|
margin-top: 0.4rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.tag {
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
background: var(--code-bg);
|
|
|
|
|
|
border-radius: 3px;
|
|
|
|
|
|
padding: 1px 7px;
|
|
|
|
|
|
margin: 0 4px 4px 0;
|
|
|
|
|
|
font-size: 0.85em;
|
|
|
|
|
|
color: var(--fg);
|
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
.tag:hover {
|
|
|
|
|
|
background: var(--border);
|
|
|
|
|
|
}
|
|
|
|
|
|
.cover {
|
|
|
|
|
|
max-width: 480px;
|
|
|
|
|
|
margin: 1rem auto 1.5rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
.cover img {
|
|
|
|
|
|
display: block;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: auto;
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.summary {
|
|
|
|
|
|
font-style: italic;
|
|
|
|
|
|
color: var(--muted);
|
|
|
|
|
|
}
|
|
|
|
|
|
article :global(img) {
|
|
|
|
|
|
max-width: 100%;
|
|
|
|
|
|
height: auto;
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
}
|
|
|
|
|
|
article :global(a) {
|
|
|
|
|
|
color: var(--accent);
|
|
|
|
|
|
word-break: break-word;
|
|
|
|
|
|
}
|
|
|
|
|
|
article :global(pre) {
|
|
|
|
|
|
background: var(--code-bg);
|
|
|
|
|
|
padding: 0.8rem;
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
overflow-x: auto;
|
|
|
|
|
|
font-size: 0.88em;
|
|
|
|
|
|
max-width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
article :global(code) {
|
|
|
|
|
|
background: var(--code-bg);
|
|
|
|
|
|
padding: 1px 4px;
|
|
|
|
|
|
border-radius: 3px;
|
|
|
|
|
|
font-size: 0.92em;
|
|
|
|
|
|
word-break: break-word;
|
|
|
|
|
|
}
|
|
|
|
|
|
article :global(pre code) {
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
background: none;
|
|
|
|
|
|
word-break: normal;
|
|
|
|
|
|
}
|
|
|
|
|
|
article :global(hr) {
|
|
|
|
|
|
border: none;
|
|
|
|
|
|
border-top: 1px solid var(--border);
|
|
|
|
|
|
margin: 2rem 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
article :global(blockquote) {
|
|
|
|
|
|
border-left: 3px solid var(--border);
|
|
|
|
|
|
padding: 0 0 0 1rem;
|
|
|
|
|
|
margin: 1rem 0;
|
|
|
|
|
|
color: var(--muted);
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|