Files
pad/web
xarmian 2cd8932148 feat(board): confirm + undo toast for destructive bulk actions (TASK-1674) (#676)
* feat(board): confirm + undo toast for destructive bulk actions (TASK-1674 frontend)

Extend the toast store with an optional inline action button (label +
onAction) and render it in ToastContainer. Wire Undo onto the two
destructive bulk lane actions:
- Archive all → "Archived N" with Undo → bulk `restore` of the affected
  ids (the backend op from the companion PR).
- Move all to → "Moved N" with Undo → bulk move back to the source lane
  (all lane items shared its status).

runBulk gains an optional undo callback (invoked with the affected ids)
and gives undo-bearing toasts a longer 7s dwell. Archive keeps its
in-menu count confirm (TASK-1672); the undo toast is the new safety
affordance replacing the old single-item inline confirm.

* fix(board): undo targets the original workspace per Codex review (round 1)

The 7s undo toast is global and runBulk read the live wsSlug, so
navigating to another workspace before clicking Undo would target the
wrong one. Thread an explicit captured `ws` through runBulkOn; the
archive/move handlers capture wsSlug at action time and the undo closure
reuses it, so a deferred undo always hits the workspace the action ran
on. Immediate (non-undo) actions keep a thin runBulk bound to live ws.
2026-05-30 22:37:32 -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
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
      activity/              ActivityFeed
    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