feat(studio): DD schema list in builder - #847
Conversation
|
This change is part of the following stack: Change managed by git-spice. |
📝 WalkthroughWalkthroughChangesData Designer builder views
Sequence Diagram(s)sequenceDiagram
participant BuilderToolbar
participant DataDesignerJobBuildRoute
participant SchemaList
participant BuilderCanvas
BuilderToolbar->>DataDesignerJobBuildRoute: change selected view mode
DataDesignerJobBuildRoute->>SchemaList: render list mode
DataDesignerJobBuildRoute->>BuilderCanvas: render canvas mode
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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/columns.ts (1)
693-707: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winExport and reuse
buildNameMapsinstead of reimplementing it.buildNameMapsis the only correct builder ofknownNames(it adds seed-dataset provided names); it's private, soSchemaList.tsxreimplements a partial version, causing reference badges to miss dependencies on seed-provided columns.
web/packages/studio/src/routes/DataDesignerJobBuildRoute/columns.ts#L693-L707: addexporttobuildNameMaps.web/packages/studio/src/routes/DataDesignerJobBuildRoute/SchemaList.tsx#L30-L33: importbuildNameMapsand useconst { knownNames } = buildNameMaps(columns);instead of the localSetbuilt fromcolumn.nameonly.🐛 Proposed fix
-const buildNameMaps = ( +export const buildNameMaps = ( columns: BuilderColumn[] ): { knownNames: Set<string>; idByName: Map<string, string> } => {import { + buildNameMaps, getColumnReferences, topologicalSortColumns, } from '`@studio/routes/DataDesignerJobBuildRoute/columns`'; ... const referencesById = useMemo(() => { - const knownNames = new Set(columns.map((column) => column.name).filter(Boolean)); + const { knownNames } = buildNameMaps(columns); return new Map(columns.map((column) => [column.id, getColumnReferences(column, knownNames)])); }, [columns]);🤖 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/columns.ts` around lines 693 - 707, Export buildNameMaps from columns.ts so it can be shared, then update SchemaList.tsx to import and call buildNameMaps(columns), using its knownNames result instead of the local column.name-only Set; this ensures seed-dataset-provided names are included in reference badge dependency checks. Affected sites: web/packages/studio/src/routes/DataDesignerJobBuildRoute/columns.ts lines 693-707 require exporting buildNameMaps; web/packages/studio/src/routes/DataDesignerJobBuildRoute/SchemaList.tsx lines 30-33 require replacing the local Set with the shared helper result.
🧹 Nitpick comments (3)
web/packages/studio/src/routes/DataDesignerJobBuildRoute/BuilderToolbar.tsx (2)
94-94: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueType assertion instead of a guard.
value as BuilderViewModebypasses the type checker. As per coding guidelines, "Use type assertions sparingly. Prefer type guards and narrowing." Sinceitemsonly ever emits'list'/'canvas', risk is low, but a small guard would be safer for future item additions.🤖 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/BuilderToolbar.tsx` at line 94, Replace the type assertion in the BuilderToolbar onValueChange handler with a type guard that validates the value is a supported BuilderViewMode ('list' or 'canvas') before calling onViewModeChange. Ignore or safely handle unsupported values so future item additions cannot bypass type checking.Source: Coding guidelines
91-99: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd accessible names to the icon-only segments.
listandcanvasneed anaria-labelor hidden text so the options are announced.🤖 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/BuilderToolbar.tsx` around lines 91 - 99, Add accessible names to the icon-only items in the SegmentedControl within BuilderToolbar, ensuring the list and canvas options are announced by assistive technologies. Use the control’s supported per-item label or hidden-text mechanism while preserving the existing values and icons.web/packages/studio/src/routes/DataDesignerJobBuildRoute/SchemaRow.tsx (1)
12-20: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicates
ACCENT_VAR_CLASSfrom columns.ts, with weaker typing.Same color→class mapping as
columns.ts'sACCENT_VAR_CLASS(line 610), but typedRecord<string, string>instead ofRecord<ColumnTypeColor, string>— a new accent color added there won't be caught here. Export and reuse the original instead of duplicating.♻️ Reuse instead of duplicating
-/** Accent color → NVIDIA Foundations text token, matching the DAG node icon styling. */ -const ACCENT_ICON_CLASS: Record<string, string> = { - blue: 'text-[color:var(--text-color-accent-blue)]', - gray: 'text-[color:var(--text-color-accent-gray)]', - green: 'text-[color:var(--text-color-accent-green)]', - purple: 'text-[color:var(--text-color-accent-purple)]', - red: 'text-[color:var(--text-color-accent-red)]', - teal: 'text-[color:var(--text-color-accent-teal)]', - yellow: 'text-[color:var(--text-color-accent-yellow)]', -}; +// Reuse the exported ACCENT_VAR_CLASS from columns.ts instead (requires exporting it there).🤖 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/SchemaRow.tsx` around lines 12 - 20, Remove the duplicate ACCENT_ICON_CLASS mapping in SchemaRow.tsx and import/reuse ACCENT_VAR_CLASS from columns.ts. Preserve the existing color-to-class behavior and rely on the original Record<ColumnTypeColor, string> typing so new accent colors remain type-checked.
🤖 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/columns.ts`:
- Around line 693-707: Export buildNameMaps from columns.ts so it can be shared,
then update SchemaList.tsx to import and call buildNameMaps(columns), using its
knownNames result instead of the local column.name-only Set; this ensures
seed-dataset-provided names are included in reference badge dependency checks.
Affected sites:
web/packages/studio/src/routes/DataDesignerJobBuildRoute/columns.ts lines
693-707 require exporting buildNameMaps;
web/packages/studio/src/routes/DataDesignerJobBuildRoute/SchemaList.tsx lines
30-33 require replacing the local Set with the shared helper result.
---
Nitpick comments:
In `@web/packages/studio/src/routes/DataDesignerJobBuildRoute/BuilderToolbar.tsx`:
- Line 94: Replace the type assertion in the BuilderToolbar onValueChange
handler with a type guard that validates the value is a supported
BuilderViewMode ('list' or 'canvas') before calling onViewModeChange. Ignore or
safely handle unsupported values so future item additions cannot bypass type
checking.
- Around line 91-99: Add accessible names to the icon-only items in the
SegmentedControl within BuilderToolbar, ensuring the list and canvas options are
announced by assistive technologies. Use the control’s supported per-item label
or hidden-text mechanism while preserving the existing values and icons.
In `@web/packages/studio/src/routes/DataDesignerJobBuildRoute/SchemaRow.tsx`:
- Around line 12-20: Remove the duplicate ACCENT_ICON_CLASS mapping in
SchemaRow.tsx and import/reuse ACCENT_VAR_CLASS from columns.ts. Preserve the
existing color-to-class behavior and rely on the original
Record<ColumnTypeColor, string> typing so new accent colors remain type-checked.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: f7e4045a-bf0d-43ba-b38e-9d65740321a2
📒 Files selected for processing (10)
web/packages/studio/src/components/AddColumnPalette/index.tsxweb/packages/studio/src/components/ColumnConfigPanel/SeedDatasetConfig.tsxweb/packages/studio/src/routes/DataDesignerJobBuildRoute/BuilderToolbar.tsxweb/packages/studio/src/routes/DataDesignerJobBuildRoute/SchemaList.tsxweb/packages/studio/src/routes/DataDesignerJobBuildRoute/SchemaRow.tsxweb/packages/studio/src/routes/DataDesignerJobBuildRoute/columns.test.tsweb/packages/studio/src/routes/DataDesignerJobBuildRoute/columns.tsweb/packages/studio/src/routes/DataDesignerJobBuildRoute/describeColumn.test.tsweb/packages/studio/src/routes/DataDesignerJobBuildRoute/describeColumn.tsweb/packages/studio/src/routes/DataDesignerJobBuildRoute/index.tsx
|
nakolean
left a comment
There was a problem hiding this comment.
just one nitpick, looks good to me
Signed-off-by: Sean Teramae <steramae@nvidia.com>
Signed-off-by: Sean Teramae <steramae@nvidia.com>
f628c55 to
246d23b
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
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/columns.ts (1)
678-707: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
knownNamesused bygetColumnReferencesdiverges frombuildGraph's.
buildNameMaps(not exported) folds seed-dataset-provided column names intoknownNames, sobuildGraph's edges include references to seed-provided field names. ButSchemaList.tsxcan't call the unexportedbuildNameMaps, so it buildsknownNamesfrom onlycolumn.namevalues (see itsuseMemocomputingknownNamesfromcolumns.map((c) => c.name)). A column referencing a seed-provided field (e.g.{{topic}}from a seed file) will therefore draw an edge in the canvas view but show no reference badge in the schema list — contradicting this function's own doc comment ("the same dependencies that draw edges inbuildGraph").Export
buildNameMaps(or a thin wrapper) soSchemaList.tsxcan compute a matchingknownNames.🔧 Proposed fix
-const buildNameMaps = ( +export const buildNameMaps = ( columns: BuilderColumn[] ): { knownNames: Set<string>; idByName: Map<string, string> } => {Then in
SchemaList.tsx, replace the localknownNamescomputation withbuildNameMaps(columns).knownNames.🤖 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/columns.ts` around lines 678 - 707, Export buildNameMaps from columns.ts, then update SchemaList.tsx to derive knownNames from buildNameMaps(columns).knownNames instead of only column.name values, ensuring seed-dataset-provided fields produce the same reference badges as buildGraph edges.
🤖 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/DataDesignerJobBuildRoute/BuilderToolbar.tsx`:
- Around line 91-99: Add accessible names to the list and canvas options in the
SegmentedControl within BuilderToolbar, using aria-label values that identify
each view mode. Apply labels directly to the items if supported; otherwise label
the control using its supported accessibility mechanism while preserving the
existing viewMode behavior.
---
Outside diff comments:
In `@web/packages/studio/src/routes/DataDesignerJobBuildRoute/columns.ts`:
- Around line 678-707: Export buildNameMaps from columns.ts, then update
SchemaList.tsx to derive knownNames from buildNameMaps(columns).knownNames
instead of only column.name values, ensuring seed-dataset-provided fields
produce the same reference badges as buildGraph edges.
🪄 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: 1fa8b525-d8ea-4c30-89cc-db3f6fef42ff
📒 Files selected for processing (10)
web/packages/studio/src/components/AddColumnPalette/index.tsxweb/packages/studio/src/components/ColumnConfigPanel/SeedDatasetConfig.tsxweb/packages/studio/src/routes/DataDesignerJobBuildRoute/BuilderToolbar.tsxweb/packages/studio/src/routes/DataDesignerJobBuildRoute/SchemaList.tsxweb/packages/studio/src/routes/DataDesignerJobBuildRoute/SchemaRow.tsxweb/packages/studio/src/routes/DataDesignerJobBuildRoute/columns.test.tsweb/packages/studio/src/routes/DataDesignerJobBuildRoute/columns.tsweb/packages/studio/src/routes/DataDesignerJobBuildRoute/describeColumn.test.tsweb/packages/studio/src/routes/DataDesignerJobBuildRoute/describeColumn.tsweb/packages/studio/src/routes/DataDesignerJobBuildRoute/index.tsx
🚧 Files skipped from review as they are similar to previous changes (7)
- web/packages/studio/src/routes/DataDesignerJobBuildRoute/columns.test.ts
- web/packages/studio/src/components/AddColumnPalette/index.tsx
- web/packages/studio/src/routes/DataDesignerJobBuildRoute/index.tsx
- web/packages/studio/src/routes/DataDesignerJobBuildRoute/describeColumn.ts
- web/packages/studio/src/routes/DataDesignerJobBuildRoute/describeColumn.test.ts
- web/packages/studio/src/routes/DataDesignerJobBuildRoute/SchemaList.tsx
- web/packages/studio/src/routes/DataDesignerJobBuildRoute/SchemaRow.tsx
* feat(studio): DD schema list in builder Signed-off-by: Sean Teramae <steramae@nvidia.com> * PR feedback Signed-off-by: Sean Teramae <steramae@nvidia.com> --------- Signed-off-by: Sean Teramae <steramae@nvidia.com>
Signed-off-by: Sean Teramae steramae@nvidia.com
Summary by CodeRabbit
Summary by CodeRabbit