Skip to content

Preserve composer draft when opening files from the explorer - #76

Merged
hardbeat920 merged 1 commit into
hardbeat920:mainfrom
kartava:fix/preserve-composer-draft-across-file-opens
Sep 5, 2026
Merged

Preserve composer draft when opening files from the explorer#76
hardbeat920 merged 1 commit into
hardbeat920:mainfrom
kartava:fix/preserve-composer-draft-across-file-opens

Conversation

@kartava

@kartava kartava commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

What changed

Composer reports its draft to SessionPane, which keeps the latest text and passes it back as initialDraft when the composer remounts. Submit clears it so a sent message does not reappear.

Why

Fixes a bug where a draft message disappears from the chat input when you open a file from the explorer. Type a message in a new session, click any file in the sidebar, and the input is empty.

The file opens in a split next to the session. That moves the composer from the empty view into the dock. React remounts it under the new parent and the typed text is lost. The same happens when a terminal opens in an empty session or the file pane closes.

Keeping the draft in SessionPane, which survives the split, fixes all three cases without touching the layout.

Not covered: attachments and the plan toggle still reset on that remount.

UI

No visual change.

Checklist

  • I ran npm run check
  • This PR is small and focused
  • I did not mix unrelated changes

@hardbeat920

Copy link
Copy Markdown
Owner

thanks @kartava this was bugging me too and never got the chance to fix it myself 🙏

@hardbeat920
hardbeat920 merged commit 9af998a into hardbeat920:main Sep 5, 2026
2 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.

2 participants