Skip to content

fix(studio): Code agent link issues and blocked action menu on fileset header#602

Open
htolentino-nvidia wants to merge 1 commit into
mainfrom
studio-code-agent-ui-fix/htolentino
Open

fix(studio): Code agent link issues and blocked action menu on fileset header#602
htolentino-nvidia wants to merge 1 commit into
mainfrom
studio-code-agent-ui-fix/htolentino

Conversation

@htolentino-nvidia

@htolentino-nvidia htolentino-nvidia commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

This PR aims to fix Code Agent links to filesets, fileset file headers blocking the action menu and allowing parquet files to be rendered as tables.

Fileset header Issue:
image

Summary by CodeRabbit

  • New Features

    • Studio file links now correctly open fileset-related pages using workspace-scoped names, improving navigation for filesets and fileset files.
    • File previews now render Parquet files as readable tables instead of plain text.
  • Bug Fixes

    • Fixed double-encoding and double-prefixing issues in generated fileset links.
    • Improved fileset link behavior so already namespaced names continue to work correctly.
  • Style

    • Adjusted file preview header spacing and layout for better display.

@htolentino-nvidia htolentino-nvidia requested review from a team as code owners July 7, 2026 22:47
@github-actions github-actions Bot added the fix label Jul 7, 2026
Signed-off-by: Henrique Tolentino <htolentino@nvidia.com>
@htolentino-nvidia htolentino-nvidia force-pushed the studio-code-agent-ui-fix/htolentino branch from 50b53cf to f997b9b Compare July 7, 2026 22:48
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Studio link generation now namespaces the name path segment as {workspace}/{name} for fileset-related destinations (backend Python and frontend TS), excluding the bare fileset detail route. FileContentPreview adds parquet table rendering, and FilesetFilePreviewHeader styling is adjusted.

Changes

Namespaced Fileset Link Generation

Layer / File(s) Summary
Backend namespaced path building
services/studio/src/nmp/studio/studio_links.py, services/studio/tests/unit/test_coding_agents.py
Adds a frozenset of destinations needing {workspace}/{name} encoding, a _path_value helper applying the prefix unless already namespaced, and tests covering fileset_panel, fileset_file, and fileset behaviors.
Frontend namespaced href building
web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/artifacts.ts, artifacts.test.ts
Mirrors the namespacing logic via NAMESPACED_FILESET_DESTINATIONS, prefixing workspace to name before URI-encoding in buildStudioLinkHrefFromInput, with updated href assertions.

Parquet File Preview and Header Styling

Layer / File(s) Summary
Parquet file preview support
web/packages/common/src/components/FileContentPreview/index.tsx, FileContentPreview.test.tsx
Detects .parquet files, parses newline-delimited JSON into table columns/rows, and renders a ScrollTable branch instead of raw code view.
Fileset preview header styling
web/packages/studio/src/components/FilesetFilePreviewPanel/components/FilesetFilePreviewHeader/index.tsx
Adjusts padding/overflow classes and adds shrink-0 to the folder icon.

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant buildStudioLinkHrefFromInput
  participant NAMESPACED_FILESET_DESTINATIONS
  participant URLEncoder

  Caller->>buildStudioLinkHrefFromInput: request href(destination, name, workspace)
  buildStudioLinkHrefFromInput->>NAMESPACED_FILESET_DESTINATIONS: check destination membership
  alt destination namespaced and name lacks "/"
    buildStudioLinkHrefFromInput->>buildStudioLinkHrefFromInput: prefix workspace to name
  end
  buildStudioLinkHrefFromInput->>URLEncoder: encode resolved name
  URLEncoder-->>Caller: encoded href with {name} substituted
Loading

Possibly related PRs

Suggested reviewers: aray12

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main Studio fixes: Code Agent link behavior and the fileset header action-menu blockage.
✨ 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 studio-code-agent-ui-fix/htolentino

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

@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 (1)
web/packages/common/src/components/FileContentPreview/FileContentPreview.test.tsx (1)

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

Add edge-case coverage for parquet parsing.

Only the happy path (uniform, valid JSON rows) is tested. Given trace files can contain malformed lines or scalar/non-object JSON (per buildRowsAndKeysFromJsonlSample's raw-line/scalar fallback paths), consider adding tests for: a line that fails JSON.parse, a non-object JSON value, and empty content (fallback to code editor).

🤖 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/common/src/components/FileContentPreview/FileContentPreview.test.tsx`
around lines 168 - 187, Add edge-case tests to FileContentPreview.test.tsx
around the parquet/JSONL parsing path, since only the happy path is covered
today. Extend the existing FileContentPreview and
buildRowsAndKeysFromJsonlSample coverage to verify a malformed line that fails
JSON.parse, a scalar/non-object JSON value, and empty content. Assert the
raw-line/scalar fallback behavior and that empty content renders the code editor
fallback rather than a table.
🤖 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
`@web/packages/common/src/components/FileContentPreview/FileContentPreview.test.tsx`:
- Around line 168-187: Add edge-case tests to FileContentPreview.test.tsx around
the parquet/JSONL parsing path, since only the happy path is covered today.
Extend the existing FileContentPreview and buildRowsAndKeysFromJsonlSample
coverage to verify a malformed line that fails JSON.parse, a scalar/non-object
JSON value, and empty content. Assert the raw-line/scalar fallback behavior and
that empty content renders the code editor fallback rather than a table.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 8fe02cef-2e33-4345-b7fe-42575f6863a7

📥 Commits

Reviewing files that changed from the base of the PR and between 0185085 and f997b9b.

📒 Files selected for processing (7)
  • services/studio/src/nmp/studio/studio_links.py
  • services/studio/tests/unit/test_coding_agents.py
  • web/packages/common/src/components/FileContentPreview/FileContentPreview.test.tsx
  • web/packages/common/src/components/FileContentPreview/index.tsx
  • web/packages/studio/src/components/FilesetFilePreviewPanel/components/FilesetFilePreviewHeader/index.tsx
  • web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/artifacts.test.ts
  • web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/artifacts.ts

@htolentino-nvidia

Copy link
Copy Markdown
Contributor Author

@CodeRabbit review it now

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

The PR description image shows a dark-themed file viewer displaying trace.parquet, with breadcrumb path job-fileset-nemo-anonymizer-plug-skciegpm > results > platform-job-attempt-2rkP9kd2qQtAE4gx9RszLX > artifacts > trace.parquet. Below it, a single-line JSON record (line 1) shows a simulated phishing email test fixture — subject "Claim Your Free iPhone Now!", body referencing a malicious link, entity detection/labeling fields (Money, Personal, NonCrypto, Url), and anonymizer trace metadata (_raw_detected_entities, _seed_entities, _seed_validation_candidates, _validated_entities). This illustrates the "before" state — a raw parquet trace rendered as unstructured text — motivating the PR's fix to render parquet files as tables.

@htolentino-nvidia Triggering the review now.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 23273/30443 76.4% 61.2%
Integration Tests 13618/29123 46.8% 20.0%

}));

return (
<div className="h-full p-4">

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.

nit: Block instead of div here?

<Flex justify="between" align="center" gap="density-sm" className="shrink-0 w-full">
<Flex gap="density-sm" align="center" className="min-w-0">
<FolderOpen width={16} height={16} />
<Flex justify="between" align="center" gap="density-sm" className="shrink-0 w-full pr-28">

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.

pr-28? Seems like you'd want a set value instead at that width like pr-[112px]?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants