v1.1 #3
Loading…
Reference in a new issue
No description provided.
Delete branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Make the TopBar SQL control conditionally enabled per docs/specs/sql-query.md + ui-shell.md + selection-model.md: enabled when the effective selection contains >=1 SQL-compatible file (that compatible subset is the source set), else when the highlighted file is compatible (single source; size resolved from the TanStack Query LIST cache since ListSelection carries no size; cache miss disables, no crash), else disabled with the tooltip 'Select or highlight a CSV, TSV, TAB, TXT, JSON, or Parquet file to query'. Click snapshots the effective sources into useSqlStore.setSources before navigate('/sql') — identical effect to the action-bar entry point. Selection-derived sources are sorted by key (localeCompare) to match the action-bar ordering exactly, so the two entry points agree (F2-T2 will reconcile both to true insertion order for the default-query rule). Promote QUERYABLE_EXTS/isQueryableExt/aliasFromKey into a new shared module sql/compatibility.ts (re-exported via the sql barrel) and refactor BucketPage to import them (pure extraction, no behavior change). Tests: +topbar gating tests (enabled/disabled states, verbatim tooltip, click snapshot + navigate, cache-miss fallback, case-insensitivity, nested-key alias, shared-module parity, and a >=2-source sorted-order regression guard). Web unit 1195 pass; typecheck/lint/build/duckdb-pin clean. Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>Pre-fill the SQL editor with SELECT * FROM '<alias>' on every (re)entry to /sql per docs/specs/sql-query.md (Default query on (re)entry). The alias targets the LAST source = the most recently selected compatible file (insertion order of the snapshot), with a lexicographically-greatest-alias fallback for the indeterminate case. A mount-only effect in SqlRunner writes the default once per entry (route mount) and does not re-fire on in-workbench source changes, so a stale prior query is not retained across visits while user edits are preserved while remaining in the workbench. Adds pure helpers lastSourceAlias / fallbackLexicographicallyGreatestAlias / defaultSqlForSources to sql-store. Ordering reconciliation: the spec defines 'last' as insertion order, but F2-T1 had both SQL entry points sort the snapshot by key, discarding toggle order. Reconcile both entry points to true insertion order — TopBar.computeEffectiveSqlources no longer key-sorts; BucketPage.handleOpenInSqlRunner iterates selectedKeys directly (insertion order) with the highlight fallback. Both entry points remain byte-identical for the same selection ('identical effect'). The action-bar's bulkObjects key-sort for delete/download is intentionally left intact (stable-UX, unrelated to SQL). Tests: +sql-store helper tests, +sql-runner default-query lifecycle (entry re-writes, in-workbench edits preserved on chip add/remove), updated topbar ordering test to insertion order, +bucket-page reconciliation guards proving SQL=insertion while delete/download=key-sorted. Web unit 1223 pass; typecheck/lint/build/duckdb-pin clean. Note: alias single-quote escaping is a latent spec gap (S3 keys may contain apostrophes); implementation follows the spec's literal template — flagged as a non-blocking spec follow-up. Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>Make the SQL Runner leave-able and prevent a dead no-source state per docs/specs/sql-query.md (Exit + Auto-close on empty context; success criteria 97-99). Add a SqlOrigin {bucket,prefix} captured at entry (extend setSources with an optional origin arg, backward-compatible); both entry points (TopBar + action-bar) pass {bucket,prefix}. Add a 'Back to browser' control in SqlToolbar (always available; navigates to the origin; leaves sources still loaded). Auto-close: removing the LAST source chip commits setSources([]) then navigates back to the origin list view before any dead 'no source selected' state can paint; non-last chip removal shrinks without closing. Both exits share one leaveToOrigin helper (useNavigate; '/' fallback when origin is null). Tests: +jsdom (origin capture from both entry points, Back-to-browser always-available + navigates + leaves sources loaded, auto-close single + multi-chip chain, origin preservation across mid-chain removals, setSources backward-compat); new tests/e2e/sql-runner.spec.ts Playwright smoke (default-query pre-fill via both entry points, Back-to-browser, leaves-sources-loaded, auto-close single + multi) structured with a clean F3 insertion point. Web unit 1251 pass; typecheck/lint/build/duckdb-pin clean; e2e 34 pass / 5 skip / 0 fail. Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>