Repository navigation
Keep unsent input when switching pages, tabs or closing dialogs (GODM-31) - #32
Merged
Merged
Conversation
…-31) Chat messages (with attached files), the new chat setup, the new agent page and form, agent settings, Run task, automation and workspace dialogs keep what was typed as a session draft until it is sent, saved or discarded. Drafts only override the fields that were edited, so changes made elsewhere meanwhile are not reverted. The new agent page offers unfinished agents to pick up again.
# Conflicts: # apps/desktop/src/components/agents/agent-actions.tsx # apps/desktop/src/components/automations/one-prompt-card.tsx # apps/desktop/src/pages/agents/agent-new.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes GODM-31.
What does this change?
Anything you've typed but haven't sent now stays put. It survives moving to another page, switching an agent's tabs, clicking outside a dialog, or reloading the window. Come back and it's exactly where you left it, with the cursor at the end so you can keep typing.
Where drafts are kept
How drafts behave
sessionStorage). Attached files and the shared window stay in memory only.Code: everything goes through
apps/desktop/src/lib/drafts.ts.useDraft(key, initial)works likeuseStatebut keeps the value as a draft underkey.DraftStatusincomponents/common.tsxrenders the "Draft saved · Discard" line.Also fixed: the chat composer used to save its draft 250 ms after the last keystroke. Anything typed just before switching pages was lost.
How was it tested?
pnpm typecheckandpnpm testpass (core: 670 pass, 0 fail).GODMODE_HOMEand ports), driven with Playwright in Chromium. 36 checks pass with no console errors:/?prompt=deep link starts on the default agent with a clean setup.Checklist
pnpm typecheckandpnpm testpasscargo clippy/cargo testpass (ifapps/desktop/src-taurichanged): not changedpackages/sharedandapps/desktop/src/lib/api.ts: no API changes