Claude/update sqljob sqlrooms y a8m c#92
Merged
Conversation
…debarButtons, ThemeSwitch)
Phase 1/2: rc.2 entirely blocked — @sqlrooms/codemirror@rc.2 and @sqlrooms/pivot@rc.2 published
with unresolved pnpm workspace:* references, making npm install fail silently. Staying at rc.1.
Documented in CLAUDE.md with blocking notice and rc.1 available APIs.
Phase 3: Migrated store from create<any>() to createRoomStore<any>(). Now exports
{ roomStore, useNotebookStore } — roomStore (StoreApi) passed to <RoomShell>, useNotebookStore
is the React hook. Renamed api → store in all slice factory calls.
Phase 4: Added RoomShell.SidebarButtons in sidebar (auto-generates panel toggles like Sources).
Fixed isSelected={false} on stateless buttons (DB Engine, Documentation).
Phase 5: Wrapped store in persistSliceConfigs with LayoutConfig schema — mosaic layout state
(open panels, split ratios) now persisted to localStorage key sqljob-layout-state-v1.
Phase 6b: Added RoomShell.LoadingProgress + RoomShell.CommandPalette (Ctrl+K) inside RoomShell.
Replaced manual Moon/Sun theme toggle with ThemeSwitch from @sqlrooms/ui.
https://claude.ai/code/session_01AzBiSv8y9zB8Wfdyxwr1YP
RoomShell.Sidebar already renders RoomShellSidebarButtons internally. Explicitly calling <RoomShell.SidebarButtons /> in SidebarControls caused the Sources (DatabaseIcon) button to appear twice. https://claude.ai/code/session_01AzBiSv8y9zB8Wfdyxwr1YP
Resolves the workspace:* dependency issue by using npm overrides to pin all
transitive workspace:* references to their rc.1 equivalents, allowing
@sqlrooms/pivot@rc.2 to install alongside the rc.1 ecosystem.
Pivot cell implementation:
- Schema (cellTypeSchemas.ts): 'pivot' type with executePivotCell handler,
initProps (_pivotReady, _pivotTableName, _pivotColumns), SQL source query
- Execution (executionSlice.ts): creates a DuckDB VIEW pivot_src_<id> from
the source SQL, inspects columns via DESCRIBE, stores metadata in cell state
- Rendering (CellBody.tsx): PivotBody component renders PivotEditor from
@sqlrooms/pivot with querySource={{ tableRef, columns }}; PivotEditor
provides drag-and-drop field config + multi-renderer (Table, Chart, TSV);
PivotResults uses useSql() which bridges through duckdbManagerConnector
to the same DuckDB instance as cell execution
npm overrides added for:
@sqlrooms/cells, @sqlrooms/ui, @sqlrooms/utils → $direct dep (rc.1)
@sqlrooms/duckdb, @sqlrooms/room-store, @sqlrooms/vega → 0.29.0-rc.1
https://claude.ai/code/session_01AzBiSv8y9zB8Wfdyxwr1YP
The pivot type was missing from the cellTypes array that populates the add-cell modal, making it invisible to users. https://claude.ai/code/session_01AzBiSv8y9zB8Wfdyxwr1YP
GitHub intentionally blocks push-triggered workflows when the actor is github-actions[bot] (GITHUB_TOKEN). Adding a pull_request/closed trigger lets the workflow fire when a PR is merged via the GitHub UI (actor is web-flow, which is not blocked). A "Determine target branch" step resolves the correct base branch for both push and PR-merge events. https://claude.ai/code/session_01AzBiSv8y9zB8Wfdyxwr1YP
@sqlrooms/pivot@rc.2 ships PivotCellContent which imports toDataSourceTable / fromDataSourceTable from @sqlrooms/cells. Those symbols only exist in rc.2 of cells (we pin rc.1). Rollup fails even though we never use PivotCellContent. A load-hook stub short-circuits the resolution for that file. https://claude.ai/code/session_01AzBiSv8y9zB8Wfdyxwr1YP
@sqlrooms/pivot@rc.2's pivotCellRegistryEntry.js also imports symbols that only exist in @sqlrooms/cells@rc.2 (resolveSheetSchemaName, findSheetIdForCell). Extend the load-hook stub to cover that file as well. https://claude.ai/code/session_01AzBiSv8y9zB8Wfdyxwr1YP
- Remove SQL query from pivot cell — source is now a table selected directly from the PivotEditor.TableSelector dropdown - Pass availableTables from _duckdbTables to PivotEditor so the dropdown is populated - Persist selected table in cell.json.selectedTable; rebuild querySource from _duckdbTables columns on each selection (key remount keeps columns fresh) - Simplify executePivotCell to a lightweight validation no-op https://claude.ai/code/session_01AzBiSv8y9zB8Wfdyxwr1YP
…l.json callbacks.setConfig fires on every PivotEditor config change; the result is stored in cell.json.pivotConfig and passed back as the config prop on remount, so the layout survives page reload and Gist export/import. Config is cleared when the source table changes. https://claude.ai/code/session_01AzBiSv8y9zB8Wfdyxwr1YP
In dev mode: full PivotEditor layout (table selector, drag-and-drop fields, renderer selector, output). In client mode: PivotEditor wraps only <PivotEditor.Results /> so the store context is present for DuckDB queries, but none of the configuration panels are rendered. https://claude.ai/code/session_01AzBiSv8y9zB8Wfdyxwr1YP
- executeQueryInternal retourne null si DuckDB pas encore prêt, évitant le throw lors de l'auto-appel de refreshTableSchemas par RoomShell au montage - supprime l'appel explicite room.initialize() dans init(), sqlrooms le fait déjà automatiquement au montage de RoomShell https://claude.ai/code/session_01NJyCeZ7b1joKmkwinsMtmK
Évite le crash TypeError 'Cannot read properties of null (reading getChild)' dans refreshTableSchemas au montage de RoomShell : au lieu de null, on retourne un objet minimal compatible Arrow (getChild → null, toArray → []). https://claude.ai/code/session_01NJyCeZ7b1joKmkwinsMtmK
- Supprime helpersMixin.ts, parametersMixin.ts, exportImportMixin.ts (logique complètement migrée dans les slices Zustand correspondants) - Met à jour DuckDB WASM de 1.33.1-dev18.0 vers 1.5.2 (version stable) https://claude.ai/code/session_01NJyCeZ7b1joKmkwinsMtmK
Supprime l'ancien README (Alpine.js, architecture obsolète, emojis). Nouveau README : stack actuelle (React/Zustand/DuckDB 1.5.2/sqlrooms), structure du projet, quick start. https://claude.ai/code/session_01NJyCeZ7b1joKmkwinsMtmK
Supprime les 50 directives @ts-nocheck sur l'ensemble du codebase. Ajoute src/global.d.ts pour les propriétés window custom (XLSX, PizZip, docxtemplater, perspectiveClient…) et éléments HTML personnalisés. Corrige les erreurs de types résiduelles : isSelected manquant sur SidebarButton, casts LocaleType/INumfmtLocaleTag, SqlBlockConfig.sql, FilterItem.cond, fetchDistinctValues signature à 3 paramètres. https://claude.ai/code/session_01NJyCeZ7b1joKmkwinsMtmK
- Licence : MIT → AGPL-3.0 (licence réelle du dépôt) - Ajout section Purpose : moulinette ETL / calculette partageable, no GAFAM / no cloud, export HTML standalone avec données en Base64 https://claude.ai/code/session_01NJyCeZ7b1joKmkwinsMtmK
…EADME) Fusionne claude/brainstorm-functional-tests-IU3eC dans la branche sqlrooms : - DuckDB WASM 1.33.1-dev18.0 → 1.5.2 (e1cb324) - Suppression des 3 mixins legacy (e1cb324) - README refonte sobre et à jour (26076b1) - Suppression @ts-nocheck sur ~50 fichiers, 0 erreur TS (d03ceef) - Corrections TypeScript diverses (exportSlice, executionSlice, etc.) - Licence AGPL-3.0 corrigée + positionnement projet (fcf4d13) Résolution de conflit : room.tsx — conservé <ThemeSwitch /> (notre branche) plutôt que le bouton inline SunIcon/MoonIcon (brainstorm). https://claude.ai/code/session_01AzBiSv8y9zB8Wfdyxwr1YP
@sqlrooms/duckdb pins @duckdb/duckdb-wasm@1.32.0; 1.5.2 doesn't exist on jsDelivr and causes a 404 at runtime. https://claude.ai/code/session_01AzBiSv8y9zB8Wfdyxwr1YP
TypeScript (typescript.md): - Replace all Array<T> with T[] (6 occurrences across 4 files) - Add React.FC<Props> + separate prop type for PivotBody and ResultInfo - Add typed props: PivotBodyProps, ResultInfoProps, NotebookCell, DuckdbTableInfo, PivotCellJson — replace every `any` in PivotBody - Type useShallow selectors with inline store shape instead of `(s: any)` Patterns (patterns.md): - Add immer as direct dependency (was transitive-only) - Use produce() for PivotBody cell.json mutations (setSource/setConfig callbacks now produce a new object immutably) - Replace `cell._resultInfo` (unknown) with String() cast for ReactNode https://claude.ai/code/session_01AzBiSv8y9zB8Wfdyxwr1YP
…terns.md) - Create NotebookStoreState interface in src/app/store/types.ts with all slice methods - Export typed useNotebookStore/roomStore wrappers (cast from internal any store) - Convert CellBody.tsx components to React.FC<Props> with separate typed props - Replace (s: any) selectors with (s: NotebookStoreState) in components - Remove unnecessary (get() as any) casts in exportSlice and executionSlice - Add TODO comments for future produce() adoption in cellsSlice https://claude.ai/code/session_01AzBiSv8y9zB8Wfdyxwr1YP
…s, typed slices)
- Add PanelTypes Zod enum (z.enum) for panel IDs — matches notebook/mosaic examples
- Add `satisfies LayoutConfig` to layout config object — type-checks config shape
- Replace 523-line monolithic NotebookStoreState with intersection type:
RoomShellSliceState & SqlEditorSliceState & CellsSliceState &
NotebookSliceState & CanvasSliceState & CustomNotebookState
- createRoomStore<NotebookStoreState> now properly typed — no more createRoomStore<any>
- Remove double as-unknown-as casts from roomStore/useNotebookStore exports
- Remove `roomStore as any` cast in room.tsx RoomShell prop
- Update all 9 custom slice signatures from (set: any, get: any) to
(set: StoreApi<NotebookStoreState>['setState'], get: StoreApi<NotebookStoreState>['getState'])
- Fix type errors surfaced by proper typing (clone casts, as const literals,
DragEvent types, direction literal type, cell mutations)
- Document setAutoFreeze(false) as TODO(produce-migration)
https://claude.ai/code/session_01AzBiSv8y9zB8Wfdyxwr1YP
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.
No description provided.