Skip to content

feat: worksheet dashboard - #799

Closed
dmitriy-kostianetskiy wants to merge 7 commits into
mainfrom
worksheet-dashboard
Closed

dmitriy-kostianetskiy wants to merge 7 commits into
mainfrom
worksheet-dashboard

Conversation

@dmitriy-kostianetskiy

@dmitriy-kostianetskiy dmitriy-kostianetskiy commented Jul 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • CLI AI and command workflows now operate on block documents, with updated support for dashboards, data tables, maps, and HTML apps.
    • Block-related actions now return clearer IDs and status details for created or updated content.
  • Bug Fixes

    • Improved map handling so existing maps and panels can be updated more reliably.
    • Import flow now uses the current artifact consistently when adding table content.
  • Chores

    • Updated the AI package version across multiple workspace packages.

@coderabbitai

coderabbitai Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3246100e-7f1e-4e3a-889c-ac0dc2a13a3f

📥 Commits

Reviewing files that changed from the base of the PR and between f7d45c2 and 01dcee3.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • packages/ai-core/package.json
  • packages/ai-rag/package.json
  • packages/ai/package.json
  • packages/artifacts/package.json
  • packages/deck/package.json
  • packages/documents/package.json
  • packages/mosaic/package.json
  • packages/vega/package.json
  • packages/webcontainer/package.json
✅ Files skipped from review due to trivial changes (2)
  • packages/documents/package.json
  • packages/vega/package.json
🚧 Files skipped from review as they are similar to previous changes (5)
  • packages/mosaic/package.json
  • packages/ai-core/package.json
  • packages/webcontainer/package.json
  • packages/ai-rag/package.json
  • packages/deck/package.json

📝 Walkthrough

Walkthrough

This PR renames worksheet-scoped CLI artifacts (commands, AI adapters, AI tools, agent tools, and constants) to block-document-scoped equivalents throughout sqlrooms-cli-ui, replacing worksheetId with blockDocumentId in payloads and command handlers, updating store wiring and tests, and bumping the ai dependency version across several packages.

Changes

CLI worksheet-to-block-document rename

Layer / File(s) Summary
Block-document commands and artifact resolution
apps/sqlrooms-cli-ui/src/createCliBlockDocumentCommands.ts, apps/sqlrooms-cli-ui/src/__tests__/createCliBlockDocumentCommands.test.ts
Command owner/ID constants, schemas, artifact resolution, and dashboard/data-table/html-app/map command handlers are renamed to use blockDocumentId, with map-block add/update logic and tests updated to match.
AI adapter and constants rename
apps/sqlrooms-cli-ui/src/createCliBlockDocumentAiAdapter.ts, apps/sqlrooms-cli-ui/src/__tests__/createCliBlockDocumentAiAdapter.test.ts, apps/sqlrooms-cli-ui/src/ai/constants.ts
createWorksheetAiAdapter is renamed to createCliBlockDocumentAiAdapter; tool name, tool map, and experimental instructions constants are renamed to block-document equivalents.
Block-document AI tools factory
apps/sqlrooms-cli-ui/src/ai/createCliBlockDocumentAiTools.ts, apps/sqlrooms-cli-ui/src/ai/__tests__/createCliBlockDocumentAiTools.test.ts
createWorksheetBlockDocumentAiTools is replaced by createCliBlockDocumentAiTools, with types, callback signatures, and built-in/extra tool composition updated to key on blockDocumentId and KnownBlockDocumentTools.
Block-document agent tool and instructions
apps/sqlrooms-cli-ui/src/ai/createCliBlockDocumentAgentTool.ts
createWorksheetAgentTool is replaced by createCliBlockDocumentAgentTool, introducing BlockDocumentAgentResult, rewritten instruction templates using block-document tool names, and an execute path returning blockDocumentId in results.
Room agent and store wiring
apps/sqlrooms-cli-ui/src/createBlockDocumentAgent.ts, apps/sqlrooms-cli-ui/src/store.ts, apps/sqlrooms-cli-ui/src/components/useLocalFileLoader.ts
worksheetAgentTool is renamed to blockDocumentAgentTool with block-document-keyed tool builders; store registration/teardown and instructions switch to block-document commands/tools; the local file loader's worksheet artifact helper and content access are updated.

Estimated code review effort: 4 (Complex) | ~60 minutes

ai dependency version bump

Layer / File(s) Summary
Package.json ai dependency updates
packages/ai-core/package.json, packages/ai-rag/package.json, packages/ai/package.json, packages/artifacts/package.json, packages/deck/package.json, packages/documents/package.json, packages/mosaic/package.json, packages/vega/package.json, packages/webcontainer/package.json
The ai dependency version is bumped to 6.0.177 across nine package manifests.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Agent as CliBlockDocumentAgentTool
  participant Tools as createCliBlockDocumentAiTools
  participant Commands as createCliBlockDocumentCommands
  participant State as RoomState

  Agent->>State: ensure/set current block document
  Agent->>Tools: build tools with blockDocumentId
  Tools->>Commands: invoke block-document.* command
  Commands->>State: resolveBlockDocumentArtifact, create/update block
  State-->>Commands: blockId, mapId, panelId
  Commands-->>Tools: success result with blockDocumentId
  Tools-->>Agent: tool execution result
  Agent-->>Agent: return BlockDocumentAgentResult (blockDocumentId)
Loading

Possibly related PRs

  • sqlrooms/sqlrooms#780: Updates the same SQLRooms CLI worksheet internals/tests to use the block-document.* command namespace and agent/tool vocabulary.
  • sqlrooms/sqlrooms#797: Overlaps directly with the same adapter/tool/command/store/test renames and worksheetId→blockDocumentId contract changes.
  • sqlrooms/sqlrooms#765: Part of the same refactor moving AI/agent tooling from worksheet-scoped helpers to block-document-scoped ones.

Suggested reviewers: ilyabo

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and points to worksheet dashboard work, which is part of the broader block-document refactor.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worksheet-dashboard

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f7d45c221b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/documents/src/BlockDocumentEditor/BlockDocumentToolbar.tsx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
packages/documents/src/BlockDocumentEditor/BlockDocumentToolbar.tsx (1)

94-114: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider adding a test for the new dashboard insertion action.

This new toolbar button introduces a distinct interaction (insert a blockDocumentStatefulBlock with dashboard-specific attrs). If a test suite already exists for this toolbar's other buttons, consider adding a similar case for the dashboard button.

As per coding guidelines, "Add or update tests when changing behavior or public API, when practical."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/documents/src/BlockDocumentEditor/BlockDocumentToolbar.tsx` around
lines 94 - 114, The new dashboard toolbar action in BlockDocumentToolbar should
be covered by tests similar to the existing toolbar button cases. Add or update
a test that renders BlockDocumentToolbar, clicks the dashboard button, and
verifies insertAtomBlock is called with blockDocumentStatefulBlock plus the
dashboard-specific attrs such as blockType, ownership, title, caption, height,
and a generated blockInstanceId. Use the existing toolbar test setup and any
shared helpers/mocks around insertAtomBlock and generateBlockId to keep the test
aligned with the current suite.

Source: Coding guidelines

packages/ai-core/package.json (1)

50-50: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider keeping a caret range instead of pinning ai exactly.

Pinning "ai": "6.0.177" (no ^) in a library package prevents package managers from deduping with other compatible ai versions in a consumer's tree, which can cause duplicate installs of this dependency across packages/apps. Unless exact pinning is required to guarantee compatibility during this migration, consider restoring a caret range (e.g. ^6.0.177).

♻️ Suggested change
-    "ai": "6.0.177",
+    "ai": "^6.0.177",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/ai-core/package.json` at line 50, The ai dependency in the package
manifest is pinned exactly, which can prevent deduping across consumer trees.
Update the dependency entry in package.json for ai to use a caret range instead
of an exact version, unless this package explicitly requires a fixed pin for
compatibility during the migration.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/ai-core/package.json`:
- Line 50: The ai dependency in the package manifest is pinned exactly, which
can prevent deduping across consumer trees. Update the dependency entry in
package.json for ai to use a caret range instead of an exact version, unless
this package explicitly requires a fixed pin for compatibility during the
migration.

In `@packages/documents/src/BlockDocumentEditor/BlockDocumentToolbar.tsx`:
- Around line 94-114: The new dashboard toolbar action in BlockDocumentToolbar
should be covered by tests similar to the existing toolbar button cases. Add or
update a test that renders BlockDocumentToolbar, clicks the dashboard button,
and verifies insertAtomBlock is called with blockDocumentStatefulBlock plus the
dashboard-specific attrs such as blockType, ownership, title, caption, height,
and a generated blockInstanceId. Use the existing toolbar test setup and any
shared helpers/mocks around insertAtomBlock and generateBlockId to keep the test
aligned with the current suite.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6c3bb110-34d2-4fba-a5e1-2d806af58acf

📥 Commits

Reviewing files that changed from the base of the PR and between cbe35fd and f7d45c2.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (21)
  • apps/sqlrooms-cli-ui/src/__tests__/createCliBlockDocumentAiAdapter.test.ts
  • apps/sqlrooms-cli-ui/src/__tests__/createCliBlockDocumentCommands.test.ts
  • apps/sqlrooms-cli-ui/src/ai/__tests__/createCliBlockDocumentAiTools.test.ts
  • apps/sqlrooms-cli-ui/src/ai/constants.ts
  • apps/sqlrooms-cli-ui/src/ai/createCliBlockDocumentAgentTool.ts
  • apps/sqlrooms-cli-ui/src/ai/createCliBlockDocumentAiTools.ts
  • apps/sqlrooms-cli-ui/src/components/useLocalFileLoader.ts
  • apps/sqlrooms-cli-ui/src/createBlockDocumentAgent.ts
  • apps/sqlrooms-cli-ui/src/createCliBlockDocumentAiAdapter.ts
  • apps/sqlrooms-cli-ui/src/createCliBlockDocumentCommands.ts
  • apps/sqlrooms-cli-ui/src/store.ts
  • packages/ai-core/package.json
  • packages/ai-rag/package.json
  • packages/ai/package.json
  • packages/artifacts/package.json
  • packages/deck/package.json
  • packages/documents/package.json
  • packages/documents/src/BlockDocumentEditor/BlockDocumentToolbar.tsx
  • packages/mosaic/package.json
  • packages/vega/package.json
  • packages/webcontainer/package.json

Comment thread packages/ai-core/package.json Outdated
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.

2 participants