Skip to content

fix: Artifact creation issues - #616

Merged
ilyabo merged 5 commits into
mainfrom
fix--Artifact-creation-issues
May 14, 2026
Merged

ilyabo merged 5 commits into
mainfrom
fix--Artifact-creation-issues

Conversation

@ilyabo

@ilyabo ilyabo commented May 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added a close button to the assistant panel for easier dismissal.
    • Artifact titles are now automatically made unique to prevent naming conflicts.
  • UI Improvements

    • Relocated settings button to the panel header for better accessibility.
    • Updated artifact creation menu with an improved dropdown interface.
    • Dashboard creation now offers layout options (grid and dock).

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 12, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@ilyabo has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 9 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f5687565-1d9c-4afc-a7e3-855b611c0308

📥 Commits

Reviewing files that changed from the base of the PR and between 2870c23 and f991941.

📒 Files selected for processing (2)
  • apps/sqlrooms-cli-ui/src/components/AssistantPanel.tsx
  • apps/sqlrooms-cli-ui/src/workspace/ArtifactsContainerPanel.tsx
📝 Walkthrough

Walkthrough

This PR enhances artifact management and assistant panel UI by introducing unique title generation for artifacts to prevent collisions, refactoring artifact creation to use a command-driven dropdown menu, and improving the assistant panel with a close button and refined settings dialog.

Changes

Artifact Management and UI Updates

Layer / File(s) Summary
Unique artifact title generation
apps/sqlrooms-cli-ui/src/createDashboardCommands.ts
Import generateUniqueName and introduce getUniqueArtifactTitle helper that computes non-colliding titles from existing artifact names. Both generic artifact and dashboard-specific creation flows use this helper when passing titles to state.
Artifact creation UI command integration
apps/sqlrooms-cli-ui/src/workspace/ArtifactsContainerPanel.tsx
Replace ArtifactTabs.AddMenu render-prop pattern with DropdownMenu + command invocation via invokeCommand. Extract artifactId from command results and select the created artifact, with dashboard creation now calling dashboard.create-artifact with 'grid'/'dock' layout types.
Assistant panel close button and settings
apps/sqlrooms-cli-ui/src/components/AssistantPanel.tsx
Import XIcon and refactor header to add an icon-only close button wired to toggleCollapsed, and update AI settings dialog trigger to render conditionally when currentSessionId is present with improved button styling and labels.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • sqlrooms/sqlrooms#408: The PR's additions to createDashboardCommands and dashboard-related UI directly overlap with previous dashboard commands, store slices, and dashboard component work.
  • sqlrooms/sqlrooms#382: The PR adapts UI flows to call the command system with invokeCommand and dashboard.create-artifact commands.

Suggested reviewers

  • lixun910

Poem

🐰 Titles spin unique in the artifact garden
DropdownMenu whispers where clicks beg pardon
Close buttons gleam, settings refined,
Command flows weave, no collisions to find! ✨

🚥 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 'fix: Artifact creation issues' accurately summarizes the main changes across multiple files that address artifact creation problems, including unique naming, UI refactoring, and command invocation improvements.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix--Artifact-creation-issues

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.

@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.

Actionable comments posted: 2

🤖 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.

Inline comments:
In `@apps/sqlrooms-cli-ui/src/components/AssistantPanel.tsx`:
- Around line 42-98: When currentSessionId becomes falsy the Dialog unmounts but
settingsPanelOpen.isOpen can remain true; add a small effect in
AssistantPanel.tsx that watches currentSessionId and, if currentSessionId is
null/undefined and settingsPanelOpen.isOpen is true, call
settingsPanelOpen.onClose() (or otherwise reset the open state) so the panel
state is cleared when the session disappears; reference the existing
settingsPanelOpen handlers (settingsPanelOpen.isOpen and
settingsPanelOpen.onClose) and place the effect alongside other hooks in the
AssistantPanel component.

In `@apps/sqlrooms-cli-ui/src/workspace/ArtifactsContainerPanel.tsx`:
- Around line 81-99: invokeCreateArtifactCommand currently awaits invokeCommand
but doesn't catch rejections, so callers that drop the returned promise (e.g.
the places that call invokeCreateArtifactCommand with void) can cause unhandled
promise rejections; wrap the call to invokeCommand inside
invokeCreateArtifactCommand in a try/catch, handle/log the error (or surface it
to UI) and return early on failure, then keep the artifactId extraction and
artifactTabs.selectArtifact(artifactId) inside the success path—this ensures
callers can safely ignore the returned promise without causing unhandled
rejections.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4c3a296d-51bd-4dea-8cbd-cdb2f18d4784

📥 Commits

Reviewing files that changed from the base of the PR and between 7bfb4d0 and 2870c23.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • apps/sqlrooms-cli-ui/src/components/AssistantPanel.tsx
  • apps/sqlrooms-cli-ui/src/createDashboardCommands.ts
  • apps/sqlrooms-cli-ui/src/workspace/ArtifactsContainerPanel.tsx
  • packages/documents/package.json

Comment thread apps/sqlrooms-cli-ui/src/components/AssistantPanel.tsx
Comment thread apps/sqlrooms-cli-ui/src/workspace/ArtifactsContainerPanel.tsx
@dmitriy-kostianetskiy

Copy link
Copy Markdown
Collaborator

I'd decompose AssistantPanel: 7ab57bb

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