Files
pad/web
xarmian 46c91b9062 fix(web): a lane draft whose lane no longer exists moves to Uncategorized, marked, instead of blocking Save all invisibly (BUG-3043) (#1538)
* fix(web): a lane draft whose lane no longer exists moves to Uncategorized, marked, instead of blocking Save all invisibly (BUG-3043)

A lane draft is keyed by the lane it was typed in, and nothing tied that key
to a lane that still exists. Delete or rename the option, retype the group
field, or regroup the board, and the draft's card vanished while its text
stayed in the page's map. "Save all" then either sent the dead lane value
(the server refused it; the dialog could not complete, blocked by a draft the
user could not see) or, where the client refused it first, read the create's
null as success and deleted the text behind a toast.

Lead ruling, RE-HOME: an orphaned draft shows inside the Uncategorized lane,
marked "Moved from <lane>", and saves there. The lane is rendered for it even
when no item is in it. Where Uncategorized cannot receive the create (the
field omits a blank and a default would fill it, or it is required), the draft
is kept, a notice names the lost lane, and Save all is blocked for that
reason. Whether Uncategorized can receive it follows the server's validator
per field type (laneDrafts.ts header).

quickCreateInColumn refuses by throwing, never by returning null, and the
Save-all loop (saveAllDrafts) treats a null with the identity held as a
failure that keeps the text.

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

* test(items): pin the validator facts the lane-draft re-home rule mirrors (BUG-3043)

draftSaveTarget decides client-side whether Uncategorized can receive a
draft's create. It mirrors three facts about ValidateFields: a required
select stores '' (required fires only on an absent or nil key, and ''
skips the options check), a required multi_select stores [], and an
omitted key takes its default or is refused as required. Pinned here so a
validator change fails a Go test instead of leaving the mirror wrong in
silence. Removing the select's '' exemption turns fact 1 red.

Claude-Session: https://claude.ai/code/session_01UcaMsmoCt8u7VpJhCNxiJJ
2026-09-25 05:53:33 -04: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