feat: port note detail page from playground #79
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-docs-app!79
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "71-port-note-detail"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Port the note detail page from
~/pal-e-docs-playground/note.htmlinto pal-e-app, replacing the old NoteLayout with playground CSS classes and adding backlinks, siblings, and relative time display.Changes
src/lib/api-client.ts-- AddNoteLinkinterface andgetNoteLinks()function for the/notes/{slug}/linksendpointsrc/lib/time.ts-- New sharedrelativeTime()utility ("Updated 6 days ago" pattern)src/lib/components/NoteLayout.svelte-- Rewrite to match playground note.html: breadcrumb, note-header with badges/tags/relative time, two-column layout with article + right sidebar (TOC, siblings, backlinks), children section below blockssrc/routes/notes/[slug]/+page.svelte-- Fetch backlinks viagetNoteLinks, fetch siblings via parent_slug, pass new props to NoteLayoutsrc/routes/notes/[slug]/+page.ts-- New file: explicitssr = false/prerender = falsefor client-side renderingTest Plan
npm run buildpasses cleanlyReview Checklist
npm run build)getNoteLinksadded for backlinksRelated Notes
Closes #71
Rewrite NoteLayout.svelte to match playground note.html layout: - Use playground CSS classes (breadcrumb, note-header, note-meta, badge, tag, children-section, toc-item, backlink-item) - Add right sidebar with TOC, siblings, and backlinks sections - Add children section below block content - Add relative time display ("Updated 6 days ago") - Responsive: stacked on mobile, side-by-side on desktop Add API support for note links (backlinks): - NoteLink interface and getNoteLinks() in api-client.ts - Fetch /notes/{slug}/links endpoint, filter for incoming direction - Fetch sibling notes via parent_slug when parent exists Add +page.ts for explicit client-side rendering config. Add shared relativeTime utility in lib/time.ts. Closes #71 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>QA Review: PR #79
Files Reviewed
src/lib/api-client.ts-- NoteLink interface + getNoteLinks()src/lib/time.ts-- relativeTime utilitysrc/lib/components/NoteLayout.svelte-- full rewrite to playground layoutsrc/routes/notes/[slug]/+page.svelte-- backlinks, siblings, links fetchingsrc/routes/notes/[slug]/+page.ts-- client-side rendering configFindings
Correct:
breadcrumb,note-header,note-meta,badge badge--{type},tag,meta-time,toc-item,backlink-item,children-section,child-card,tree-dot,sidebar-section,sidebar-label,empty-stategetNoteLinksfollows existing api-client patterns exactly (apiFetch, encodeURIComponent)Nits (non-blocking):
relativeTimeintime.tsdoes not guard against invalid date strings (NaN fromnew Date("garbage")). Low risk since API always returns ISO dates, but a defensive check would be more robust.Promise.all([getNote(...), listNotes(...)])for slightly faster load, but the current approach is correct and simpler.No blocking issues found.
VERDICT: APPROVE