Add combined Copy+Close action on case page (with back-to-list) and case list #14
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Request
A single combined action that, in one click:
server/templates/case_page.html): copy the document text to the clipboard, close the case, and return to the case list at/cases.server/templates/my_cases.html): per row, copy that case's document text to the clipboard and close the case (staying on the list).Today these are separate controls; the request is to fuse copy + close (+ back-to-list on the case page) into one button so a finished case is handled in one gesture.
Current state (verified)
The building blocks already exist as separate controls:
#copy-btnatserver/templates/case_page.html:575, click handler atserver/templates/case_page.html:624reads#doc-body.innerTextand callsnavigator.clipboard.writeText()(with atextarea/execCommandfallback).POST /cases/{case_id}/close, handler atserver/src/routes/case_actions.rs:437, route wired atserver/src/routes/mod.rs:52. It persists a.closedJSON marker (server/src/paths.rs:58,struct CloseMarker { closed_at: String });reopenremoves it.server/templates/case_page.html:440.<a class="back" href="/cases">atserver/templates/case_page.html:380.formaction="/cases/{case_id}/close") atserver/templates/my_cases.html:153, inside the bulk<form method="post">. There is no copy control on the list today.GET /cases/{case_id}(server/src/routes/user_web.rs:728), case listGET /cases(server/src/routes/user_web.rs:617).Design considerations (to resolve during implementation)
navigator.clipboard.writeText()must complete inside the user-gesture context before any form-submit navigation fires, or the copy is lost. The combined handler needs toawaitthe clipboard write and only then submit the close form.server/src/routes/case_actions.rs:437likely already redirects back to/cases; if so, the case-page "back-to-list" part is satisfied by the existing close redirect and needs no extra navigation. Verify the handler's response before adding redundant navigation.analysis_htmlpreview (server/templates/my_cases.html), not necessarily the full document text in the DOM. A per-row copy therefore needs the full document text either embedded per row or fetched on click. Decide which; this drives feasibility and page weight.csrf::fieldmacro; any new submit path must carry the same token.Acceptance checklist
/cases, with the clipboard write guaranteed to complete before navigation./cases.clipboard.writeTextfallback path for browsers without the async Clipboard API.