Repository navigation
fix(ui): autosave acks wipe open add-entry drafts and in-progress JSON text - #123502
Conversation
…ogress JSON A drained autosave ack (and the config.changed refresh path) clones the whole config form, changing every object/array identity while content is byte-identical. The collection add-entry draft closed on identity change and the JSON textarea reset its uncommitted text — the operator's typing vanished ~1s after any earlier toggle. Both guards now check content equality when the identity churns; a genuinely external content change still closes/resets as before.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs changes before merge. Reviewed August 14, 2026, 7:46 AM ET / 11:46 UTC. ClawSweeper reviewWhat this changesThe PR preserves open collection-entry drafts and invalid JSON text when an autosave acknowledgement replaces form values with equal cloned objects. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open: the reset guards are localized to the two owning UI controls, but both requested equal-clone regressions remain unproven and the collection-draft comment still exceeds the scoped three-line limit. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI renders editable configuration from the runtime config draft. Autosave acknowledgements replace that draft with persisted config, and collection drafts or JSON textareas decide whether to retain local typing or reset for a real external value change. flowchart LR
A[Settings form input] --> B[Runtime config draft]
B --> C[Autosave acknowledgement]
C --> D[Cloned config snapshot]
D --> E[Collection and JSON reset checks]
E --> F[Preserve local typing]
E --> G[Reset after external change]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +9, Tests +33. Total +42 across 4 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Keep the owner-local equality checks, add real cloned-value coverage for both controls, and retain reset coverage for genuinely changed external values. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: autosave clones a clean config form and the pre-patch reset guards treated the resulting identity change as an external update. No live browser reproduction was run in this read-only review. Is this the best way to solve the issue? Yes, with the missing tests: semantic equality belongs at the two UI reset owners, while a real source-content change still takes the reset path. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 37a63fbf450e. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
|
Merged via squash.
|
…ogress JSON (openclaw#123502) A drained autosave ack (and the config.changed refresh path) clones the whole config form, changing every object/array identity while content is byte-identical. The collection add-entry draft closed on identity change and the JSON textarea reset its uncommitted text — the operator's typing vanished ~1s after any earlier toggle. Both guards now check content equality when the identity churns; a genuinely external content change still closes/resets as before.
What Problem This Solves
Toggle any switch, then click "Add" on an array/map and start typing — about a second later the debounced autosave ack lands and the add-entry panel silently vanishes with the typed key/value. Same for in-progress (not-yet-valid) JSON in a map entry: the textarea resets mid-typing. An unrelated committed write destroys component-local input with no visible reason.
Why This Change Was Made
adoptConfigSetAck(and the non-preservingapplyConfigSnapshotpath reached viaconfig.changed) replaces the whole form withcloneConfigObject(parsed)— every object/array identity changes while content stays byte-identical.ConfigFormCollectionDraft.willUpdateclosed the draft on!Object.is(sourceIdentity)and the JSON textarea ref resetelement.valueonsourceValueidentity change. Both guards now use identity-or-content:Object.isshort-circuits the hot path,configValuesEqual(the existing schema-value equality) decides when identity churns. A genuinely external content change still closes the draft / resets the textarea exactly as before — two existing tests that accidentally pinned the destructive byte-identical case were tightened to assert the content-change semantics instead (external change closes, identical-content churn preserves).User Impact
In-progress form input survives the autosave cycle that the form itself triggers. No more disappearing add-entry panels or erased JSON while editing settings.
Evidence
config-form-array-integrity.browser.test.ts: open draft + typed text survives a re-render with identical content (fails pre-fix: draft closed, text lost). Suite 14 passed.config-form-integrity.browser.test.ts: tuple-draft test now proves both directions (identical-content churn keeps the draft; real external change closes it); JSON-reset test uses a genuine content change. 11 passed.pnpm tsgo:uiclean.Found via the config/settings lane of the round-2 web-UI QA campaign (finding L21-2).