Repository navigation
[0.2.1-rc.2] Draft text is lost when switching sessions #10223
Replies: 2 comments
|
The text is not discarded — it is still in Where the text goesEach draft is persisted per session id as you type:
Two things confirm it survives rather than evaporates: reloading the page while still in that session brings the text back, and the key is still in DevTools afterwards — Why you cannot get backTwo independent choices combine:
That last branch is the defect. So the asymmetry is a single call site:
The handover that already exists is the wrong tool hereThere is a working draft-transfer implementation in the same tree — It is tempting to reuse that for the New Session button, and it would be wrong for your scenario: you switch away to copy an identifier and then want to come back to your text. Handover moves the text into the other conversation — the draft would follow you into a session you did not mean to write in. The mechanism fits "replace where I am typing", not "park this while I look at something". What I think the fix isMake If the intended reading is instead "a blank with content should stay visible in the tree", that is a different change with a different cost: Two smaller observations while tracing this:
One question that decides which of the two fixes is the intended one: when you switch away mid-draft and later click "New session", would you expect to land back on the text you left (reuse), or to get a clean session with the old text still waiting somewhere (a visible draft row)? The first is the cheap change; the second is the more honest model if drafts are meant to be first-class. |
|
Correction to my comment above — the headline fix I proposed is wrong, and the repository says so in a file I should have read before writing it. What I got wrongI framed " Making the button reuse the blank therefore would not be a one-argument fix — it would reinstate the behaviour that guide retired. The Host's reuse rule runs the requested preset, or the configuration default when the request names none, and does not resolve the preset the blank recorded; and when the target is already the current live agent it is returned without re-mounting. A live blank that is already on the default preset would come back exactly as it was, with its old composition. So the change would trade a lost draft for a stale agent, which is the worse of the two. What still holds from the first comment
The finding that replaces itTracing this properly turns up a narrower and more useful gap: the public entry point cannot express the combination this use case needs. So today it is either:
There is no "fresh Session, carry the draft across". That is the actual gap, and it does not conflict with the guide: the guide's third sentence even preserves the exception ("Calls with draft-preparation options preserve their existing reuse and content rules"), which is precisely the coupling that makes the missing case inexpressible. Suggested direction, revisedAdd an explicit opt-in that keeps fresh creation and moves the content: have One caveat on the handover shape, since it is my own earlier objection: moving the text into the next session is wrong for a user who leaves to copy something and comes back. The opt-in therefore needs a destination — the standing blank, keyed by workspace, restored when that session is reopened — rather than "whatever session is opened next". That is the design question worth settling before code: is an unsent draft attached to a Session, or to a Workspace? Today it is the Session, and that is the choice producing this report. Sorry for the extra round trip; the first comment's mechanism sections are sound, its recommended fix was not. |
Uh oh!
There was an error while loading. Please reload this page.
Problem
We start a new session (using the "New session" button), type part of the text, then switch to another session (there's often a need to copy something from another session — a file name or some other identifier), and the newly typed text disappears and has to be typed again. We end up having to type the text on the side and then copy the fully typed text over, which is very inconvenient.
Proposal
I don't know what the best approach would be, but it would be good to support this user use case.
All reactions