fix: add Home nav link with active state for dashboard home page #84
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!84
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "69-home-nav-active-state"
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
The dashboard home page port (PR #76) and E2E selector fix (PR #82) completed the core work for issue #69. However, the home page (
/) had no active nav link -- the playground'sindex.htmlshows "Dashboard" as highlighted, but in the SvelteKit app no nav item was active when viewing/. This adds a "Home" link to both the top nav bar and left sidebar with proper active state highlighting.Changes
src/routes/+layout.svelte-- Add "Home" nav link (pointing to/) as the first item in both the top nav bar and sidebar navigation, withisActive('/')binding for active statee2e/home.spec.ts-- Add "Home" to the nav links visibility test; add new test verifying the Home link has theactiveclass on the home pageTest Plan
npm run buildpasses/Review Checklist
npm run build)Related Notes
Closes #69
QA Review
Scope: 2 files, +15/-0 lines. Adds "Home" nav link to top nav bar and sidebar with active state on
/.Findings
No issues found.
class:active={isActive('/')}pattern as all other nav links. TheisActivefunction already handles exact match for/(won't false-positive on/dashboardetc.).tree-itemclass,closeSidebarhandler,tree-item--activebinding..nav-linkwith text "Home" has theactiveclass. Existing nav link assertions preserved.Note: Both the "pal-e" brand link and the new "Home" nav link point to
/. This is standard web convention (brand logo + explicit nav item) and not a concern.VERDICT: APPROVE
PR #84 Review
DOMAIN REVIEW
Tech stack: SvelteKit (Svelte 5 runes), Playwright E2E tests, CSS.
Layout changes (
src/routes/+layout.svelte):nav-link) and the left sidebar (tree-item).isActive('/')function, which already has an exact-match guard for/(line 36-38 on main). This correctly ensures "Home" is only active on exactly/, not on/dashboard,/projects, etc.onclick={closeSidebar}, consistent with all other sidebar nav items.class:active/class:tree-item--activebindings follow the same pattern as every other nav link in the file. No divergence.E2E changes (
e2e/home.spec.ts):Hometo the nav link visibility assertion. Placed first in the list, matching DOM order.test('Home nav link is active on the home page', ...). The test navigates to/(viabeforeEach) and asserts the Home link has theactiveclass.Accessibility: The new
<a>elements are standard anchor tags with text content -- screen readers will read "Home" correctly. No ARIA issues. The sidebar already has the existing a11y-ignore comments for theonclickon<aside>, which is pre-existing and not introduced by this PR.Performance: Two additional
<a>elements in the DOM. Negligible impact.BLOCKERS
None.
NITS
Selector inconsistency in E2E tests: The nav link visibility test uses the role-based selector
nav.getByRole('link', { name: 'Home' }), while the active-class test uses a CSS selectorpage.locator('nav .nav-link', { hasText: 'Home' }). The CSS selector is necessary here becausegetByRoledoes not expose class assertions, so this is actually the correct approach. No change needed -- noting for completeness.PR body template: The Related section is titled "Related Notes" instead of just "Related". Minor deviation from the PR template, but all required information is present.
SOP COMPLIANCE
69-home-nav-active-state)PROCESS OBSERVATIONS
Clean, small PR (15 additions, 0 deletions, 2 files). This is the third PR in the issue #69 chain (after #76 and #82), completing the "dashboard home page from playground" port. The scope is tight: one nav link addition with matching E2E coverage. Deployment risk is minimal -- no logic changes, no API changes, no CSS changes. Change failure risk: very low.
VERDICT: APPROVED