# Feature COMMS-1152 - Warn about unsent changes when leaving a collaborative document

Project: Stream Communicator
Status: new
URL: https://community.openproject.org/work_packages/COMMS-1152

## Planning

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Target versions | 18.1.0 |
| Sprint |  |
| Backlog bucket |  |
| Votes |  |
| List |  |
| Roadmap |  |
| Relevance |  |

## OPEN POINTS / FEEDBACK

_No work packages_

## Use cases

_No work packages_

## Features and Chunks

_No work packages_

## Bugs and other work packages

_No work packages_

## Technical Details

| Attribute | Value |
| --- | --- |
| Module |  |
| Feature Flag |  |
| Requires doc change | No |
| Enterprise plan |  |

## Details

| Attribute | Value |
| --- | --- |
| Pull preview |  |
| Mockups |  |
| Accessibility | No |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Feature Lead |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| PD (min) |  |
| PD (max) |  |
| Work |  |
| Labor costs |  |

## Description

**As** an editor of a document
**I want to** be warned when I leave a document while some of my changes have not reached the server
**so that** I do not assume they were saved and visible to others

**Acceptance criteria**

*   When I close or reload the tab while the document has changes that have not reached the server, the browser asks me to confirm leaving.
*   When I navigate away within the application in the same situation, I am warned and can choose to stay on the document.
*   When all changes have reached the server, I can leave without a warning.
*   When I can only read the document, I never see the warning.
*   If I leave anyway, my unsent changes are kept in the browser and sent the next time I open the document.

**Technical notes**

*   Follow-up to COMMS-649 (https://github.com/opf/openproject/pull/26970), raised in review.
*   The collaboration provider already knows whether there are unsynced changes; the warning should use that as its single source.
*   Closing or reloading the tab can only use the browser's own `beforeunload` prompt, whose text cannot be customized.
*   The warning for navigation within the application needs a design decision (dialog wording and actions).

**Permissions and visibility considerations**

*   Visible to users who can edit the document (`manage_documents`).
*   Not visible to users with read-only access, or when there are no unsent changes.

**Translation considerations**

*   "Unsent changes" / "Leave document" / "Stay": wording of the in-app warning, to be aligned with the existing offline hints ("You are currently offline.").

**Out of scope**

*   Removing the offline copy on tab close or navigation when everything is synced; that is part of COMMS-649.
*   Version history or recovery of overwritten content.
