From d1427a41ff03fe6d3d8f4df66231ab4b2879ca55 Mon Sep 17 00:00:00 2001 From: Phat Pham Date: Sat, 14 Nov 2026 10:45:15 +0700 Subject: [PATCH] fix(preview): hide provisional title while the skeleton loads Card titles and fetched article titles often differ, so showing the card title under the reader skeleton made the panel look like it had loaded the wrong article. When the delayed preview skeleton appears, hide the provisional title and start the skeleton with a title placeholder, followed by byline/body rhythm. The provisional title stays visible for the first 150ms so fast responses swap straight to the fetched title without a blank flash. Success reveals the fetched title; failures restore the card title and show the error status. Bump app.js to v111 and the PWA shell cache to v145. Co-Authored-By: Claude Code --- README.md | 2 +- core/render.ts | 2 +- core/test/render.spec.ts | 2 +- docs/ARCHITECTURE.md | 2 +- docs/RUNBOOK.md | 2 +- web-static/service-worker.js | 4 ++-- web-static/static/app.js | 13 ++++++++++++- web-static/static/style.css | 9 +++++++-- 8 files changed, 26 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 83e8e86..c920e40 100644 --- a/README.md +++ b/README.md @@ -377,7 +377,7 @@ Presentation-layer note: ### Article preview - when enabled in Reader settings, clicking any card (including its title) loads a reader view in a right-hand panel instead of opening a new tab -- while the preview request is in flight, the panel keeps the card title and shows a preview skeleton after a short delay; the loaded title and content fade in, and a failed request replaces the skeleton with a readable error message +- while the preview request is in flight, the panel keeps the card title until the delayed skeleton appears; the skeleton then replaces the provisional title and mimics the article title/byline/body rhythm, and the fetched title and content fade in. A failed request clears the skeleton, restores the card title, and shows a readable error message - transient upstream `429`/`5xx` responses are retried once with jitter; blocked sources, timeouts, unsupported formats, and failed fetches get specific messages - the visible loading message is visually hidden while the skeleton is shown; the panel remains `aria-busy` and a live region announces the loading state - `Cmd`/`Ctrl`/`Shift`-clicking a title still opens the article in a new tab diff --git a/core/render.ts b/core/render.ts index 94b4414..0869f01 100644 --- a/core/render.ts +++ b/core/render.ts @@ -195,7 +195,7 @@ export function renderIndexPage(data: PageData): string { - +