Repository navigation
feat(cli): adapt worksheet internals to block documents - #780
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR renames worksheet-scoped command IDs, actor identifiers, and AI tool names to a generic ChangesWorksheet to block-document command rename
Estimated code review effort: 2 (Simple) | ~15 minutes Sequence Diagram(s)sequenceDiagram
participant Agent as WorksheetAgent
participant Commands as createWorksheetCommands
participant Store as CommandBus
Agent->>Commands: invoke block-document.add-map-block
Commands->>Store: invokeRequiredCommand block-document.create-stateful-block (actor: block-document-command)
Store-->>Commands: stateful block created
Commands->>Store: invoke block-document.update-block-metadata
Commands-->>Agent: result with commandId block-document.add-map-block
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
73f80f8 to
ad18e0b
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/sqlrooms-cli-ui/src/createWorksheetCommands.ts (1)
191-191: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider extracting each command id into a shared constant instead of duplicating the literal string at definition and result sites.
Ids like
block-document.update-block-metadataappear as both the commandid(Line 326) and a raw literal invocation target (Line 460), and similarly for the other 4 commands'id/commandIdpairs. This duplication is exactly the kind of drift risk this rename PR is fixing right now — a single shared constant per command (as already done forWORKSHEET_CREATE_STATEFUL_BLOCK_COMMAND_ID) would make future renames safer.Also applies to: 230-230, 242-242, 277-277, 289-289, 319-326, 326-326, 358-365, 460-460, 472-472
🤖 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 `@apps/sqlrooms-cli-ui/src/createWorksheetCommands.ts` at line 191, The command IDs in createWorksheetCommands are duplicated as string literals in both the command definitions and the invocation/result mapping, which risks drift during renames. Extract each command id into a shared constant, following the existing WORKSHEET_CREATE_STATEFUL_BLOCK_COMMAND_ID pattern, and use those constants in the relevant command objects and any commandId references so each command has a single source of truth.
🤖 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 `@apps/sqlrooms-cli-ui/src/createWorksheetCommands.ts`:
- Line 191: The command IDs in createWorksheetCommands are duplicated as string
literals in both the command definitions and the invocation/result mapping,
which risks drift during renames. Extract each command id into a shared
constant, following the existing WORKSHEET_CREATE_STATEFUL_BLOCK_COMMAND_ID
pattern, and use those constants in the relevant command objects and any
commandId references so each command has a single source of truth.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8a30ccb1-48b0-4784-8427-eaaafd37d381
📒 Files selected for processing (11)
apps/sqlrooms-cli-ui/README.mdapps/sqlrooms-cli-ui/src/__tests__/createWorksheetAiAdapter.test.tsapps/sqlrooms-cli-ui/src/__tests__/createWorksheetCommands.test.tsapps/sqlrooms-cli-ui/src/ai/constants.tsapps/sqlrooms-cli-ui/src/ai/createWorksheetAgentTool.tsapps/sqlrooms-cli-ui/src/createWorksheetAgent.tsapps/sqlrooms-cli-ui/src/createWorksheetAiAdapter.tsapps/sqlrooms-cli-ui/src/createWorksheetCommands.tsapps/sqlrooms-cli-ui/src/store.tspackages/documents/README.mdpackages/python/README.md
31ecd35 to
950f1f2
Compare
Summary
block-document.*namespace.block_document_agentand update CLI AI instructions to explain that a Worksheet is a block document artifact.Validation
pnpm buildpnpm --filter sqlrooms-cli-app test --runTestsByPath src/__tests__/createWorksheetCommands.test.ts src/__tests__/createWorksheetAiAdapter.test.ts src/ai/__tests__/createWorksheetBlockDocumentAiTools.test.tspnpm --filter sqlrooms-cli-app typecheckknip,turbo typecheck, circular dependency check,turbo testOriginally chained on top of #779; rebased onto
mainafter #779 landed.Summary by CodeRabbit
New Features
Bug Fixes
Documentation