feat(database): new-view → customise loop — Group/Fields toolbar peers, richer add-view menu#123
Merged
Merged
Conversation
Boards, bar and pie charts no longer fall back to properties[0] when the database has no select/status/relation column — they stay ungrouped (a single "All" group) instead of splintering by an arbitrary text/number property. Applies to both defaultView (sdk) and the view-options layout switcher (viewTypePatch). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
addView now returns the created view so DatabaseView can tell whether its layout defaults found the property it lays rows out by. When they didn't (a date-less timeline/calendar, a location-less map, a dependency-less graph, or a chart with nothing to group by), the View options popover — now controllable, state lifted into DatabaseView — opens right after the view is added. Configured views and config-free layouts open quietly, so the timeline canvas-click flows stay clean. e2e: the view-setup sentinel specs drop their now-redundant explicit 'View options' open click; new spec covers open-vs-quiet both ways. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
- Group button (reuses GroupByPicker, incl. its "+ New select property"
sentinel which closes the popover once wired); boards get the swimlane
sub-group picker too.
- Fields button toggles the view's visible properties via the checklist
extracted from View options into a shared PropertyVisibilityList.
- A removable grouping chip mirrors SortChips so the active grouping is
visible at a glance and one click to drop (also clears a board's
sub-group).
- ViewOptionsMenu now shares the groupable/fieldable view-type sets.
i18n: database.toolbar.{group,fields,removeGrouping} in en/de/ja/zh.
e2e: parity spec covers toolbar grouping, chip removal, and field toggling.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
Add-view menu items are now two lines — the layout name plus a one-line
hint (mirroring the slash menu) — and layouts that need a property
(timeline/calendar → date, map → location, graph → dependency, charts →
group-by) carry a requirement note. aria-label pins each menuitem's
accessible name to exactly the layout name, so locators stay stable.
i18n: database.addView.{hints,needs}.* in en/de/ja/zh.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
…menu Export CSV / Import CSV are whole-database data actions, not per-view settings — they now live in the right-click database menu (below New row) instead of the View options popover. Export still honours the active view's filters/sorts/search (visibleRows). e2e: the parity CSV specs drive the context menu (right-click the toolbar row count) instead of View options. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
…rt setup wording Choosing a "+ New … property" sentinel in the View options now closes the popover once the property is created and wired, revealing the configured view directly (and sidestepping the Escape-after-rerender quirk). The chart setup card's create button now names the column it mints — 'Create a Category property and use it' (en/de/ja/zh) — matching database.setup.names.category. e2e: the view-setup sentinel specs assert the self-close instead of toggling the popover shut. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
…ing itself Two focus races killed the popover right after 'Add view': - the closing add-view menu returned focus to its trigger a beat after the popover opened — a focus-outside dismissal on arrival. The menu no longer restores focus on close (onCloseAutoFocus preventDefault), and the View options popover ignores focus-outside dismissal outright (pointer-outside and Escape still dismiss). e2e: sync on the popover's own name input (the menu's exit-animation wrapper made a bare popper-wrapper count pass too early) and wait out the popover teardown before clicking the Table tab (its Layout grid has a colliding 'Table' button). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
…setup card Adding an unconfigured view (date-less timeline/calendar, location-less map, dependency-less graph, group-less chart) auto-popped the View options open over the view body. But the in-body ViewSetupCard already handles those exact cases with a focused one-click create-and-wire path, so the auto-popover only obscured it. Remove the auto-open entirely and make the setup card the single first-run surface. Drops the plumbing that only propped up the auto-open: the controlled open/onOpenChange wiring on ViewOptionsMenu, the popover's onFocusOutside guard, AddViewMenu's onCloseAutoFocus, and the now-dead viewNeedsSetup helper. Removing the focus guards also fixes two keyboard-focus nits (focus no longer gets trapped away from the trigger). Reverts the e2e to opening View options explicitly and asserting the in-body setup card. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
…p, align category wording Three view-customise nits from review: - The add-view menu shared the layout hint and its "Needs a … property" note on one truncated line in a w-64 menu, so the requirement note — the most useful signal — was always clipped away. Drop the truncate and let it wrap. - GroupChips rendered with no view-type gate, so switching a grouped board to a non-groupable layout (calendar/graph) left a stray, inert grouping chip. Gate it on GROUPABLE_VIEW_TYPES to mirror GroupMenu. - The chart setup card mints a "Category" property, but the group-by "+ New …" sentinel still read "select". Align the sentinel to "category" across all four locales for cross-surface consistency. 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 and customising a database view was buried. Grouping and field visibility lived only inside View options (a settings popover most people never open), so the two most common view tweaks were effectively hidden. The add-view menu was signal-free — a column of icons with no hint of what each layout does or needs. Group-by splintered on free-text property names, and CSV import/export sat mid-config in the toolbar instead of with the database's other actions.
Tracks the Notion epic Epic: Database new-view → customise loop (IA 2026-07). Closes DB-R2 / DB-R5 / DB-R6 / DB-R7 / DB-R8.
Design review (Devon) asked to drop R4's auto-open of View options for unconfigured new views: R1's in-body
ViewSetupCardalready handles those exact cases with a focused one-click create-and-wire path, and the auto-popover only obscured it. R4's auto-open is removed here in favour of that single in-body surface. The remaining polish items — 2-click grouping and a visible context-menu trigger — are tracked as DB-R9.Solution
GroupandFieldsbuttons beside Filter/Sort, plus a removable Group chip (mirrors Filter/Sort chips). Field visibility is a sharedPropertyVisibilityListreused by the toolbar popover and View options, so both stay in lockstep.Key files:
DatabaseView.tsx,databaseMenus.tsx,sdk/database.ts, i18n ×4 (en/de/ja/zh). No new dependencies.Before / After
Only Filter / Sort / View — grouping + fields hidden in View options
Group + Fields sit beside Filter / Sort
Bare labels, no signal
One-line description + wrapped "Needs a … property" note
Removable chip shows the active group-by
Toggle columns straight from the toolbar
Test procedure
pnpm verify— green:build:libs,typecheck(6 projects),lint, unittest, andtest:e2e(server + MCP, 40 checks passed).DB web e2e (
pnpm --filter @book.dev/web exec playwright test), all green:database-view-setup.spec.ts— 8 passed (setup cards + View-options sentinels, reverted to opening View options explicitly and asserting the in-body setup card).database-parity.spec.ts,database-timeline.spec.ts,database-charts.spec.ts,database-context-menu.spec.ts— 55 passed (includes the R5toolbar group + fieldsspec).database-charts.spec.ts,database-context-menu.spec.ts,database-map.spec.ts,database-views.spec.ts— 14 passed.Operational notes
Verify green. Gates: code review ✓ (Quinn, approved); design review ✓ (Devon, after this revision — R4 auto-open dropped, add-view requirement notes un-clipped, stray group chip gated, category wording aligned).
🤖 Generated with Claude Code
https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w