githubnext/ace2Public

Ace: a collaborative coding environment on the team's own machines

Verify unsent composer drafts survive a signed desktop quit and relaunch

IA

An unsent composer draft disappeared when the desktop app was quit and relaunched during native dogfooding. Existing channel messages remained present.

Observed during #8 / #76 validation:

1. The real Ace composer contained the synthetic unsent text `alpha duplic`. 2. Ace-dev was quit and relaunched against the same isolated development channel data. 3. The channel's messages were still present, but the composer was empty. Its fresh Accessibility value was only WebKit's empty-editor linefeed, not the prior draft.

Before: `/tmp/ace-actions-validation-xaLuQq/keyboard-webview-QJVHFD/observation.json` records `Message` as `alpha duplic` (PID `7944`, window `2533`). After relaunch: `/tmp/ace-actions-validation-xaLuQq/keyboard-webview-tNcEkQ/observation.json` records the empty composer (PID `20701`, window `2679`). These were native observations of the actual Ace UI. The development candidate was keyboard parent `d04c8c4` plus the uncommitted literal-insertion fix for #76; this is not a released-canary regression claim.

## Status

#165 (`5194bf7`) stores drafts in `localStorage` under the existing `ace:draft:<scope>` keys and writes every edit synchronously (the earlier `sessionStorage` storage, 500 ms debounce and unmount flush are gone). Live legacy `sessionStorage` drafts migrate. Real headless Chromium with a persistent profile restored settled and rapid-close drafts with identical editor JSON and Unicode, kept two channels and the dashboard isolated, cleared drafts on admitted send and on discard, and kept a draft after a refused admission ([details](https://github.com/githubnext/ace2/issues/77#issuecomment-6026120388)). The quota-failure path was reviewed but not exercised.

Remaining: the signed desktop (WKWebView) quit/relaunch check in the last item below, which is still unverified. A native attempt on Oct 6 stopped at the Open dialog before reaching it ([#73](https://github.com/githubnext/ace2/issues/73#issuecomment-6026757352)).

Expected:

- Restore unsent composer text after a normal desktop quit/relaunch and return to the same channel/chat. - Keep drafts isolated to the appropriate composer scope; do not restore another channel/chat's draft. - Preserve Unicode, multiline text, and the editor document without sending it automatically. - Clear the saved draft after a successfully admitted send or an explicit discard, while failed admission keeps it available. - Verify the real signed desktop quit/relaunch path with a synthetic draft and unchanged persisted messages. Check rapid quit as well as a settled draft, with Unicode/multiline text, per-channel isolation and unchanged persisted messages.

This is separate from #59, which owns agent/message mode defaults, mode persistence, and Escape behavior. It was discovered during #8 native validation, but belongs to #5 dogfooding core/QOL rather than changing the native input contract.

  1. iamnbutlerreferenced this in [Meta] Dogfood Ace end to end #5last month on GitHub

  2. iamnbutlerreferenced this in [Meta] Complete native computer use in Ace #8last month on GitHub

  3. iamnbutlerreferenced this in Add literal desktop insertion with reserved clipboard ownership #67last month on GitHub

  4. iamnbutlerreferenced this in fix(ui): keep unsent composer drafts across restart #165last month on GitHub

  5. IA
    Author

    Draft PR #165 (`cf89a0f`) addresses the browser-side storage cause; part of #5 dogfooding.

    **Change** (only `packages/ui/src/hooks/use-draft.ts`): drafts are stored in `localStorage` under the existing `ace:draft:/channels/<id>` and dashboard project keys, and every edit is written synchronously (the 500 ms debounce and unmount flush are gone). A live legacy `sessionStorage` draft migrates unless a durable draft already exists. The legacy entry is removed only after a durable copy exists, and clear removes both. Saving is best-effort: storage failures never break input. Clear-on-admitted-send and keep-on-failed-admission are unchanged.

    **Evidence** (real headless Chromium 1243 with a persistent profile, isolated host on port 4987, ACE_HOME/config/keychain under `/tmp/ccbe4e5a8809f60b-durable-composer-drafts`; old bundle `index-DJNHHIHs.js` vs changed `index-BCei-djz.js`): - Old bundle: settled and rapid drafts were both lost after a profile restart. - Changed bundle after restart: - The settled dashboard draft came back with identical JSON (Unicode, hard_break). - A rapid-close channel draft also came back (close requested immediately after the last keystroke; the process closed 27 ms later). - Two channels and the dashboard stayed isolated. - Migration of drafts generated by the old editor: the dashboard and channel A migrated with identical JSON and their session entries were removed. In channel B, the durable draft won over the legacy one. - A real human send (A, and C in a second run) cleared the draft from both stores; the message persisted on the host, and the draft did not return after restart. - A real rejected `ask` with no provider ("Add a provider key…") kept B's draft, including across restart. Explicit discard cleared it. - The quota smoke was inconclusive: the filler never reached the quota, so the storage-failure branches were reviewed but not exercised at runtime. - `bun types`, `bun run ci`, and React Doctor (100/100) all passed. Every host and browser I started was stopped and verified gone.

    **Pending:** native signed desktop quit/relaunch (WKWebView persistence), while the macOS session is locked. The user deferred two-person validation; this browser-local hook does not materially need it.

  6. iamnbutlerreferenced this in Default to agent mode and retain composer mode per channel #59last month on GitHub

  7. iamnbutlerreferenced 5194bf75bd24last month on GitHub

  8. iamnbutlerrenamed Retain unsent composer drafts across desktop restart to Verify unsent composer drafts survive a signed desktop quit and relaunchlast month on GitHub

  9. iamnbutlerparent-issue-addedlast month on GitHub

  10. iamnbutlerreferenced this in Verify Ace with two machines on the tailnet #10last month on GitHub