Skip to content

fix: keep unsent Cmd+K Compose drafts when reopened - #207307

Merged
vyctorbrzezowski merged 1 commit into
mainfrom
openclaw/corrigir-prompt-perdido-ao-fechar-composer-cmd-k-629384
Nov 28, 2026
Merged

vyctorbrzezowski merged 1 commit into
mainfrom
openclaw/corrigir-prompt-perdido-ao-fechar-composer-cmd-k-629384

Conversation

@vyctorbrzezowski

Copy link
Copy Markdown
Member

What Problem This Solves

Closing the Cmd+K palette while writing in Compose erased a text-only prompt. Reopening the palette showed an empty field, so the author had to write it again.

User Impact

Press Escape or Cmd/Ctrl+K, then reopen the palette to continue the same draft. This works even on the first open, while the palette is still loading. Search queries still start fresh, and reopening never sends a message.

Why This Change Was Made

Compose now retains its existing in-memory draft on dismissal, with or without an attachment. The loading view also keeps the draft for handoff, but cancels any queued send. No prompt is written to browser storage or carried across a reload or account change.

Evidence

Reopen Compose after Escape

Before After
Empty Compose field after reopening The original prompt after reopening
Before, empty field highlighted After, restored prompt highlighted
Placeholder instead of the draft Preserved text in the same field

Chromium, isolated Gateway, synthetic prompt: type “Compare the two release notes”, press Escape, reopen with Cmd+K. Screenshots: installed UI at ef21b5827db0 versus candidate 51ccdb8ea25a. The automated regression was also red on the PR base (7cbf17b5819b).

  • Reproduced both text-only failures on the base through the keyboard shortcut in Chromium. The same browser scenarios passed with the fix, alongside the existing attachment, Search and submission cases (10 browser scenarios and 115 focused unit tests).
  • Local autoreview of 7cbf17b5819b..51ccdb8ea25a reported no actionable P0/P1 findings in the selected diff. The review did not independently exercise account switching or subsequent manual submission.
  • Checked Escape and reopen against an authenticated, isolated Gateway: the old bundle reopened empty; the candidate restored the exact prompt.
  • UI type checking, targeted lint, formatting and diff checks passed. The UI compiled. The base and candidate both exceed the existing largest/total CSS and chat boot limits: identical CSS, 21 chat boot JS requests in both, and 11 additional gzip bytes of chat boot JS on the candidate. No budget thresholds changed.

🦞 Made with OpenClaw

@clawsweeper

clawsweeper Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: S labels Nov 28, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 28, 2026
@clawsweeper

clawsweeper Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

This PR preserves unsent Cmd+K Compose text across dismissal and reopening, including during the initial lazy load.

Example: Type “Compare the two release notes” in Compose, press Escape, and reopen Cmd+K.

  • Before: The field is empty.
  • After: The original prompt remains available without being submitted.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A worthwhile, focused repair with inspected application proof and distinct browser regression coverage.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after screenshots and the accompanying Chromium reproduction against an authenticated isolated Gateway show the candidate restoring the exact prompt after Escape and Cmd+K reopening; reported browser regressions additionally exercise cold handoff and queued-send cancellation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Dismissing Compose discards an unsent text-only prompt and forces the user to rewrite it.
Reason: Preventing lost writing has clear value, and the maintainer-authored direction extends the existing in-memory attachment-draft behavior with little production complexity.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR fixes a current draft-loss bug, and review found no actionable correctness or security defects.

Reviewed head: 51ccdb8ea25a7bd0d67eb899f7ef19fe9c43ea34

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI shell holds input while the palette loads, then transfers it to the existing session-draft owner; explicit submission uses the background-session creation flow.

flowchart LR
  A[Keyboard or palette action] --> B[Shell palette owner]
  B --> C[Loading input custody]
  C --> D[Loaded palette state]
  B --> D
  D --> E[Session draft owner]
  E --> F[Background session creation]
Loading

Technical review

Best possible solution:

Retain Compose text through the existing draft owners while preserving fresh Search queries, canceled queued sends, and account-scope cleanup.

Do we have a high-confidence way to reproduce the issue?

Current-main source establishes both reset paths, and the author supplies base-failing browser regressions plus before/after application captures; this review did not execute target code.

Is this the best way to solve the issue?

The patch is a small, complete repair at the existing loading and session-draft owners, without introducing another storage or submission path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 23ea8a9a3c51.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vyctor H. Brzezowski: Raw commit aeae6d1 adds ui/src/pages/new-session/palette-session-draft.ts:181 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: aeae6d1d79a3; files: ui/src/pages/new-session/palette-session-draft.ts)

PR surface

Source +2, Tests +12, Docs 0. Total +14 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 18 16 +2
Tests 2 46 34 +12
Docs 1 5 5 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 69 55 +14

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 28, 2026, 2:16 AM ET / 07:16 UTC.

@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review November 28, 2026 07:22
@vyctorbrzezowski
vyctorbrzezowski merged commit 1a79168 into main Nov 28, 2026
92 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the openclaw/corrigir-prompt-perdido-ao-fechar-composer-cmd-k-629384 branch November 28, 2026 07:22
vincentkoc added a commit that referenced this pull request Nov 28, 2026
* commit '262f14aab89ca286633992760fa45aeeded998f9': (207 commits)
  fix(ui): remove redundant type argument from Board browser test (#207352)
  test(channels): distinguish status and batch fixtures (#207232)
  fix(ui): type the Board drop test mock as void (#207348)
  fix(ui): break the Skill Workshop import cycle (#207345)
  test(channels): expose label guard regressions (#207195)
  fix: explain when a previous automation run keeps the agent from starting (#207180)
  refactor(test): consolidate loader proof and repair rollback coverage (#207152)
  fix(agents): one tool-result bound on every route, untrusted-content wrapper intact (#207101)
  test(plugins): verify staged SDK named exports (#207170)
  fix(ui): truncate empty Compose hints on narrow screens (#207301)
  fix: keep unsent Cmd+K Compose drafts when reopened (#207307)
  fix: explain chat update errors when a session changes (#206419)
  fix(ios): keep consecutive commands on one line in chat (#207242)
  fix(ios): keep connection messages from flashing when chat reopens (#207233)
  fix(ios): give Sessions groups more breathing room (#207221)
  fix(ui): show chat completions as activity rows (#201891)
  fix(ui): make empty composer hints look distinct from drafts (#207295)
  fix: explain why chat won’t attach an empty file (#206402)
  fix(agents): show Doctor's restore-first warning before deleting a held store (#207290)
  test(channels): fix join failure proof and trim probe fixture (#207264)
  ...
vincentkoc added a commit that referenced this pull request Nov 28, 2026
* commit '262f14aab89ca286633992760fa45aeeded998f9': (207 commits)
  fix(ui): remove redundant type argument from Board browser test (#207352)
  test(channels): distinguish status and batch fixtures (#207232)
  fix(ui): type the Board drop test mock as void (#207348)
  fix(ui): break the Skill Workshop import cycle (#207345)
  test(channels): expose label guard regressions (#207195)
  fix: explain when a previous automation run keeps the agent from starting (#207180)
  refactor(test): consolidate loader proof and repair rollback coverage (#207152)
  fix(agents): one tool-result bound on every route, untrusted-content wrapper intact (#207101)
  test(plugins): verify staged SDK named exports (#207170)
  fix(ui): truncate empty Compose hints on narrow screens (#207301)
  fix: keep unsent Cmd+K Compose drafts when reopened (#207307)
  fix: explain chat update errors when a session changes (#206419)
  fix(ios): keep consecutive commands on one line in chat (#207242)
  fix(ios): keep connection messages from flashing when chat reopens (#207233)
  fix(ios): give Sessions groups more breathing room (#207221)
  fix(ui): show chat completions as activity rows (#201891)
  fix(ui): make empty composer hints look distinct from drafts (#207295)
  fix: explain why chat won’t attach an empty file (#206402)
  fix(agents): show Doctor's restore-first warning before deleting a held store (#207290)
  test(channels): fix join failure proof and trim probe fixture (#207264)
  ...
vincentkoc added a commit that referenced this pull request Nov 28, 2026
* commit '262f14aab89ca286633992760fa45aeeded998f9': (207 commits)
  fix(ui): remove redundant type argument from Board browser test (#207352)
  test(channels): distinguish status and batch fixtures (#207232)
  fix(ui): type the Board drop test mock as void (#207348)
  fix(ui): break the Skill Workshop import cycle (#207345)
  test(channels): expose label guard regressions (#207195)
  fix: explain when a previous automation run keeps the agent from starting (#207180)
  refactor(test): consolidate loader proof and repair rollback coverage (#207152)
  fix(agents): one tool-result bound on every route, untrusted-content wrapper intact (#207101)
  test(plugins): verify staged SDK named exports (#207170)
  fix(ui): truncate empty Compose hints on narrow screens (#207301)
  fix: keep unsent Cmd+K Compose drafts when reopened (#207307)
  fix: explain chat update errors when a session changes (#206419)
  fix(ios): keep consecutive commands on one line in chat (#207242)
  fix(ios): keep connection messages from flashing when chat reopens (#207233)
  fix(ios): give Sessions groups more breathing room (#207221)
  fix(ui): show chat completions as activity rows (#201891)
  fix(ui): make empty composer hints look distinct from drafts (#207295)
  fix: explain why chat won’t attach an empty file (#206402)
  fix(agents): show Doctor's restore-first warning before deleting a held store (#207290)
  test(channels): fix join failure proof and trim probe fixture (#207264)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 29, 2026
tideclaw-bot pushed a commit that referenced this pull request Nov 29, 2026
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
(cherry picked from commit 1a79168)

Release adaptation: Populate the Compose input before dismissal in the reopen fixture; preserve the existing retained-text and mode assertions. No runtime changes to the donor.

Companion audit: PR #207307 is selected. Keep Cmd+K draft ownership distinct from the earlier Send-after-model-switch fix and normal composer state.

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant