Skip to content

feat(database): actionable setup cards for new views + atomic property-for-view#121

Merged
eliotlim merged 2 commits into
mainfrom
feat/db-view-setup-cards
Jul 11, 2026
Merged

feat(database): actionable setup cards for new views + atomic property-for-view#121
eliotlim merged 2 commits into
mainfrom
feat/db-view-setup-cards

Conversation

@eliotlim

Copy link
Copy Markdown
Owner

Problem

Creating a new Timeline / Calendar / Map / Graph view on a fresh database dropped the user into a dead-end: a dashed placeholder with prose like "Choose a start date property in the view options to lay rows out on a timeline" — but the View-options picker was empty (no compatible property exists yet on a fresh DB) and there was no create-it path on the surface. Recovery meant leaving the view, opening View options, discovering the property was missing, going to the schema, adding the right typed column, coming back, and finally pointing the view at it — roughly 10–12 clicks across 3 surfaces. Charts hit the same wall when their group-by was cleared.

Epic: Database new-view → customise loop (IA 2026-07). Closes DB-R1 (actionable setup cards) + DB-R3 ("+ New …" sentinels in the View-options selects). Follow-up polish is already filed as DB-R8.

Solution

A shared ViewSetupCard replaces all 5 dead-end placeholders (timeline, calendar, map, graph, chart) with the fix itself:

  • No compatible property → one disclosed click ("Create a Date/Location/Dependency property and use it") mints the correctly-typed column and points the view at it.
  • A compatible property already exists → an inline picker wires an existing column (no duplicate), with the same one-click create as its last option.

Both paths are backed by a new atomic db.addPropertyForView — a single saveSchema writes the new property and the view reference in one shot. (The naive two-call approach — addProperty then updateView — races a stale-schema closure and drops one of the two writes; doing it atomically fixes that.) The View-options selects carry the same one-step create as a "+ New … property" sentinel option, so the picker and the card mint identical columns.

Key files: ViewSetupCard.tsx (new), useDatabase.ts (atomic addPropertyForView), databaseMenus.tsx (sentinel), the 5 view components (databaseTimeline/Charts/Graph/Map/Layouts.tsx), i18n ×4 (en/de/ja/zh). New deps: none.

Before / After

Behaviour Before After
Add a Timeline view to a fresh DB (the one-click flow — motion is the point)
Dashed dead-end: "Choose a start date property in the view options…" — empty picker, no way to create it here.

One disclosed click: the ViewSetupCard creates the Date property, wires the view, and the live canvas appears — "click anywhere on the timeline to add one."
Static fallback (card → working canvas)
The actionable card, then the dated timeline canvas.

Test procedure

pnpm verify is green on the branch. Observed counts:

  • Unit (pnpm -r run test): 1766 passed — sdk 171 (13 files) · ui 950 (108 files) · server 645 (53 files). 0 failures.
  • New spec packages/web/e2e/database-view-setup.spec.ts: 7/7 passed — the one-click create for timeline / calendar / map / graph, the chart's inline picker over an existing property, and both View-options sentinels ("+ New date property", "+ New dependency property").
  • Adjacent DB e2e green: ran database-view-setup + database-timeline + database-map + database-views + database-board + database-swimlanes + database-gallery together → 34/34 passed (chromium). The setup cards don't regress the existing timeline/map/board/swimlanes/gallery/views flows.

Operational notes

  • No migrations, no env, no irreversible steps. Pure UI + a client-side atomic schema write over the existing saveSchema path.
  • Deferred nits (all reviewer-endorsed, non-gating), tracked as DB-R8: auto-close the View-options popover after a sentinel create, and align the Select / "Category" create-button wording.
  • chart.setup.missing copy is dead-but-defensive (a fresh chart always auto-groups by the Status select, so the "missing" branch isn't reachable today) — kept intentionally.
  • The Escape-after-async-rerender popover quirk (Escape can be unreliable right after a schema save re-renders the panel) is pre-existing, not introduced here; the specs close View options by toggling the trigger instead.

Verify: ✅ green (unit 1766 · DB e2e 34/34 · new spec 7/7) · Gates cleared: code ✅ Quinn · design ✅ Devon

🤖 Generated with Claude Code

eliotlim and others added 2 commits July 11, 2026 18:05
…h/chart views

Adding a Timeline, Calendar, Map, Graph, or Chart view to a database
without the property it lays rows out by used to dead-end on a dashed
prose hint pointing at an empty View-options picker (~10+ clicks to
recover across three surfaces). The five placeholders are now a shared
ViewSetupCard that carries the fix itself:

- no compatible property -> one disclosed click creates the typed
  property (range date / date / location / dependency / select) AND
  points the view at it, in a single atomic schema write
  (useDatabase.addPropertyForView - two sequential saves would have the
  second spread a stale schema closure and drop the new property);
- compatible properties exist -> an inline picker selects one instead
  of minting a duplicate column, with the same one-click create as its
  last option.

Timeline's created date is a start->end range so bars have width and
edge-resize out of the box; created names are localized and de-duped
("Date", "Date 2", ...). New strings in en/de/ja/zh. New e2e spec
covers the one-click path for all four views plus the chart's
existing-property picker; the existing database-timeline spec (which
adds its own "Due" column first) is untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
The View-options property pickers (Start date, End date, Location,
Dependencies, Group by, Sub-group by) each gain a "+ New … property"
sentinel option that creates the typed property and selects it in one
step, reusing the R1 setupPropertyInput + addPropertyForView helpers so
both paths mint identical, name-deduped, localized columns. On a
date-less database, View options -> Start date -> "+ New date property"
now renders the timeline immediately.

Creation stays a disclosed, user-picked action (no silent auto-create),
and the Add view / View options / Add column names and view-type menu
items are untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app.book.pub Ready Ready Preview, Comment Jul 11, 2026 10:51am

Request Review

@eliotlim eliotlim merged commit 2c0ddbd into main Jul 11, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant