feat: dashboard home — "resume last viewed document" strip #144
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Context
The home page (
/) is being transformed into a dashboard (see related dashboard epic). One of the planned widgets is a "resume last viewed document" strip — a full-width, tappable element placed between the search bar and the main widget grid.This feature requires no backend changes. It is implemented entirely with
localStorage.Placement
The strip sits between the search bar and the dashboard widget grid. It is only rendered when a
lastViewedDocumententry exists inlocalStorage. If absent, nothing is shown — no empty state, no placeholder.Behaviour
Write: When the user visits any document detail page (
/documents/[id]), store the document inlocalStorage:Write on page load (in
onMountor a$effect), not on navigation away.Read: On the home page (
/), read the entry inonMountand render the strip if present.Suppression: Hide the strip when any search filter is active (same condition that hides all dashboard widgets). The strip is a dashboard element, not a search result.
Stale entry: No expiry needed for v1. The entry persists until overwritten by a newer document visit. This is intentional — if the user hasn't visited any document since their last session, they still see the resume prompt.
Edge case — document in "Recently Added": Do not suppress the strip if the document also appears in the Recently Added list. The strip is contextual ("you were specifically here"), not just chronological.
Visual Spec
w-full)py-3 px-4— effective ~48px, touch target ✓ (≥44px)bg-surfaceborder border-line rounded-smtext-ink-3,aria-hidden) + label"Zuletzt angesehen"(text-xs font-bold uppercase tracking-widest text-ink-3) + document title (text-sm font-medium text-ink, truncated withtruncate)→arrow (text-ink-3)border-accent, title color →text-primaryfocus-visible:ring-2 focus-visible:ring-accent— neveroutline: nonewithout replacementbg-surface,text-ink, etc.) — no hardcoded colors neededThe visual weight must be lighter than the widget cards — this is service information, not a primary action.
Accessibility
<a>element wraps the entire strip — full touch target, keyboard navigablearia-label:"Zuletzt angesehen: [document title]"on the link elementaria-hidden="true"text-sm= 14px — acceptable; prefertext-baseif surrounding layout permits)Implementation Checklist
lastViewedDocumenttolocalStoragein/documents/[id]/+page.svelteon mount+page.svelte(home) — conditional on no active filtersaria-labelpresent on the linklocalStorageentry is absentMerged into #145 — the resume strip is already fully specified there (layout, behaviour, visual spec, accessibility, and implementation checklist). All work for this feature will be tracked and implemented under #145.