Files
pad/web
xarmian abe8d93c10 fix(web): per-view titles, counts and empty states; a failed quote is not silent (IDEA-2843)
Codex round 3.

1. The split left every view describing the WHOLE feed. The comments
   section was headed "Timeline" with a count of every entry, so an item
   with three activity entries and no comments read "Timeline 3" over an
   empty list — a count of things the reader cannot see. And `showEmpty`
   was computed over the whole feed, so a view whose own slice was empty
   rendered nothing at all: no entries, no explanation.

   Title, count and empty state now describe what the view RENDERS.
   `title` and `emptyLabel` are props: "Comments" / "No comments yet." on
   Details, "No changes yet." / "No versions yet." on the tabs. The
   deliberate choice this reverses is mine — I passed showEmpty over the
   whole feed on the grounds that a filtered-out tab must not claim the
   item has no history. Right premise, wrong fix: the answer is to say
   something true about the slice, not to say nothing.

2. A failed quote was silently discarded. `appendMarkdown` returns false
   precisely so "did nothing" is distinguishable from "inserted" — and the
   only caller threw the boolean away and hid the menu, putting the silent
   no-op back exactly where the handle was built to remove it. A false now
   keeps the menu and the selection and reports it.

Gates: 119 files / 2002 unit tests, svelte-check 0 errors, 14 e2e in
desktop-chromium against a binary rebuilt from this tree. The
discarded-return fix has a negative control — restoring the bare
`onComment(...)` call fails the new test. (A first attempt at that control
failed on shell quoting and silently ran against UNMUTATED code; it was
re-run properly before this claim.)

Claude-Session: https://claude.ai/code/session_011Q4b1iHtJtSyMs7BA2ySxo
2026-09-02 19:42:50 +00:00
..
2026-03-26 01:52:36 +00:00
2026-03-26 01:52:36 +00: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