Added node editing feature with save/cancel utility #547
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.
Adds inline editing capability to graph visualization nodes. Users can now click an edit button (✎) on any node to modify its value directly within the graph, with changes automatically syncing to the left-hand JSON text editor.
Changes
New Features
EnterorSavebutton to commit changesEscapeorCancelbutton to discard changesFiles Created
src/features/editor/views/GraphView/CustomNode/TextEditComponent.tsx— Inline editor for primitive valuessrc/features/editor/views/GraphView/CustomNode/RowEditComponent.tsx— Inline editor for object/array rowssrc/features/editor/views/GraphView/stores/useNodeEdit.ts— Zustand store for edit state managementsrc/lib/utils/updateJsonByPath.ts— Utility for updating nested JSON by pathFiles Modified
src/features/editor/views/GraphView/CustomNode/TextNode.tsx— Added edit mode rendering and edit buttonsrc/features/editor/views/GraphView/CustomNode/ObjectNode.tsx— Added row-level editing and edit buttonsrc/features/editor/views/GraphView/CustomNode/styles.tsx— Added styled components for editor UI and buttonsrc/store/useJson.ts— AddedhandleSave()andhandleCancel()actions;handleSave()syncs changes to left-hand editor viauseFile.setContents()Technical Details
State Management
editingNodeId) and providestoggleEdit(),startEdit(), andstopEdit()actionshandleSave(path, newValue)that updates JSON, re-parses the graph, and syncs the text editorArchitecture
foreignObjectelements (valid HTML-in-SVG pattern)jsonParser.ts) provides node paths used by update utilities to modify nested JSON structuresUser Flow
Testing
UI/UX Notes
Related Issues
Ready to merge. The feature is fully functional and tested.