Skip to content

feat(support): keep the reply draft of a ticket while leaving the screen - #1456

Merged
TaprootFreak merged 6 commits into
DFXswiss:developfrom
Blume1977:feat/support-reply-draft-persistence
Sep 8, 2026
Merged

TaprootFreak merged 6 commits into
DFXswiss:developfrom
Blume1977:feat/support-reply-draft-persistence

Conversation

@Blume1977

@Blume1977 Blume1977 commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

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.ts and src/hooks/support-draft.hook.ts: 100/100/100/100 (Node 20). Darwin Playwright baseline realunit-support-02-issue shows 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).

@Blume1977
Blume1977 force-pushed the feat/support-reply-draft-persistence branch 2 times, most recently from ad55150 to 83cdf6d Compare September 7, 2026 10:33
@Blume1977
Blume1977 force-pushed the feat/support-reply-draft-persistence branch from 83cdf6d to 3f1f9b9 Compare September 7, 2026 10:45
@TaprootFreakAI TaprootFreakAI added the ci Run PR CI on this draft label Sep 7, 2026
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.
@TaprootFreakAI
TaprootFreakAI force-pushed the feat/support-reply-draft-persistence branch from 3f1f9b9 to 70862b3 Compare September 7, 2026 16:24
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.
@TaprootFreakAI

Copy link
Copy Markdown
Collaborator

EN:
Ready after 2 review passes.
A ticket reply draft stays in this tab; a failed send restores it on the same ticket.

DE:
Bereit nach 2 Review-Durchläufen.
Der Antwortentwurf bleibt im Tab; ein fehlgeschlagener Versand stellt ihn auf demselben Ticket wieder her.

Details

Grok quality 0. In-flight send state and late success/failure updates are scoped to the sending ticket id (HEAD afa1e1c9). Util/hook coverage 100/100/100/100. Screen coverage and Playwright issue-detail baseline declared. Build and test SUCCESS. mergeable=MERGEABLE.

@TaprootFreakAI
TaprootFreakAI marked this pull request as ready for review September 7, 2026 19:09
@TaprootFreakAI
TaprootFreakAI marked this pull request as draft September 7, 2026 20:33
@TaprootFreakAI

Copy link
Copy Markdown
Collaborator

EN:
Ready after 3 review passes.
A ticket reply draft is kept while leaving the screen and restored on the same ticket after a failed send.

DE:
Bereit nach 3 Review-Durchläufen.
Der Antwortentwurf bleibt beim Verlassen des Screens und kommt nach fehlgeschlagenem Versand auf dasselbe Ticket zurück.

Details

Visual check of realunit-support-02-issue: composer shows the draft text and Send. Declared: no separate DFX issue-detail darwin file. Codex quality 0. Codex logic note that the spec fills the textarea rather than re-navigating is accepted as a visual aid, not a product defect. CI green. MERGEABLE.

@TaprootFreakAI
TaprootFreakAI marked this pull request as ready for review September 7, 2026 21:33
@TaprootFreak
TaprootFreak merged commit 8cbee36 into DFXswiss:develop Sep 8, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Run PR CI on this draft

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants