feat: port project page layout from playground #80
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!80
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "73-port-project-page"
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
pal-e-docs-playground/note-project.htmlinto a dedicatedProjectLayoutSvelte componentnote_type=project-pagenow render with specialized sections (board summary, repos table, recent notes) instead of the generic NoteLayoutrelativeTimeutility for reuse across componentsChanges
src/lib/components/ProjectLayout.svelte(new): Project page component with header badges, block content via BlockRenderer, board summary progress bar from item_counts, repos table filtered by project, and recent notes listsrc/lib/time.ts(new): SharedrelativeTimeutility extracted from inline definition on home pagesrc/routes/notes/[slug]/+page.svelte: Dispatch toProjectLayoutwhennote.note_type === 'project-page', otherwise fall through to existingNoteLayoutTest Plan
note_type=project-pageand verify the project layout renders with breadcrumb, header, blocks, board summary, repos table, and recent notesnpm run buildpasses with zero errorssvelte-checkpasses with zero new errors (only pre-existing autofocus warning)Review Checklist
Related Notes
pal-e-app-- SvelteKit frontend projectQA Review -- PR #80
Findings
1. Redundant API call for total note count (nit)
ProjectLayout.sveltelines 40-43: Fetches notes withlimit: 5, then makes a secondlistNotescall without limit just to getallNotes.length. This doubles the API load for every project page render. Consider using only one call (no limit) and slicing the first 5 client-side, or adding a count endpoint.2.
isAuthenticatedcalled from two sources (nit)ProjectLayout.svelte: TheauthPropis passed from the parent, butonMountalso callsisAuthenticated()directly (line 27) for theoptsbag. Should use the prop consistently or the function consistently -- not both. Currently they will agree, but it is a maintenance hazard if they diverge.3. Duplicate
<svelte:head>title (nit)Both the parent
+page.svelte(line 65) andProjectLayout(line 65) set<title>. Whennote_type === 'project-page', both render. SvelteKit uses the last one, so the ProjectLayout title wins -- it works, but the parent's title tag is unnecessary for this path.4. No error handling for project-specific data fetch (minor)
ProjectLayout.svelteonMount: ThePromise.allfor boards/repos/notes has no try/catch. If any of these secondary fetches fail (e.g., boards API is down), the component silently shows incomplete data with no indication to the user. The parent page already caught the primary note fetch, but the secondary data is unprotected.5. Build and type check (pass)
PR description confirms
npm run buildandsvelte-checkboth pass with zero new errors.VERDICT: APPROVE with nits
All findings are nits or minor. The core implementation is correct: note_type dispatch works, playground layout is faithfully ported, CSS uses existing design tokens, and block rendering reuses BlockRenderer. Ship it.
14aec5ef77d529484d32