feat(database): actionable setup cards for new views + atomic property-for-view#121
Merged
Conversation
…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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
ViewSetupCardreplaces all 5 dead-end placeholders (timeline, calendar, map, graph, chart) with the fix itself:Both paths are backed by a new atomic
db.addPropertyForView— a singlesaveSchemawrites the new property and the view reference in one shot. (The naive two-call approach —addPropertythenupdateView— 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(atomicaddPropertyForView),databaseMenus.tsx(sentinel), the 5 view components (databaseTimeline/Charts/Graph/Map/Layouts.tsx), i18n ×4 (en/de/ja/zh). New deps: none.Before / After
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."
The actionable card, then the dated timeline canvas.
Test procedure
pnpm verifyis green on the branch. Observed counts:pnpm -r run test): 1766 passed — sdk 171 (13 files) · ui 950 (108 files) · server 645 (53 files). 0 failures.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").database-view-setup+database-timeline+database-map+database-views+database-board+database-swimlanes+database-gallerytogether → 34/34 passed (chromium). The setup cards don't regress the existing timeline/map/board/swimlanes/gallery/views flows.Operational notes
saveSchemapath.chart.setup.missingcopy is dead-but-defensive (a fresh chart always auto-groups by the Status select, so the "missing" branch isn't reachable today) — kept intentionally.Verify: ✅ green (unit 1766 · DB e2e 34/34 · new spec 7/7) · Gates cleared: code ✅ Quinn · design ✅ Devon
🤖 Generated with Claude Code