Skip to content

perf(studio): memoize Data Designer builder panes - #1018

Merged
steramae-nvidia merged 3 commits into
mainfrom
steramae/dd-builder-memo
Aug 1, 2026
Merged

perf(studio): memoize Data Designer builder panes#1018
steramae-nvidia merged 3 commits into
mainfrom
steramae/dd-builder-memo

Conversation

@steramae-nvidia

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

Copy link
Copy Markdown
Contributor

What

Wraps the Data Designer builder's presentational panes in React.memo and stabilizes the callbacks the build route passes them, so typing in a column config no longer re-renders the toolbar, palette, schema list, and config pane on every keystroke.

SchemaRow / SchemaList now take id-taking handlers (onSelect(id)) instead of pre-bound closures — otherwise every row got a fresh callback each render and memo would never hit.

Why

Split out of a larger Data Designer branch. This is a pure performance change with no behavior difference, so it can land and be verified independently of the AI-generation feature it was originally bundled with.

Testing

  • pnpm --filter nemo-studio-ui typecheck — clean
  • pnpm --filter nemo-studio-ui test src/routes/DataDesignerJobBuildRoute — passing

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Performance Improvements
    • Improved responsiveness in the Data Designer job builder by reducing unnecessary updates across configuration, details, palette, toolbar, schema, preview, and submission areas.
  • Bug Fixes
    • Improved consistency when selecting or deleting schema columns, ensuring actions apply to the intended column.
    • Streamlined model and column removal interactions in the builder interface.

Wrap the builder's presentational panes in React.memo and stabilize the
callbacks the build route hands them, so editing a column no longer
re-renders the toolbar, palette, and config pane on every keystroke.

SchemaRow/SchemaList now take id-taking handlers instead of pre-bound
closures, so memoized rows keep referential equality across renders.

Signed-off-by: Sean Teramae <steramae@nvidia.com>
@steramae-nvidia
steramae-nvidia requested review from a team as code owners July 31, 2026 19:39
@github-actions github-actions Bot added the perf conventional-commit type label Jul 31, 2026
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Data Designer builder updates

Layer / File(s) Summary
Schema callback contract
web/packages/studio/src/routes/DataDesignerJobBuildRoute/SchemaList.tsx, web/packages/studio/src/routes/DataDesignerJobBuildRoute/SchemaRow.tsx
Schema callbacks now accept column IDs. SchemaRow passes IDs when selecting or deleting columns.
Route callback wiring
web/packages/studio/src/routes/DataDesignerJobBuildRoute/index.tsx
Preview, submission, details, column, and model handlers now use memoized callbacks.
Builder component memoization
web/packages/studio/src/routes/DataDesignerJobBuildRoute/Builder*.tsx
Builder panels, palette, toolbar, and schema rows now use React memoization. Existing rendering logic remains unchanged.

Possibly related PRs

Suggested reviewers: htolentino-nvidia, marcusds

🚥 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: memoizing Data Designer builder panes for performance.
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-builder-memo

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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/packages/studio/src/routes/DataDesignerJobBuildRoute/index.tsx (1)

152-175: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Do not hide local submission errors in the mutation catch.

buildDataDesignerConfig(...) and navigate(...) execute inside the same try as createJob.mutateAsync. If either local operation throws, the catch only opens the details panel. createJob.error remains unset, so submitError stays null and the user sees no failure message.

Build the config before the mutation try, or surface build errors through a separate error state.

Proposed scope fix
+    const config = buildDataDesignerConfig(columns, models, servedModelNames);
     try {
       const created = await createJob.mutateAsync({
         workspace,
         data: {
           name,
           spec: {
             num_records: Number(rows),
-            config: buildDataDesignerConfig(columns, models, servedModelNames),
+            config,
           },
         },
       });

Based on learnings, isolate non-mutation build/runtime work from the submit catch so it cannot cause a silent UX regression.

🤖 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/DataDesignerJobBuildRoute/index.tsx` around
lines 152 - 175, Move buildDataDesignerConfig execution in handleSubmit outside
the try/catch that surrounds createJob.mutateAsync, while keeping the mutation
error handling focused on submission failures. Ensure local build or navigation
errors are not caught and converted into only setIsDetailsOpen(true), preserving
visible mutation error reporting through createJob.error and submitError.

Source: Learnings

🧹 Nitpick comments (1)
web/packages/studio/src/routes/DataDesignerJobBuildRoute/index.tsx (1)

143-147: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Use stable hook members as callback dependencies.

useJobBuilder returns a new object on every render. The [builder] dependencies therefore recreate the toolbar and configuration-pane callbacks, which prevents their memo wrappers from skipping renders. Destructure the stable methods and selected IDs, then depend on those values.

🤖 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/DataDesignerJobBuildRoute/index.tsx` around
lines 143 - 147, Update the callbacks around handlePreview and the related
toolbar/configuration-pane handlers to destructure the stable methods and
selected IDs returned by useJobBuilder instead of depending on the recreated
builder object. Use those destructured values in each useCallback dependency
array so memoized children can skip unnecessary renders while preserving
existing behavior.

Source: MCP tools

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

Outside diff comments:
In `@web/packages/studio/src/routes/DataDesignerJobBuildRoute/index.tsx`:
- Around line 152-175: Move buildDataDesignerConfig execution in handleSubmit
outside the try/catch that surrounds createJob.mutateAsync, while keeping the
mutation error handling focused on submission failures. Ensure local build or
navigation errors are not caught and converted into only setIsDetailsOpen(true),
preserving visible mutation error reporting through createJob.error and
submitError.

---

Nitpick comments:
In `@web/packages/studio/src/routes/DataDesignerJobBuildRoute/index.tsx`:
- Around line 143-147: Update the callbacks around handlePreview and the related
toolbar/configuration-pane handlers to destructure the stable methods and
selected IDs returned by useJobBuilder instead of depending on the recreated
builder object. Use those destructured values in each useCallback dependency
array so memoized children can skip unnecessary renders while preserving
existing behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 9447a21e-3c45-4607-b71d-fe30f6fa1909

📥 Commits

Reviewing files that changed from the base of the PR and between 0cf4a0f and 07cb022.

📒 Files selected for processing (7)
  • web/packages/studio/src/routes/DataDesignerJobBuildRoute/BuilderConfigPane.tsx
  • web/packages/studio/src/routes/DataDesignerJobBuildRoute/BuilderDetailsPanel.tsx
  • web/packages/studio/src/routes/DataDesignerJobBuildRoute/BuilderPalette.tsx
  • web/packages/studio/src/routes/DataDesignerJobBuildRoute/BuilderToolbar.tsx
  • web/packages/studio/src/routes/DataDesignerJobBuildRoute/SchemaList.tsx
  • web/packages/studio/src/routes/DataDesignerJobBuildRoute/SchemaRow.tsx
  • web/packages/studio/src/routes/DataDesignerJobBuildRoute/index.tsx

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 30033/38046 78.9% 63.5%
Integration Tests 17777/36715 48.4% 20.8%

@steramae-nvidia
steramae-nvidia added this pull request to the merge queue Jul 31, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 31, 2026
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 Aug 1, 2026
Merged via the queue into main with commit 2600c08 Aug 1, 2026
52 checks passed
@steramae-nvidia
steramae-nvidia deleted the steramae/dd-builder-memo branch August 1, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf conventional-commit type

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants