Skip to content

feat: hide sql processing in the sql editor and add open sql editor button in the query tooltip#511

Open
bdjulbic wants to merge 1 commit intomainfrom
feat/inline-sql-query-2
Open

feat: hide sql processing in the sql editor and add open sql editor button in the query tooltip#511
bdjulbic wants to merge 1 commit intomainfrom
feat/inline-sql-query-2

Conversation

@bdjulbic
Copy link
Copy Markdown
Collaborator

@bdjulbic bdjulbic commented Apr 1, 2026

Summary by CodeRabbit

  • New Features
    • Users can now open generated SQL queries directly in the SQL editor from query results. An "Open in SQL Editor" button appears on successful query executions, enabling inspection, editing, and refinement of SQL queries in the dedicated editor interface for improved debugging and development workflows.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3a4100db-418b-4525-b07d-758b3773559d

📥 Commits

Reviewing files that changed from the base of the PR and between aca33f8 and 2414d57.

📒 Files selected for processing (3)
  • packages/ai-core/src/AiSlice.ts
  • packages/ai-core/src/components/ToolPartRenderer.tsx
  • packages/sql-editor/src/index.ts

📝 Walkthrough

Walkthrough

The changes integrate SQL editor functionality with the AI system by adding an onOpenSqlEditor callback to the AI slice, updating the tool renderer to display an "Open in SQL Editor" button for query tools, and exporting the SQL editor hook from the package.

Changes

Cohort / File(s) Summary
AI State Enhancement
packages/ai-core/src/AiSlice.ts
Added optional onOpenSqlEditor callback to AiSliceState.ai and AiSliceOptions, propagating it through createAiSlice for downstream use.
Tool UI Integration
packages/ai-core/src/components/ToolPartRenderer.tsx
Enhanced ToolCallDetailPopup to accept optional args in tool calls, extract sqlQuery from args or output, and render an "Open in SQL Editor" button when the tool is a query tool in success state with an available handler.
Export Updates
packages/sql-editor/src/index.ts
Added useStoreWithSqlEditor to public package exports alongside existing createSqlEditorSlice.

Sequence Diagram

sequenceDiagram
    participant User
    participant ToolRenderer as Tool Renderer
    participant AISlice as AI Slice
    participant SQLEditor as SQL Editor

    User->>ToolRenderer: View AI tool call result
    ToolRenderer->>ToolRenderer: Extract sqlQuery from args/output
    ToolRenderer->>ToolRenderer: Detect query tool in success state
    ToolRenderer->>User: Display "Open in SQL Editor" button
    User->>ToolRenderer: Click button
    ToolRenderer->>AISlice: Call onOpenSqlEditor(sqlQuery)
    AISlice->>SQLEditor: Trigger open with query
    SQLEditor->>User: Display editor with query
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 A button blooms for queries bright,
From AI's mind to SQL's sight,
Tool calls dance with newfound grace,
Opening editors in their place! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main changes: adding an 'open sql editor button' to the query tooltip and mentions hiding SQL processing in the editor.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/inline-sql-query-2

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 and usage tips.

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.

1 participant