field reorder on rename in EditableSchemaForm (#8447)

* fix: track schema.properties reference not keys in EditableSchemaForm

Object.keys() tracked key enumeration, so renaming a field triggered
onSchemaChange -> alignOrderWithProperties -> reorder. schema?.order
created a feedback loop since alignOrderWithProperties writes to it.

Only schema?.properties (the object reference) is needed to detect
when inferArgs replaces properties (schema.properties = {}).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: revert EditableSchemaForm effect to original

The added schema?.order and Object.keys(schema?.properties) tracking
caused field reordering on rename — Object.keys returns the renamed
key at the end (JS insertion order after delete+add), and schema?.order
created a feedback loop with alignOrderWithProperties. Revert to the
original schema reference-only tracking.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ruben Fiszel
2026-03-19 06:35:02 +00:00
committed by GitHub
parent c0edbe4317
commit 0ab9a81e20
@@ -297,9 +297,7 @@
}
const editTabDefaultSize = untrack(() => noPreview) ? 100 : 50
editPanelSize = untrack(() => editTab)
? (untrack(() => editPanelInitialSize) ?? editTabDefaultSize)
: 0
editPanelSize = untrack(() => editTab) ? (untrack(() => editPanelInitialSize) ?? editTabDefaultSize) : 0
let inputPanelSize = $state(100 - editPanelSize)
let editPanelSizeSmooth = tweened(editPanelSize, {
duration: 150
@@ -333,10 +331,6 @@
}
})
$effect(() => {
// Track schema properties and order so this effect re-runs when
// inferArgs rebuilds the schema (not just on reference change).
schema?.order
Object.keys(schema?.properties ?? {})
schema && untrack(() => onSchemaChange())
})
$effect(() => {