Files
pad/web
xarmian 2bacd54558 feat(web): the Needs you page at /console/needs (TASK-3923) (#2287)
* feat(web): the Needs you page at /console/needs (TASK-3923)

Cross-workspace inbox of what waits on the viewer: grouped by workspace,
server-side sort (age default), Dismiss and Defer (marker echoed verbatim,
local-time presets), Hidden view with Restore, Load more, degraded notice.

Claude-Session: https://claude.ai/code/session_01D6M9onL7HhMovW8DZbs6f5

* fix(web): needs page: copy, acted-row filter, failed-reload counts, one defer menu (TASK-3923 r1)

- Hidden view copy: dismissals return on news, deferrals at their time.
- Rows acted on are filtered from any list request that started before the
  action completed (first load, Load more, quick sort/view reload).
- A failed reload clears total and workspace counts (hidden is kept: it
  counts everything hidden, independent of sort and view).
- DeferMenu closes on an outside press; the page keeps one menu open.

Claude-Session: https://claude.ai/code/session_01D6M9onL7HhMovW8DZbs6f5

* fix(web): a filtered list response has its counts adjusted for the rows dropped (TASK-3923 r2)

Claude-Session: https://claude.ai/code/session_01D6M9onL7HhMovW8DZbs6f5

* fix(web): a stale list response triggers one fresh page-1 load; adjustCounts removed (TASK-3923 r3)

Class fix: a load or loadMore response whose request started before the latest completed dismiss/defer/restore keeps the display filter and then issues exactly one fresh load of the current view, through the ticket guard. The error path also clears degraded.

Claude-Session: https://claude.ai/code/session_01D6M9onL7HhMovW8DZbs6f5

* fix(web): needs page: empty state needs no cursor; a settle that did not apply refetches once (TASK-3923 r4)

H-F1: the empty state renders only with no rows and no cursor, and a settle
that empties the rows with a cursor set reloads page 1. H-F2: an action that
completes without settling the current rows refetches the current view. All
refetch paths share one marker, so one action completion refetches at most once.

Claude-Session: https://claude.ai/code/session_01D6M9onL7HhMovW8DZbs6f5

* fix(web): the automatic needs refetch is quiet: no Loading swap, errors kept, a failure keeps the list (TASK-3923 r5)

Claude-Session: https://claude.ai/code/session_01D6M9onL7HhMovW8DZbs6f5

* test(web): restore an assertion a replace touched in the dismiss test (TASK-3923 r5)

Claude-Session: https://claude.ai/code/session_01D6M9onL7HhMovW8DZbs6f5
2026-10-22 17:58:20 -04:00
..
2026-03-26 01:52:36 +00:00
2026-03-26 01:52:36 +00:00

Pad Web UI

SvelteKit 2 + Svelte 5 frontend for Pad, compiled to static files and embedded into the Go binary.

Development

npm install
npm run dev          # Dev server at localhost:5173 (proxies API to localhost:7777)
npm run build        # Production build to build/
npm run check        # Type checking with svelte-check

When developing, run the Go backend separately with make dev from the project root.

Building for Production

Do not build in isolation. Always use make build from the project root — this builds the web frontend, then compiles the Go binary with the build output embedded via //go:embed.

Stack

  • Svelte 5 with runes ($state, $derived, $effect)
  • SvelteKit 2 with adapter-static (SPA mode)
  • Tiptap block editor with markdown round-trip
  • svelte-dnd-action for drag-and-drop in board/list views
  • SSE for real-time updates
  • TypeScript throughout

Structure

src/
  routes/                    SvelteKit pages
    +layout.svelte           App shell (sidebar + main)
    +page.svelte             Landing/redirect
    [workspace]/
      +page.svelte           Dashboard (collections, phases, activity)
      +layout.svelte         SSE connection per workspace
      [collection]/
        +page.svelte         Collection view (board/list)
      [collection]/[item]/
        +page.svelte         Item detail + editor
      conventions/            Purpose-built conventions page
      playbooks/              Purpose-built playbooks page
      settings/               Workspace settings
  lib/
    api/client.ts            HTTP API client
    components/
      layout/                Sidebar, navigation
      editor/                Tiptap editor, raw markdown editor
      fields/                FieldEditor, relation picker
      items/                 ItemCard, ItemDetail
      collections/           BoardView, ListView
      common/                StatusBadge, badges, modals
      search/                CommandPalette
    stores/                  Svelte 5 reactive stores
      workspace.svelte.ts    Workspace state
      collections.svelte.ts  Collection + item state
      ui.svelte.ts           Sidebar, mobile state
    types/index.ts           TypeScript types and constants
  app.css                    Global styles and design tokens