feat: inline editing of node values from the properties panel#417
Open
shaunpatterson wants to merge 2 commits into
Open
feat: inline editing of node values from the properties panel#417shaunpatterson wants to merge 2 commits into
shaunpatterson wants to merge 2 commits into
Conversation
Turns Ratel from a read-only viewer into an editor for scalar values (the headline feature of tools like G.V()): - Each attribute row in the node properties panel gets edit and delete actions: edit opens an inline input (number input for numbers, true/false select for booleans), Enter/check saves, Escape cancels; delete is two-step (trash -> 'sure?'). - '+ Add value' row sets a new predicate on the node. - Saves run single-triple N-Quad mutations (commitNow) through the existing dgraph client; values are written with the original value's type (xs:int / xs:float / xs:boolean, escaped strings) so edits never silently retype a predicate. Errors from the server surface in the panel; successful edits update the in-memory node. - lib/mutations.js validates uids (hex) and predicate names (no angle brackets/whitespace - no N-Quad injection), escapes string literals, and is fully unit-tested (11 tests). Mutation output verified against a live Dgraph v25: set string with escaped quotes, set typed int, delete specific/all values - all accepted and the final state matches. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What
Lets users edit graph data directly from the node properties panel instead of hand-writing mutations — the headline capability of commercial graph IDEs like G.V():
Safety
lib/mutations.jsbuilds single-triple N-Quad mutations (commitNow) through the existing dgraph client, with:0x[hex], predicate names reject angle brackets/whitespace/quotes; string literals are escaped (backslashes, quotes, newlines, tabs).xs:int/xs:float/xs:boolean, plain strings), and user input is coerced back to that type with a clear error when it doesn't parse.Testing
npm run buildpasses.🤖 Generated with Claude Code