Files
pad/web
xarmian 5ee40d728f feat(attachments): mobile phone-sheet layout for the viewer (TASK-2492)
The AM-3 Lightbox-owned phone-sheet layout (PLAN-2392 3c-ii / T5). A
reactive `isSheet = $derived(viewport.isMobile)` toggles a `.lightbox-sheet`
class on the existing dialog root, and CSS scoped under that class re-lays-out
the EXISTING chrome into a bottom-anchored sheet: the toolbar and meta leave
their desktop absolute anchors and dock, stacked, to the bottom edge (via
`position: static` + `order`), the stage fills the space above (and becomes
its own containing block so its overlays centre over the shortened stage, not
the dock), and the counter moves to the top-left.

A class, not a bare `@media`, so JS and CSS share the one app breakpoint and
the flip is a DOM fact the modal-contract jsdom suite can drive and read. The
layout is fully layout-independent of the modal contract: the portal, lease,
focus trap, escapeStack registration, loader and zoom transform are untouched,
and nothing is keyed on the viewport, so a breakpoint flip mid-open re-lays-out
the SAME instance with zoom/selection state intact. No `BottomSheet`/`Menu`
instance nests, no swipe dismissal, and no `touch-action`/pointer-capture
changes (per the amended DR-6). Every rule is scoped under `.lightbox-sheet`,
so the desktop layout is byte-identical, and the sheet chrome carries its own
forced-colors boundary.

Tests: sheet selection, a mid-open flip proving same-instance re-layout (root
+ img identity, src + zoom survive), the docked chrome staying excluded from
all three pointer-gesture lists (pointerdown/wheel/dblclick, each with a live
control), no dismissal on a chrome click, and the full modal contract re-run
under the mobile viewport mock. Geometry, touch, `@media`/forced-colors visuals
are named for T7's browser legs.

Claude-Session: https://claude.ai/code/session_01WFBYxdBuSZs2tjipATxAZu
2026-08-10 21:59:41 +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