feat(ui): add codemirror json editor#162
feat(ui): add codemirror json editor#162siddhant-galileo wants to merge 6 commits intolev/improvejsoneditorfrom
Conversation
| if (existingKeys.has(propertyName)) continue; | ||
| const normalized = normalizeSchema(rawSchema, schemaCursor.rootSchema); | ||
| const type = getSchemaType(normalized) ?? 'string'; | ||
| let defaultValue = '""'; |
There was a problem hiding this comment.
This also regresses the JSON scaffolding guarantees we added in the original editor work. Every object-valued property is inserted as plain {}, so selecting selector, evaluator, or a nested condition node in CodeMirror yields incomplete JSON instead of the valid skeletons Monaco inserts (for example {"path":"*"} or {"name":"","config":{}}). Because the PR exposes CodeMirror as a user-selectable engine, this becomes a user-facing behavior regression rather than an internal implementation detail.
|
|
||
| if (isSelectorPathLocation(path)) { | ||
| const { stepNames, stepTypes } = getScopeFilters(tree); | ||
| const stepPathSuggestions = context.steps |
There was a problem hiding this comment.
These selector-path completions are using step names (fetch_user, database_query, etc.) instead of paths derived from the step schemas. That's a behavior regression from the Monaco editor: users need suggestions like input.query or output.user.email, not step identifiers that are invalid in selector.path.
| path: JsonPath | ||
| ): SchemaCursor { | ||
| let rootSchema = asSchema(context.schema) ?? null; | ||
| if (context.mode === 'evaluator-config' && activeEvaluator?.configSchema) { |
There was a problem hiding this comment.
This regresses evaluator-config autocomplete in the new CodeMirror engine. resolveSchemaAtJsonPath only swaps to the selected evaluator's configSchema for mode === "evaluator-config", but full control JSON editing also needs that override once the cursor enters condition.evaluator.config. As written, the CodeMirror path keeps walking the generic control schema, so keys like values, logic, pattern, and enum suggestions disappear there.
lan17
left a comment
There was a problem hiding this comment.
Thanks for pushing this forward. I found a couple of regressions in the new CodeMirror path that need to be addressed before it reaches parity with the existing Monaco editor:
- CodeMirror never switches to the selected evaluator config schema during full control JSON editing, so condition.evaluator.config loses the evaluator-specific key and enum suggestions.
- Selector-path autocomplete is suggesting step names instead of schema-derived paths, which makes the inserted values invalid for selector.path.
- Object-valued property completions in CodeMirror insert bare {} blocks, which regresses the valid JSON skeletons we already provide for selector, evaluator, and nested condition nodes.
I left inline comments on the relevant spots.
Summary
Updated to use codemirror instead of monaco.
Screen.Recording.2026-04-02.at.5.06.55.PM.mov
Scope
Risk and Rollout
Testing
make check(or explained why not)Checklist