Skip to content

Keep a whitespace-only draft and its payload when undo gives back sent words - #6506

Merged
leaf-agent merged 2 commits into
mainfrom
fix/give-back-whitespace-draft
Nov 19, 2026
Merged

leaf-agent merged 2 commits into
mainfrom
fix/give-back-whitespace-draft

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

#6490 had giveBackWords share holdsWork, the trimmed predicate the drafts list and the leave prompt read. That changed undo: a box holding only whitespace stopped counting as begun, so undoing a sent message dropped the whitespace and replaced the box's own composer payload (its passage and mode) with the sent message's. giveBackWords tests its untrimmed text again; the drafts list and the leave prompt keep sharing holdsWork.

A new runtime test in tests/runtime/drafts.test.mjs gives words back to a composer: draft holding only whitespace and checks that the whitespace follows the given-back words and the box keeps its own payload. It fails on main and passes with the change; pnpm run check passes.

…t words

#6490 had `giveBackWords` share `holdsWork`, the trimmed predicate the drafts list and the leave prompt read. That changed undo: a box holding only whitespace stopped counting as begun, so undoing a sent message dropped the whitespace and replaced the box's own composer payload (its passage and mode) with the sent message's. `giveBackWords` tests its untrimmed text again; the drafts list and the leave prompt keep sharing `holdsWork`.

A new runtime test in `tests/runtime/drafts.test.mjs` gives words back to a `composer:` draft holding only whitespace and checks that the whitespace follows the given-back words and the box keeps its own payload. It fails on `main` and passes with the change; `pnpm run check` passes.
The pre-commit oxfmt hook wrapped the giveBackWords call; no behavior changes.
@leaf-agent
leaf-agent merged commit 7d301aa into main Nov 19, 2026
6 checks passed
@leaf-agent
leaf-agent deleted the fix/give-back-whitespace-draft branch November 19, 2026 08:48
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.

1 participant