# Collaboration Editing Status

## Content

When multiple users edit the same worksheet simultaneously, conflicts may arise—such as one user’s changes being overwritten or hidden due to another user’s actions (e.g., row deletions, column sort).
The **Collaboration Editing Status** feature, provided by the `spread-sheets-collaboration-addon` package, tracks real-time editing states to prevent unexpected results. When conflict operations (e.g., row addition, column hide) affect the current user’s editing state, it updates the editing state and ensures proper UI display.

>type=note
> This feature is built-in and does not require the use of any interface methods.

## Status Types

* **Deleted**: The cell being edited is already removed.
* **cell references(Hidden)**, like A1(Hidden): The rows or columns containing the editing cell are already hidden.
* **cell references**, like A1: The cell being edited is affected by other conflict operations.

## Conflict Operations

The Collaboration Editing Status feature supports handling the following conflict operations:

* Add/Delete rows or columns
* Hide rows/columns (including filters)
* Sort (including filters)
* Adjust row height/column width, which may cause the editor and cell positions to differ

**Editing Effects**
When editing is completed，

* **Deleted State**: the editor’s value is not written to the cell.
* **Other States**: the editor’s value is written to the cell indicated in the tooltip.**​**

### Adding/Deleting Rows or Columns

When your currently edited cell is impacted by another user's row/column deletion or addition (which alters the cell's position), the Collaboration Editing Status feature will visually indicate this change - either by marking the cell as **Deleted** or by displaying its **updated** **cell reference** (e.g., G1, H55).
In the figure below, user1 is editing cell B8, while user2 deletes column B. It can be seen that a **Deleted** indicator appears on cell B8 of user1, and the edited content is not written to the cell after editing is completed.
![delete_new.gif](https://cdn.mescius.io/document-site-files/images/7719ad0a-f083-46d7-aff6-f63e2e187c15/delete_new.15f569.gif?width=950)
In another scenario, user1 is editing cell B8, and user2 adds a new row above row 8. It can be observed that a **B9** indicator appears on cell B8 of user1, and the edited content is written to cell B9 after editing is completed.
![add_new.gif](https://cdn.mescius.io/document-site-files/images/7719ad0a-f083-46d7-aff6-f63e2e187c15/add_new.277efd.gif?width=950)

### Hiding Rows/Columns

When your currently edited cell is impacted by another user's row/column hide, the Collaboration Editing Status feature will visually indicate this change - marking the cell as **cell references(Hidden)**, like A1(Hidden).
User1 is editing cell B8 when user2 hides row 8. As a result, user1 sees a **B9 (Hidden)** indicator on the edited cell.
![hide_new.gif](https://cdn.mescius.io/document-site-files/images/7719ad0a-f083-46d7-aff6-f63e2e187c15/hide_new.e0243d.gif?width=950)
Following the previous step, perform the unhide operation. It can be observed that the content edited by user1 is written into cell B8.
![unhide_new.gif](https://cdn.mescius.io/document-site-files/images/7719ad0a-f083-46d7-aff6-f63e2e187c15/unhide_new.78f282.gif?width=950)

### Sorting

When your currently edited cell is impacted by another user's sort(which alters the cell's position), the Collaboration Editing Status feature will visually indicate this change - marking the cell as cell references (e.g., G1, H55).
While user1 is editing cell B8, user2 sorts column B in ascending order (A-Z). As a result, user1 sees a **B10** indicator on the edited cell, and the final input is written to cell B10 after editing.
![sort_new.gif](https://cdn.mescius.io/document-site-files/images/7719ad0a-f083-46d7-aff6-f63e2e187c15/sort_new.e3d813.gif?width=950)

### Adjusting Row Height/Column Width

Adjusting the row height or column width within the viewport may cause the cell position and editor position to differ.
When your currently edited cell is impacted by another user's adjust, the Collaboration Editing Status feature will visually indicate this change - marking the cell as cell references (e.g., G1, H55).
User1 is editing cell B8, while user2 adjusts the height of row . It can be seen that a **B8** indicator appears on the cell B8 of user1, and the edited content is written into cell B8 after the editing is completed.
![resize_new.gif](https://cdn.mescius.io/document-site-files/images/7719ad0a-f083-46d7-aff6-f63e2e187c15/resize_new.c6d1ed.gif?width=950)

## State Reversion

### Deleted State

If a cell is deleted and then re-added, the "deleted" state will not be reversed. This is because the system cannot determine whether the newly added cell is identical to the previously deleted one in terms of content, format, etc.
![undo_delete_new.gif](https://cdn.mescius.io/document-site-files/images/7719ad0a-f083-46d7-aff6-f63e2e187c15/undo_delete_new.1417fe.gif?width=950)

>type=note
> When the cell being edited is deleted and subsequently re-added, its content will remain the same as before editing.

### Other States

If the action that causes a state change is undone, the state will revert accordingly.
For example, user1 is editing a cell and user2 hides the row containing that cell, user1's view of the cell's state will change to "hidden".
![hide_undo_new1.gif](https://cdn.mescius.io/document-site-files/images/7719ad0a-f083-46d7-aff6-f63e2e187c15/hide_undo_new1.c7e00d.gif?width=950)
Then, user2 undoes the hide action, user1's view of the cell's hidden state will be removed, and the tooltip will be updated accordingly.
![hide_undo_new2.gif](https://cdn.mescius.io/document-site-files/images/7719ad0a-f083-46d7-aff6-f63e2e187c15/hide_undo_new2.8e4014.gif?width=950)