Skip to content

Store a Base default view independent of tab order - #121

Merged
mr-kelly merged 4 commits into
mainfrom
cursor/default-view-setting-299f
Nov 20, 2026
Merged

mr-kelly merged 4 commits into
mainfrom
cursor/default-view-setting-299f

Conversation

@mr-kelly

@mr-kelly mr-kelly commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Verification: 🟢 Fully verified

Problem and fix

A Base can now choose its opening view independently of tab order. The existing node settings store the optional default; an absent, invalid, or archived view falls back to the leftmost active view. Archiving the selected default clears the key.

Acceptance also found and fixed a redirect race: after saving a new default, returning to the Base could use an invalidated cached setting before its refetch finished. The route now waits for that fetch, preserving its existing error fallback. A real QueryClient/QueryObserver regression failed before the fix and passed afterward.

Validation

The changed feature paths were exercised in Chromium with genuine Inter/Fraunces fonts, backed by real local databases and HTTP/RPC calls. Busabase Cloud checks used real Better Auth sessions and an isolated migrated PGLite database. Screenshot/video links were fetched successfully after upload.

Verified Save → re-enter → selected default in both local Busabase and Cloud; archived the default through the real API and verified its database setting clears and the browser opens the leftmost view. A Cloud read-only grant returns 403 on a settings write and leaves the setting unchanged. Focused settings/view tests, database integration tests, and scoped typechecks pass.

The CI coverage run also exposed an existing Gantt test stopping at 200 of 250 rows while its third page was loading. Its bounded wait now allows 5 seconds and retains the complete 250-row assertion; focused pagination tests pass.

Known risk: none identified within these feature paths. Merge this before #122.

Story: choose where a Base opens

Choose Review grid without moving its tab.

Choose Review grid without moving its tab.

Re-enter the Base and arrive at the saved default.

Re-enter the Base and arrive at the saved default.

Archive that default; the Base opens its remaining leftmost view.

Archive that default; the Base opens its remaining leftmost view.

Local browser recording · Cloud browser recording

Fixes #92

A Base still opens on its leftmost tab when settings.defaultViewSlug is
unset. Setting that slug on the node opens that view instead, the node
settings dialog can choose it, and archiving the named view clears it.

Co-authored-by: Kelly Peilin Chan <[email protected]>
@mr-kelly

Copy link
Copy Markdown
Contributor Author

Verification level: 🟡 Partial verification — I independently re-ran the package tests and typecheck, and reviewed the diff, but I could not click through a real dashboard. The PR's "Deploy preview" job deploys busabase-cms-example (https://busabase-cms-example-gykw7k7ej-bika.vercel.app), not the Busabase dashboard, so it cannot prove this setting.

Problem

A bare /base/<slug> already opens the leftmost tab. There was no way to pick a default view without changing tab order.

Root cause

nodeSettingsSchema only had airappEngine. resolveDefaultViewPath always used tab order.

Fix

The PR adds optional settings.defaultViewSlug, a Default view picker in node settings (active views plus Leftmost view, which clears the key), and routes a bare Base URL to that slug when it still names an active view. A missing, null, or unknown slug keeps the leftmost-tab behavior. Archiving the named view removes the key. The settings write still replaces the whole object; the dialog sends both airappEngine and defaultViewSlug so one save does not wipe the other. This is a new implementation, not a reuse of closed PR #93.

Validation

  • Method: I checked out 51efa89 and ran, in packages/busabase-core: vitest on view-order.test.ts, node-settings-default-view.dom.test.tsx, node-settings-info.dom.test.tsx, and tests/base-default-view-and-order.test.ts; then tsc --noEmit. I also read the schema, router, settings dialog, and view-delete merge. I did not start a dashboard or drive a browser.
  • Result: 4 files, 27 tests, all passed. Typecheck passed. The tests cover the slug winning over tab order, invalid/null falling back to the leftmost tab, the picker writing defaultViewSlug without dropping airappEngine, rejecting an empty string and an unknown key, and clearing the key when the named view is archived (but not when a different view is archived).
  • Verification level: 🟡 Partial verification — the real code paths above were exercised in tests, but there is no click-through of the settings dialog or of a bare /base/<slug> redirect in a running dashboard.
  • Known risk / not covered:
    • No live dashboard evidence. The GitHub "Deploy preview" is the CMS example site, so it is the wrong surface for this change.
    • At review time, GitHub test, coverage, e2e, and Docker build were still running. Lint, typecheck, and Email SDK had already passed.
    • The German string defaultViewLeftmost is "Linke Ansicht" (left view), which is slightly looser than "leftmost."
    • PATCH /nodes/{nodeId}/settings still replaces the whole settings object. Callers outside this dialog must send every key they want to keep.

No screenshots: verification did not go through a browser.

The default-view field asks bases.listViews as soon as the dialog renders.
A client that only implements the node writes used to throw before the
name field could focus.

Co-authored-by: Kelly Peilin Chan <[email protected]>
@mr-kelly
mr-kelly marked this pull request as draft November 20, 2026 03:23
mr-kelly and others added 2 commits November 20, 2026 11:44
The 250-row timeline loads three pages of 100. The coverage run reached
the length check at 200, inside the default one-second wait.

Co-authored-by: Kelly Peilin Chan <[email protected]>
@mr-kelly
mr-kelly marked this pull request as ready for review November 20, 2026 04:28
@mr-kelly
mr-kelly merged commit fb71bcb into main Nov 20, 2026
10 checks passed
@mr-kelly
mr-kelly deleted the cursor/default-view-setting-299f branch November 20, 2026 04:39
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.

Base: let a saved view open by default instead of the all-records grid

2 participants