feat(studio): Coding agents assets panel - #333
Conversation
Signed-off-by: Danielle Ali <44468613+dmariali@users.noreply.github.com>
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds ChangesChat Artifacts Extraction, Collapsed Thinking, and Artifacts UI
Studio experiment link destination and infrastructure
Possibly Related PRs
Suggested Reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/ClaudeCodeHistoryPanel.tsx (1)
4-59: ⚡ Quick winReorder imports to external-first, then internal aliases.
The changed import block mixes external packages after
@studio/*imports; reorder to match repo import grouping.Proposed fix
import { Anchor, Banner, Button, Card, Flex, SegmentedControl, Skeleton, Stack, Text, Tooltip, } from '`@nvidia/foundations-react-core`'; +import { useQuery } from '`@tanstack/react-query`'; +import cn from 'classnames'; +import { + ArrowRight, + Bot, + BookOpen, + Boxes, + Cpu, + FileCode2, + History, + Link2, + MessageSquare, + MessageSquarePlus, + PanelRightClose, + PanelRightOpen, + RefreshCw, + Sparkles, + Wrench, +} from 'lucide-react'; +import { type FC, type ReactNode } from 'react'; +import { Link } from 'react-router-dom'; + import { Empty } from '`@studio/components/Empty`'; import { useWorkspaceFromPathIfExists } from '`@studio/hooks/useWorkspaceFromPath`'; import { CLAUDE_CODE_HISTORY_SESSIONS_QUERY_KEY, CLAUDE_CODE_SKILLS_QUERY_KEY, listClaudeCodeHistorySessions, listClaudeCodeSkills, } from '`@studio/routes/agents/ClaudeCodeChatRoute/api`'; import { cleanClaudeCodeArtifactText } from '`@studio/routes/agents/ClaudeCodeChatRoute/artifacts`'; import { CLAUDE_CODE_STUDIO_LINK_CLASS } from '`@studio/routes/agents/ClaudeCodeChatRoute/ClaudeCodeStudioLink`'; import { getStudioInternalLinkTarget } from '`@studio/routes/agents/ClaudeCodeChatRoute/ClaudeCodeStudioLinkTarget`'; import type { ClaudeCodeChatArtifacts, ClaudeCodeChatFileArtifact, ClaudeCodeChatLinkArtifact, ClaudeCodeChatSelectionArtifact, ClaudeCodeHistorySession, ClaudeCodeSkill, } from '`@studio/routes/agents/ClaudeCodeChatRoute/types`'; import { getSkillDisplayName } from '`@studio/routes/DashboardLandingRoute/skillDisplayName`'; import { useLocalStorage } from '`@studio/util/hooks/useLocalStorage`'; import { CLAUDE_CODE_HISTORY_OPEN_KEY, CLAUDE_CODE_PANEL_TAB_KEY } from '`@studio/util/localStorage`'; -import { useQuery } from '`@tanstack/react-query`'; -import cn from 'classnames'; -import { - ArrowRight, - Bot, - BookOpen, - Boxes, - Cpu, - FileCode2, - History, - Link2, - MessageSquare, - MessageSquarePlus, - PanelRightClose, - PanelRightOpen, - RefreshCw, - Sparkles, - Wrench, -} from 'lucide-react'; -import { type FC, type ReactNode } from 'react'; -import { Link } from 'react-router-dom';As per coding guidelines, "Group imports in the order: external libraries, internal modules, relative imports".
🤖 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 `@web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/ClaudeCodeHistoryPanel.tsx` around lines 4 - 59, The imports in ClaudeCodeHistoryPanel.tsx are not properly grouped according to the coding guidelines. Currently, external packages like `@tanstack/react-query`, classnames, lucide-react, and react-router-dom are mixed in after internal `@studio/`* imports. Reorder all imports to follow the external-first pattern: place all external library imports (including `@nvidia/foundations-react-core`, `@tanstack/react-query`, classnames, lucide-react, react, and react-router-dom) at the top, then group all `@studio/`* internal module imports below them.Source: Coding guidelines
🤖 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 `@web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/artifacts.ts`:
- Around line 125-127: Remove the pre-encoded aliases file_path_encoded and
filePathEncoded from the file_path key mapping in the artifacts mapping object.
These aliases are already URL-encoded and should not be included in the mapping
since they will be double-encoded during template substitution, breaking file
route links. Apply this same fix at all three locations where this mapping
appears: the main definition around lines 125-127, and the duplicate mappings at
lines 159-166 and 189-196. In each location, remove file_path_encoded and
filePathEncoded from the string array value for the file_path key while keeping
the other aliases (file, filePath, path).
In
`@web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/useClaudeCodeChatRuntime.ts`:
- Around line 244-248: The useEffect hook in useClaudeCodeChatRuntime has an
early return when nextArtifacts is falsy, which prevents resetting artifacts
when initialArtifacts becomes undefined. Instead of returning early, restructure
the effect to handle both cases: when nextArtifacts exists (call setArtifacts
with createWorkspaceArtifacts result) and when it is undefined (call
setArtifacts to clear/reset the artifacts appropriately, such as with an empty
object or undefined value). This ensures artifacts are properly synced and
cleared during state transitions when the initialArtifactsSignature or workspace
dependencies change.
---
Nitpick comments:
In
`@web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/ClaudeCodeHistoryPanel.tsx`:
- Around line 4-59: The imports in ClaudeCodeHistoryPanel.tsx are not properly
grouped according to the coding guidelines. Currently, external packages like
`@tanstack/react-query`, classnames, lucide-react, and react-router-dom are mixed
in after internal `@studio/`* imports. Reorder all imports to follow the
external-first pattern: place all external library imports (including
`@nvidia/foundations-react-core`, `@tanstack/react-query`, classnames, lucide-react,
react, and react-router-dom) at the top, then group all `@studio/`* internal
module imports below them.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 31f94bd3-d0c1-411a-ad1a-16a4fd939c19
📒 Files selected for processing (22)
plugins/nemo-agents/examples/calculator-agent/src/calculator_agent/.injected-calculator-eval-28my_bch.yamlservices/studio/src/nmp/studio/coding_agents.pyservices/studio/src/nmp/studio/studio_links.pyservices/studio/tests/unit/test_coding_agents.pyweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/ClaudeCodeHistoryPanel.tsxweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/ClaudeCodeLayout.tsxweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/ClaudeCodeStudioLink.tsxweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/ClaudeCodeToolCallPart.spec.tsxweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/ClaudeCodeToolCallPart.tsxweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/api.spec.tsweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/api.tsweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/artifacts.spec.tsweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/artifacts.tsweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/index.tsxweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/toolParts.tsweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/types.tsweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/useClaudeCodeChatRuntime.spec.tsweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/useClaudeCodeChatRuntime.tsweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/useCustomAssistantChatRuntime.spec.tsweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/useCustomAssistantChatRuntime.tsweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/util.spec.tsweb/packages/studio/src/routes/agents/ClaudeCodeChatRoute/util.ts
Signed-off-by: Danielle Ali <44468613+dmariali@users.noreply.github.com>
Signed-off-by: Danielle Ali <44468613+dmariali@users.noreply.github.com>
Summary by CodeRabbit
Release Notes
New Features
Improvements