ENG-564: Node-based dataset editor with drill-down, CRUD, metadata editing, and YAML panel#7687
Draft
ENG-564: Node-based dataset editor with drill-down, CRUD, metadata editing, and YAML panel#7687
Conversation
Swap the Monaco YAML editor for an interactive React Flow graph where each collection and field is a node. Clicking a node opens a drawer to edit its metadata. - Add DatasetNodeEditor with D3 hierarchy layout (LR tree) - Add custom node components (root, collection, field) matching the taxonomy tree visual style with hover context - Add DatasetTreeHoverContext for parent/child/inactive highlighting - Add custom bezier edges that change color on hover - Add DatasetNodeDetailPanel drawer for editing metadata - Enable "Edit dataset" button for SaaS connectors - Remove test results/logs sections for full-canvas layout
…diting to dataset node editor - Add drill-down: overview shows root→collections, clicking a collection shows its fields - Add breadcrumb navigation bar with back button when drilled into a collection - Add/delete collections (via "+" on root node) and fields (via "+" on field nodes for nesting) - Add AddNodeModal with uniqueness validation for naming new nodes - Add DatasetEditorActionsContext to provide CRUD callbacks to node components - Expand detail panel with collapsible fides_meta sections for both collections and fields - Add delete button with confirmation dialog in detail panel - Fix node overlap by constraining container width and increasing layout spacing
The node-based dataset editor should only be used for SaaS connections. DB connectors retain the original Monaco YAML editor with reachability checks.
…down mode - Add-field modal now includes description, data categories, and full fides_meta fields (matching the edit panel) so metadata can be set at creation time. - Remove "+" button from dataset root node (overview mode). - Show "+" on collection node only when it is the drill-down root.
DRY up duplicated code between AddNodeModal and DatasetNodeDetailPanel: - FieldMetadataFormItems component for the 8 fides_meta form fields - buildFieldMeta helper for converting form values to fides_meta - DATA_TYPE_OPTIONS and REDACT_OPTIONS constants
Use useTaxonomies() to populate the data categories Select with suggestions from the existing taxonomy, while still allowing free-form tags input. Extracted as shared DataCategoryTagSelect component.
Only re-fit the viewport when the graph structure changes (node count or focused collection), not when field metadata is edited.
When a collection or field is added, the new node gets a 1.5s yellow highlight animation that fades out, making it easy to spot in the graph.
All 6 base types support the [] array suffix per parse_data_type_string in the backend. Add all 12 variants to the dropdown.
- Replace centered Modal with right-side Drawer matching the edit panel style, with a "Create" button in the drawer header. - Include array data type variants (e.g. string[], object[]) in the data type dropdown.
Adds a toggleable YAML code editor at the bottom of the node graph with two-way sync: graph changes update the YAML and YAML edits update the graph (debounced 500ms with error display).
- Hoist layout options to module constant to prevent useMemo busting - Stabilize onMouseEnter with functional state update (removes dep) - Precompute ancestor/descendant sets per hover instead of per-node - Export ProtectedFieldsInfo from useDatasetGraph, remove duplicate - Remove unused DatasetNodeData type export - Remove no-op onMount from Monaco editor - Add aria-label to add field/nested field buttons - Show add buttons on focus-within (keyboard accessibility)
- Derive selectedNodeData from rawNodes via useMemo instead of storing a stale snapshot in state. Now always reflects the latest dataset. - Debounce detail panel onValuesChange (300ms) to avoid triggering full dataset/graph recomputes on every keystroke. - Guard against null/non-array fields and collections from incomplete YAML edits (e.g. bare "-" list items, partial typing).
…e editor forms These advanced fields are better edited directly in YAML.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Contributor
Greptile SummaryThis PR replaces the YAML-only dataset editor with a node-based visual editor ( Key observations:
Confidence Score: 3/5
Important Files Changed
Last reviewed commit: "Remove return_all_el..." |
clients/admin-ui/src/features/test-datasets/DatasetNodeDetailPanel.tsx
Outdated
Show resolved
Hide resolved
clients/admin-ui/src/features/test-datasets/DatasetNodeEditor.tsx
Outdated
Show resolved
Hide resolved
clients/admin-ui/src/features/test-datasets/context/DatasetTreeHoverContext.tsx
Outdated
Show resolved
Hide resolved
… cleanup, tests - Flush pending debounced update on detail panel close instead of discarding - Use datasetRef.current in all mutation handlers to prevent stale closure bugs - Extract tree helpers (updateFieldAtPath, removeFieldAtPath, addNestedField, getFieldsAtPath) into dataset-field-helpers.ts with 16 unit tests - Remove dead Redux state/actions from dataset-test.slice (test runner, logs, privacy request tracking no longer used after TestRunnerSection removal) - Replace hardcoded hex colors with design token CSS variables
Resolve conflict in test-datasets.tsx by keeping PR's connectionType prop and connectionConfig extraction while incorporating main's Flex layout with TestResultsSection and TestLogsSection.
- Replace div flex containers with Flex from fidesui in DatasetNodeDetailPanel and DatasetNodeEditor - Rename single-char variable `e` to `edge` in DatasetTreeHoverContext
These components were deleted in d8207d9 but their imports and usages in the test-datasets page were not removed, causing a build failure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket ENG-564
Description Of Changes
Replace the YAML-only dataset editor with an interactive node-based visual editor for SaaS connections using
@xyflow/react. DB connections retain the existing YAML editor. The node editor supports drill-down navigation, CRUD operations, full fides_meta metadata editing, and a collapsible two-way YAML editor panel.https://www.loom.com/share/8d3bb2ce183b446c9a53d6b57550c8d4
Code Changes
DatasetNodeEditor.tsx- Main ReactFlow component with drill-down state, breadcrumb navigation, add/delete/update handlers, highlight animation for new nodes, collapsible YAML editor panel with two-way sync (graph↔YAML)DatasetNodeDetailPanel.tsx- Drawer for editing node metadata: description, data_categories, collapsible fides_meta sections for collections (after, erase_after, skip_processing) and fields (data_type, identity, primary_key, read_only, redact). Debounced updates (300ms). Delete with confirmation.DatasetEditorSection.tsx- Conditional rendering: SaaS → DatasetNodeEditor, DB → Monaco YAML editor. Save handler branches accordingly.AddNodeModal.tsx- Right-side Drawer for naming new collections/fields with uniqueness and format validation. In field mode, includes description, data categories, and collapsible fides_meta form.FieldMetadataFormItems.tsx- Shared form components and helpers extracted to eliminate duplication between AddNodeModal and DatasetNodeDetailPanel. Includes DataCategoryTagSelect with taxonomy suggestions.context/DatasetEditorActionsContext.tsx- Context providing add/delete callbacks to node componentscontext/DatasetTreeHoverContext.tsx- Hover highlighting with precomputed ancestor/descendant sets for performanceuseDatasetGraph.ts- Converts Dataset to ReactFlow nodes/edges. Two views: overview (root→collections) and drill-down (collection→fields with nested support). Guards against malformed YAML data.useDatasetNodeLayout.ts- Dagre LR layout with configurable spacingnodes/DatasetRootNode.tsx- Dataset root nodenodes/DatasetCollectionNode.tsx- Collection node with "+" button (drill-down only), field count badgenodes/DatasetFieldNode.tsx- Field node with "+" button for nested fields, data category count, protected badgenodes/DatasetNodeHandle.tsx- Reusable LR handle componentnodes/DatasetNode.module.scss- Node styling, hover states, highlight animation, accessible focus-within for add buttonsedges/DatasetTreeEdge.tsx- Custom BezierEdge with hover-aware stylingtest-datasets.tsx- Adjusted layout for full-height canvasConnectorParametersForm.tsx- Show "Edit dataset" button for SaaS connectionsSteps to Confirm
/systems/configure/{id}/test-datasetsfor a SaaS connectionPre-Merge Checklist
CHANGELOG.mdupdated