Skip to content

refactor(studio): make the fileset start selection a discriminated union - #1020

Open
steramae-nvidia wants to merge 1 commit into
mainfrom
steramae/dd-start-selection
Open

refactor(studio): make the fileset start selection a discriminated union#1020
steramae-nvidia wants to merge 1 commit into
mainfrom
steramae/dd-start-selection

Conversation

@steramae-nvidia

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

Copy link
Copy Markdown
Contributor

What

CreateFilesetStart's onContinue took (optionId, templateId?), which can't carry a payload per option without accumulating more optional arguments. Replaced with a StartSelection discriminated union so each start option's payload travels inside its own case, and NewDataDesignerJobRoute switches on it exhaustively.

Also changes the Continue footer: it now appears as soon as an option is picked and disables itself with a hint ("Pick a recipe to continue."), instead of materializing only once the choice was already complete. Previously the button simply popped into existence with no indication of what was missing.

Why

PR 1 of 3 in a stack that adds the "Describe with AI" start option. This one is purely the contract change — the ai tile stays enabled: false and no new UI ships. Isolating it means the footer UX change (which is visible on the template path today) gets reviewed on its own rather than buried in a 1000-line feature diff.

Stack

  1. → this PR — contract refactor
  2. steramae/dd-ai-generation-hook — generation/validation/repair hook
  3. steramae/dd-ai-start-option — the panel, and flipping the tile on

Testing

  • pnpm --filter nemo-studio-ui typecheck — clean
  • pnpm --filter nemo-studio-ui test src/components/CreateFilesetStart/index.test.tsx — 7 passing

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added clearer guidance when a template selection cannot yet continue.
    • Continue actions now consistently support both scratch and template-based filesets.
    • Template selections proceed with the chosen template, while scratch selections follow the scratch workflow.
  • Bug Fixes

    • Improved Continue button behavior so it remains disabled until required selections are complete.
    • Kept the action footer visible after selecting an option, making next steps clearer.

onContinue took (optionId, templateId?), which could not carry a payload
per option without growing more optional arguments. Replace it with a
StartSelection union so each option's payload travels with its own case.

The Continue footer now renders as soon as an option is picked and
disables itself with a hint, rather than appearing only once the choice
is complete — previously the button materialized with no explanation of
what was missing.

Signed-off-by: Sean Teramae <steramae@nvidia.com>
@steramae-nvidia
steramae-nvidia requested review from a team as code owners July 31, 2026 19:41
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 4387b58d-da5f-45d2-8134-e536b74e55bf

📥 Commits

Reviewing files that changed from the base of the PR and between 0cf4a0f and 06f5604.

📒 Files selected for processing (4)
  • web/packages/studio/src/components/CreateFilesetStart/index.test.tsx
  • web/packages/studio/src/components/CreateFilesetStart/index.tsx
  • web/packages/studio/src/components/CreateFilesetStart/types.ts
  • web/packages/studio/src/routes/NewDataDesignerJobRoute/index.tsx

📝 Walkthrough

Walkthrough

Changes

Fileset start selection flow

Layer / File(s) Summary
Selection contract and component behavior
web/packages/studio/src/components/CreateFilesetStart/types.ts, web/packages/studio/src/components/CreateFilesetStart/index.tsx, web/packages/studio/src/components/CreateFilesetStart/index.test.tsx
StartSelection defines scratch and template payloads. The component emits these payloads, shows template guidance when no recipe is selected, and keeps Continue disabled until selection requirements are met. Tests cover the updated states and payloads.
Route handling for structured selections
web/packages/studio/src/routes/NewDataDesignerJobRoute/index.tsx
The route accepts StartSelection and navigates according to optionId. Template navigation reads templateId from the selection object.

Possibly related PRs

Suggested reviewers: marcusds, htolentino-nvidia, aray12

🚥 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 clearly summarizes the main change: refactoring fileset start selection into a discriminated union.
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.
✨ 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-start-selection

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

@github-actions

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 29440/37448 78.6% 63.2%
Integration Tests 17382/36166 48.1% 20.6%

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.

1 participant