e621 polish: cached results, search context, DText descriptions

- e621 list/post queries use a 5 minute staleTime and 30 minute gcTime,
  so opening a post and coming back shows the same results with no
  refetch; global gcTime raised to 30 minutes
- post card links carry their originating search in route state; the
  detail back link returns to it and related-post links keep it
- new navigations scroll to top while history back/forward keeps the
  previous position
- DText renderer for e621 descriptions (b/i/u/s, sup/sub, code, spoiler,
  quote, color, url/wiki/thumb, headings, lists, sections, expand
  blocks, named and bare links) built as React elements, no raw HTML
- Spoiler moved to its own component; trailing punctuation no longer
  swallowed into links
This commit is contained in:
2026-09-17 09:19:25 -05:00
parent 04448bf615
commit 81939d8ca3
7 changed files with 562 additions and 8 deletions
@@ -20,13 +20,16 @@ const ratingPill: Record<string, string> = {
export function PostCard({
post,
inLibrary,
from,
}: {
post: E621Post;
inLibrary: boolean;
from?: string;
}) {
return (
<Link
to={`/online/view/${post.id}`}
state={from ? { from } : undefined}
className={cn(
"group overflow-hidden rounded-lg border bg-ctp-base transition",
ratingBorder[post.rating] ?? "border-ctp-surface0",