Repository navigation
fix(ui): preserve JSON drafts across editor actions - #46
Merged
Merged
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
Core draft-retention behavior is well covered, with only a minor stale-status issue remaining.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Unifies JSON editing around one retained draft, preventing stale requests and editor actions from overwriting unsaved changes.
Changes:
- Preserves drafts across Visual/Raw switching, Save, Apply, reload, and repo additions.
- Adds stale-request protection and read-only YAML handling.
- Adds comprehensive Svelte UI regression tests.
| File | Description |
|---|---|
ui/src/App.svelte |
Implements unified draft and request lifecycle handling. |
ui/test/App.test.ts |
Tests draft retention and asynchronous behavior. |
ui/test/JsonEditor.svelte |
Provides the visual-editor test double. |
ui/vitest.config.ts |
Configures jsdom component tests. |
ui/package.json |
Adds the UI test command and dependencies. |
ui/bun.lock |
Locks the new testing dependencies. |
package.json |
Includes UI tests in the root test command. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…nto fix/editor-draft-retention-41 # Conflicts: # ui/src/App.svelte
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.

Preserve the current JSON draft across editor actions. Save adopts acknowledged server state only when the draft revision still matches the sent revision; Preview, Apply, repo additions, delayed responses and failures do not reload over newer edits. Reload explicitly discards edits after confirmation. Track partial Save/Apply outcomes and clear stale feedback before local repo append.
Closes #41. Repo additions update the local draft and require explicit Save. Tests exercise late responses, newer edits, failures, busy/partial outcomes and stale status messages. Existing Copilot finding is fixed and resolved.
Based on merged #44/#45 and audited #39. Resolve UI dependency locks by keeping audited versions plus the existing UI tests; preserve the tested local draft flow when merging the standalone API UI changes. Automatic tags/npm publication remain disabled.
Validation at
fcc507e98b056e5b37e89e9ca94d7ab437a63f41: frozen root/UI installs, lint, root/UI TypeScript, 103 CLI/API/release tests + 14 UI tests, full build and real tarball checks pass. The final ancestry merge preserves the exact source tree already tested. Root Bun/UI Bun/root npm audits are all 0. Exact-head CI37118899898 and Security37118900025 (audit + CodeQL) succeed. Fresh Copilot review remains unavailable from its earlier quota limit.