feat: port dashboard home page from playground #76
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!76
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "69-port-dashboard-home"
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
Changes
src/routes/+page.svelte: Rewrote template to match playgroundindex.htmlstructurehome-titleclassnote-cardwithnote-card-rowgrid (badge + title + time)project-gridandproject-cardwith coloredtree-dotnote-card--compactwith board name contexttypeColorimport for project dot colors andbadgeClasshelperTest Plan
/-- three sections visible: Recently Modified, Projects, In Progress/dashboardis unchangednpm run buildpassesnpm run checkpasses with 0 errorsReview Checklist
Related Notes
forgejo_admin/pal-e-app #69-- the Forgejo issue this PR implementspal-e-app-- the project this work belongs toCloses #69
QA Review -- PR #76
What looks good
index.htmlliterally:content--home,home-title,home-sectionwithsidebar-label,note-card-rowgrid layoutapp.cssclasses -- no style duplicationonMount, same API calls, same error handling)badgeClasshelper cleanly mapsnote_typeto CSS badge classtypeColorimport wired for project card dotssvelte-checkpasses with 0 errorsNits
Dead code:
boardsfetch --listBoards()is still called inonMountand theboardsstate variable is declared, but neither is used in the template anymore (Board Progress section was removed). ThelistBoardActivitycall is still needed for in-progress items, butlistBoardsandboardsare now dead weight. Should be cleaned up.PRIVATE badge dropped -- The old page showed a red
PRIVATEbadge foris_public === falsenotes. The playground omits this. Intentional per the port spec (copy playground literally), but worth confirming this is desired since authenticated users will see private notes without any visual indicator.VERDICT: APPROVE with nits
The dead
boardsfetch is minor cleanup. The PRIVATE badge drop follows the playground spec. Both can be addressed in a follow-up if desired.Fixed nit #1: removed unused
boardsstate variable in0e75b7f. ThelistBoardscall is retained since it's needed to buildboardMapfor in-progress item board name resolution.Nit #2 (PRIVATE badge dropped) is intentional per the playground port spec -- no action needed.
PR #76 Review
DOMAIN REVIEW
Tech stack: SvelteKit 5 (runes mode), TypeScript, pure CSS design system (no Tailwind).
What the PR does: Replaces the old home page layout (greeting, list-based sections, board progress bars, ~280 lines of scoped CSS) with the playground's card-based dashboard design that uses global CSS classes from
app.css. Single file changed:src/routes/+page.svelte. Net -292 lines.CSS class audit -- all global classes referenced in the new template are properly defined in
src/app.css:content--home(line 527),home-title(line 532),home-section(not found explicitly -- see nit below)sidebar-label(line 236),note-list(line 552),note-card(line 553)note-card-row(line 583),note-card-title(line 571),meta-time(line 314)badge/badge--{type}(lines 318-340),project-grid(line 606),project-card(line 611)tree-dot(line 266),project-card-name(line 621),project-card-stats(line 629)note-card--compact(line 573),note-card-project(line 570),view-all(line 543)empty-state(line 772),data-typeattribute selectors (lines 564-568)TypeScript correctness:
typeColorimport from$lib/colorsis valid -- function exists atsrc/lib/colors.ts:39badgeClasshelper correctly handlesnullnote_type with fallback to barebadgeclassBoardItem.item_typeis typed asstring(not nullable) inapi-client.ts:47-- safe to pass directly tobadgeClass, thoughbadgeClassacceptsstring | nullwhich is wider than needed here (not a bug, just imprecise)boardsstate variable correctly removed;bdslocal still used forboardMapconstructionAccessibility:
<div class="sidebar-label">instead of semantic heading elements (<h2>,<h3>). Screen readers will not recognize "Recently Modified", "Projects", and "In Progress" as section headings. The old version used<h2>elements. This is a regression for screen reader navigation.<section>elements are good semantic structure, but without heading children they lose their landmark value per WCAG.role="progressbar"and full ARIA attributes were removed. This was intentional (the feature is gone), so no regression there.Component patterns:
<a>elements (keyboard-navigable, focusable)data-typeattribute on note cards enables CSS-driven left-border coloringnote_slugexists, falls back to board pageBLOCKERS
1. E2E tests will fail -- existing tests not updated (BLOCKER: new functionality with broken test coverage)
e2e/home.spec.tscontains 7 tests that reference selectors and elements removed or renamed by this PR:waitForSelector('.greeting')--.greetingclass removedlocator('.greeting')-- removedgetByRole('heading', { name: 'Recently Updated', level: 2 })-- renamed to "Recently Modified" and changed from<h2>to<div class="sidebar-label">getByRole('heading', { name: 'In Progress', level: 2 })-- changed from<h2>to<div>getByRole('heading', { name: 'Projects', level: 2 })-- changed from<h2>to<div>locator('.project-list')-- class renamed to.project-gridEvery test in the home page suite will fail. The E2E file must be updated to match the new DOM structure. Per QA policy, this is a blocker, not a nit.
NITS
home-sectionclass not defined in app.css: The template usesclass="home-section"on three<section>elements, but I could not find a.home-sectionrule insrc/app.css. If this class has no styles, it is dead markup. If styles are intended, they are missing. Either way, worth confirming.Accessibility: section labels should be headings:
<div class="sidebar-label">Recently Modified</div>should be<h2 class="sidebar-label">Recently Modified</h2>(or<h3>depending on hierarchy). This preserves screen reader navigation and WCAG section landmark semantics at zero visual cost. Thesidebar-labelCSS class does not rely on the element being a<div>.relativeTimeis a candidate for extraction: This utility function is defined inline in+page.svelte. As more pages port from the playground, this pattern will likely be needed elsewhere. Consider extracting to$lib/utils.tsproactively.Hardcoded
'project-page'in typeColor call:style="background: {typeColor('project-page')};"on line ~88 of the new code hardcodes the type string. All projects get the same dot color regardless of any future type differentiation. This matches the playground design but is worth noting for future flexibility.badgeClassparameter type is wider than needed foritem_type:BoardItem.item_typeisstring(non-nullable), butbadgeClassacceptsstring | null. Not a bug, but the null branch is unreachable when called withitem.item_type.SOP COMPLIANCE
refs/pull/76/head; branch likely deleted)forgejo_admin/pal-e-app #69referenced,Closes #69included.sveltefile, no credentialsfeat: port dashboard home page from playgroundPROCESS OBSERVATIONS
VERDICT: NOT APPROVED
The E2E test suite at
e2e/home.spec.tsreferences DOM selectors and elements that this PR removes or renames. All 7 tests in the home page suite will fail. The test file must be updated to match the new DOM structure before this PR can be approved.