feat(support): keep the reply draft of a ticket while leaving the screen - #1456
TaprootFreak merged 6 commits into
Conversation
ad55150 to
83cdf6d
Compare
83cdf6d to
3f1f9b9
Compare
A clerk who starts a reply, leaves the ticket (customer profile, list, another ticket) and comes back found the composer empty: the text lived only in the screen's state, which the navigation unmounted. The draft is now kept per ticket in sessionStorage (util/support-draft) through a drop-in hook (useSupportDraft) that replaces the plain useState in the DFX and the RealUnit ticket screen. It restores the text on mount, writes every change through, and reloads on a ticket switch. sessionStorage keeps the draft in the tab only and is wiped on login, so it never reaches another clerk; a draft older than 24 hours is dropped on read. Storage failures degrade to "no draft". The draft is removed before the send request and put back if the send fails, so a detour during the send cannot resurrect text that is already on its way. Attachments are not kept.
3f1f9b9 to
70862b3
Compare
Capturing the ticket id at send start keeps the draft in that ticket's sessionStorage if the clerk opens another ticket while the request is in flight. The composer is only filled again when still on the same ticket. The textarea is disabled while sending.
Leaving a send running and opening another ticket in the same screen instance must not keep the composer disabled or attach files to the wrong ticket. Attach is disabled while sending.
After a ticket switch, a late send must not clear files, reload messages, set the error, or drop isSending on the newly opened ticket.
|
EN: DE: DetailsGrok quality 0. In-flight send state and late success/failure updates are scoped to the sending ticket id (HEAD |
|
EN: DE: DetailsVisual check of |
EN:
A ticket reply draft is kept in this tab while the clerk leaves the screen. A failed send restores that draft onto the same ticket, not onto a ticket opened in the meantime.
DE:
Der Antwortentwurf eines Tickets bleibt im Tab, wenn man den Bildschirm verlässt. Ein fehlgeschlagener Versand stellt den Entwurf auf demselben Ticket wieder her, nicht auf einem inzwischen geöffneten.
Details
src/util/support-draft.tsandsrc/hooks/support-draft.hook.ts: 100/100/100/100 (Node 20). Darwin Playwright baselinerealunit-support-02-issueshows the composer with the restored draft text. The DFX issue screen shares the same draft hook; no separate DFX issue-detail darwin file — declared. Ticket screens remain below 100% (overlap with other open ticket-screen PRs).