Skip to content

fix(ui): preserve JSON drafts across editor actions - #46

Merged
ts-76 merged 15 commits into
mainfrom
fix/editor-draft-retention-41
Oct 3, 2026
Merged

ts-76 merged 15 commits into
mainfrom
fix/editor-draft-retention-41

Conversation

@ts-76

@ts-76 ts-76 commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

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.

@socket-security

socket-security Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedjsdom@​27.4.09510010095100

View full report

@ts-76
ts-76 marked this pull request as ready for review October 3, 2026 09:31
Copilot AI balanced review requested due to automatic review settings October 3, 2026 09:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Medium severity

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.

Comment thread ui/src/App.svelte
@ts-76
ts-76 requested a balanced review from Copilot October 3, 2026 09:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ts-76
ts-76 changed the base branch from fix/editor-request-boundaries-42 to main October 3, 2026 11:11
@ts-76
ts-76 merged commit b3c9291 into main Oct 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Visual・Raw切替とrepo追加で編集内容を保持する

2 participants