Skip to content

feat(studio): Split file into training set in DD details - #855

Merged
steramae-nvidia merged 3 commits into
mainfrom
steramae/dd-splits
Jul 24, 2026
Merged

feat(studio): Split file into training set in DD details#855
steramae-nvidia merged 3 commits into
mainfrom
steramae/dd-splits

Conversation

@steramae-nvidia

@steramae-nvidia steramae-nvidia commented Jul 22, 2026

Copy link
Copy Markdown
Contributor
Screenshot 2026-07-22 at 3 17 14 PM

feat(studio): Split file into training set in DD details

Signed-off-by: Sean Teramae steramae@nvidia.com

fix lint

Signed-off-by: Sean Teramae steramae@nvidia.com

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added “Split” support on the job details view, including a split modal with source-file selection and validation.
    • Added an optional “View config” quick action for data designer jobs.
  • Improvements

    • Split uploads now generate consistent .json/.jsonl output names per split.
    • Enhanced file editing experience with improved loading/error/empty states and selectable source handling.
    • Added header customization via slotFileName and improved long-name rendering with left-side truncation.
    • Updated split sliders to a more compact layout.

@steramae-nvidia
steramae-nvidia requested review from a team as code owners July 22, 2026 22:27
@steramae-nvidia

Copy link
Copy Markdown
Contributor Author

This change is part of the following stack:

Change managed by git-spice.

@github-actions github-actions Bot added the feat label Jul 22, 2026
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

The dataset details route adds a file-splitting modal with selectable source files, full-content loading, and error handling. Split uploads normalize output filenames by source format. File editor headers support custom filename slots, and split controls use compact sliders.

Dataset splitting and editor integration

Layer / File(s) Summary
File editor header slot
web/packages/studio/src/components/FileRowEditor/*, web/packages/studio/src/routes/DataDesignerJobDetailsRoute/JobDatasetEditorSection.tsx
File headers accept custom filename content, allowing the dataset editor to place file selection and fallback states within the editor header.
Split modal inputs and content states
web/packages/studio/src/components/FilesTable/CreateFileSplitsModal/*, web/packages/studio/src/components/LeftTruncatedText/index.tsx
The modal resolves dataset and file options, loads full content, displays selectable paths, and handles loading or content errors.
Details route split action
web/packages/studio/src/routes/DataDesignerJobDetailsRoute/index.tsx, web/packages/studio/src/components/DataDesignerJobActionsMenu/index.tsx
The route derives split inputs, adds the Split action, renders the modal, and supports an optional View config menu action.
Split output naming
web/packages/studio/src/api/datasets/useSplitDatasetFile.ts
Generated split paths use the source basename with .json or .jsonl extensions.

Sequence Diagram(s)

sequenceDiagram
  participant DataDesignerJobDetailsRoute
  participant CreateFileSplitsModal
  participant useDatasetFileContent
  DataDesignerJobDetailsRoute->>CreateFileSplitsModal: Open with datasetId and fileOptions
  CreateFileSplitsModal->>useDatasetFileContent: Request full file content
  useDatasetFileContent-->>CreateFileSplitsModal: Return content, loading state, or error
  CreateFileSplitsModal-->>DataDesignerJobDetailsRoute: Render split form state
Loading

Possibly related PRs

Suggested labels: feat

Suggested reviewers: aray12, htolentino-nvidia, nv-odrulea

🚥 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 clearly matches the main change: adding file splitting in Data Designer details.
✨ 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 steramae/dd-splits

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.

Actionable comments posted: 3

🧹 Nitpick comments (1)
web/packages/studio/src/components/LeftTruncatedText/index.tsx (1)

4-6: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use a type-only React import.

ComponentProps and FC are types.

Proposed fix
- import { ComponentProps, FC } from 'react';
+ import type { ComponentProps, FC } from 'react';

As per coding guidelines, use import type for type-only imports in TypeScript.

🤖 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/components/LeftTruncatedText/index.tsx` around lines
4 - 6, Update the React import in the component to use a type-only import for
ComponentProps and FC, while keeping the runtime Text and cn imports unchanged.

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/api/datasets/useSplitDatasetFile.ts`:
- Around line 58-61: Normalize filepath casing before the isJson extension check
in the output-name construction, so .json and .JSON paths both select JSON
serialization and the .json extension. Keep sourceName, baseName, and non-JSON
behavior unchanged.

In `@web/packages/studio/src/components/FileRowEditor/FileHeader.tsx`:
- Line 71: Update the FileSpreadsheet icon in FileHeader to use a 20px size via
size={20} or the equivalent size-5 utility, so it fits within the surrounding
size-10 badge.

In `@web/packages/studio/src/routes/DataDesignerJobDetailsRoute/index.tsx`:
- Around line 49-53: Update the splitFileOptions derivation in
DataDesignerJobDetailsRoute to filter files through the existing supported
dataset-input condition before mapping their paths. Derive canSplit from this
filtered list so Split is enabled only when at least one valid source file
exists.

---

Nitpick comments:
In `@web/packages/studio/src/components/LeftTruncatedText/index.tsx`:
- Around line 4-6: Update the React import in the component to use a type-only
import for ComponentProps and FC, while keeping the runtime Text and cn imports
unchanged.
🪄 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: 028b86b3-5adf-4d7a-ba6b-9b045c4a11ac

📥 Commits

Reviewing files that changed from the base of the PR and between 3805213 and 5f9e6f3.

📒 Files selected for processing (9)
  • web/packages/studio/src/api/datasets/useSplitDatasetFile.ts
  • web/packages/studio/src/components/DataDesignerJobActionsMenu/index.tsx
  • web/packages/studio/src/components/FileRowEditor/FileHeader.tsx
  • web/packages/studio/src/components/FileRowEditor/index.tsx
  • web/packages/studio/src/components/FilesTable/CreateFileSplitsModal/FileSplitsSliders/index.tsx
  • web/packages/studio/src/components/FilesTable/CreateFileSplitsModal/index.tsx
  • web/packages/studio/src/components/LeftTruncatedText/index.tsx
  • web/packages/studio/src/routes/DataDesignerJobDetailsRoute/JobDatasetEditorSection.tsx
  • web/packages/studio/src/routes/DataDesignerJobDetailsRoute/index.tsx

Comment thread web/packages/studio/src/api/datasets/useSplitDatasetFile.ts Outdated
Comment thread web/packages/studio/src/components/FileRowEditor/FileHeader.tsx
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 27157/34869 77.9% 62.1%
Integration Tests 15970/33581 47.6% 20.0%

Comment thread web/packages/studio/src/components/FileRowEditor/FileHeader.tsx Outdated
Signed-off-by: Sean Teramae <steramae@nvidia.com>
Signed-off-by: Sean Teramae <steramae@nvidia.com>
Signed-off-by: Sean Teramae <steramae@nvidia.com>
@steramae-nvidia
steramae-nvidia added this pull request to the merge queue Jul 24, 2026
Merged via the queue into main with commit ad8003d Jul 24, 2026
62 of 65 checks passed
@steramae-nvidia
steramae-nvidia deleted the steramae/dd-splits branch July 24, 2026 17:50
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