# Document states and actions

## Document states and actions

A document record brings together the title, type, URL identifier, category, audiences, and
content that make one piece of documentation available to work on or read.
The record shows one of these state labels: `Published`, `Draft`, `In review`, or `Outdated`.
It also identifies the document type as `Manual` or `Generated` when those types apply.

Choose an action on an existing record. The editor lets you manage its settings,
content, audience view, comments, history, collaboration, and publication. The viewer lets you
copy the link, print the document, or open the editor.

| If you need to… | Go to |
|---|---|
| Find a document and understand where it sits | [Documents overview](doc:documents-overview) |
| Create or edit its content | [Create and edit a document](doc:create-and-edit-a-document) |
| Compare revisions | [Compare document revisions](doc:compare-document-revisions) |
| Translate the document | [Translate a document](doc:translate-a-document) |
| Choose an action for its current state | [Before you choose an action](#before-you-choose-an-action) |
| Locate fields and panels | [Understand the document record](#understand-the-document-record) |
| Use the available actions | [Choose and use a document action](#choose-and-use-a-document-action) |
| Read publication and access guidance | [Published documentation](doc:published-documentation) |
| Administer records or access | [Administer documents](doc:administer-documents) and [Document access reference](doc:document-access-reference) |

## Before you choose an action

A document record is ready for an action after it has loaded and you can see its current state and
settings. The available controls depend on the record and project conditions below.

| Check before acting | What it changes |
|---|---|
| The document has loaded | The editor receives the record values and the content editor becomes available. |
| The document is public and has a slug and URL ID | The `Published` area and **Public URL** controls appear. |
| Audiences have loaded and at least one audience exists | **Preview mode** becomes available. |
| Review is required, and the document is published and public | The primary action is **Propose change →**. |
| Review does not apply | The primary action is **Done**. |
| The document is a draft | The publication action is **Publish**. |
| The document is not a draft | The publication action is **Unpublish**. |
| Collaborative mode is enabled and a current user is available | The collaborative editor is used instead of the standard editor. |

These conditions determine which action is available. Check the state badge and visible controls
before selecting an action; do not assume that every record has the same action strip.

With these checks in mind, open the record from **Documents**.

## Find and open a document record

The **Documents** destination is where you start when you need to open an existing document record.
From there, open the editor or viewer that matches your work.

Prerequisites

- You have access to the **Documents** destination.
- You know which saved document you need to open.

**Steps**

1. Open **Documents**.
2. Select the document record you need to inspect or change.
3. Choose the reader-facing destination that matches your task.

   | If you need to… | Select or open |
   |---|---|
   | Change content or settings | **Edit** |
   | Read the document | Open the document viewer |
   | Copy the viewer address | **Copy link** |
   | Print the document | **Print** |

**Result:** The selected document record or viewer is open, with its state and available actions
ready for inspection.

## Understand the document record

Read the record's fields before choosing an action so that you change the intended identity,
organization, audience targeting, or content.

| Area | What you find there |
|---|---|
| **Title** | An editable text field containing the document title. Its empty-field hint is `Untitled Document`. |
| **Document type** | A select with the visible options **MANUAL**, **GENERATED**, **HYBRID**, **WIKI**, and **API GUIDE**. |
| **Slug** | The URL-friendly identifier. Its empty-field hint is `document-slug`. |
| **Category** | The document organization category, including `No category (root level)`. |
| **Target audiences** | A checkbox list populated from the available audiences. |
| **View as** | A multiple-select list for choosing audiences in preview mode. |
| **Public URL** | A read-only URL shown when the document is public and has both a slug and URL ID. |
| **Content** | The editable document area. Its content is included in automatic saving outside collaborative and propose modes. |

The settings rail starts open. Use **Settings** to close or reopen it. When the public conditions
are met, the rail also contains the `Published` area, the read-only **Public URL**, and controls to
copy or open that URL. When audiences are available, use **Preview mode** to reveal **View as**.

The viewer shows the document title, type badge, state badge, author, update time, reading time,
and the document content. Its right-side table of contents appears when the document has headings.

**Result:** You can identify the field, panel, state, or audience view that applies before you use
an action.

## Choose and use a document action

Document actions answer different reader needs: inspect history, change the working view, manage
collaboration, publish or unpublish, request a review, or leave the editor.

Prerequisites

- The document record is open.
- The action's condition in [Before you choose an action](#before-you-choose-an-action) is true.

**Steps**

1. Choose the action that matches your goal.

   | If you need to… | Select |
   |---|---|
   | Review earlier versions | **History** |
   | Show or hide document settings | **Settings** |
   | Show or hide discussion | **Comments** |
   | Enable or leave collaborative editing | **Collaborate** or **Collaborating** |
   | Publish a draft | **Publish** |
   | Remove publication from a non-draft document | **Unpublish** |
   | Send a published public edit for review | **Propose change →** |
   | Return from editing when review does not apply | **Done** |
   | Switch the editor to an audience view | **Preview mode** |
   | Return from the audience view to editing | **Edit mode** |
   | Copy the public URL from settings | **Copy URL** |
   | Open the public URL from settings | **Open in new tab** |
   | Save the document as a reusable template | **Save as Template** |
   | Open additional document settings | **Advanced settings** |
   | Copy the current viewer address | **Copy link** |
   | Start browser printing | **Print** |
   | Open the editor from the viewer | **Edit** |

2. Check the visible status after the action. Editing changes move through `Unsaved`, `Saving...`,
   and `✓ Saved`; publication changes use the action's busy or completed label.
3. Follow the outcome from the selected action.

   | If… | Do this |
   |---|---|
   | A change request opens | Review the change request on its review page. |
   | The action is **Done** | Confirm that the Documents list is open. |

**Result:** The selected safe view or settings action is open, or the document has moved into the
publication or change-request path shown by the selected action.

## Handle conditional states and branches

The document state and project setup decide which branch you follow. Use the visible state badge,
the `Published` area, and the available action label to select the applicable path.

| Current condition | Use this branch | What appears or changes |
|---|---|---|
| The document is a draft | Select **Publish** | The publication operation runs and can open the published-document dialog. |
| The document is not a draft | Select **Unpublish** | The publication operation changes to the unpublish path. |
| The document is published, public, and review is required | Select **Propose change →** | The current content is submitted as a change request and the editor routes to the request. |
| The document is not in that review-gated condition | Select **Done** when finished | The editor returns to the Documents list. |
| The document is public and has a slug and URL ID | Use **Copy URL** or **Open in new tab** | The **Public URL** area is available in settings. |
| Audiences are loaded and available | Select **Preview mode**, then choose audiences in **View as** | The content can be viewed for the selected audiences. |
| Collaborative mode is active | Use **Collaborating** | The standard editor is replaced by the collaborative editor. |
| Collaborative mode is inactive | Use **Collaborate** | The editor changes to collaborative editing mode. |

The settings rail does not provide a separate state selector. Publication controls determine
the publication action. The viewer is for reading and navigation; its actions are **Copy link**,
**Print**, and **Edit** rather than document editing fields.

**Result:** You have selected the branch that matches the document's state and project conditions,
and the corresponding control or panel is on screen.

## When an action does not complete

Use the exact message on screen to identify where the action stopped. Then follow the corrective
step in the table.

| Message | What it indicates | What to do |
|---|---|---|
| `Loading document…` | The editor is still loading the document. | Wait for the document surface to finish loading. |
| `Document failed to load.` | The editor did not load the document. | Return to **Documents** and open the record again. |
| `Unsaved` | A document change is waiting to be saved. | Keep the record open while the save begins. |
| `Saving...` | The automatic save is in progress. | Wait for the save status to change. |
| `✓ Saved` | The automatic save completed. | Continue with the next document action. |
| `Failed to save document` | The document update did not complete and the record remains unsaved. | Review the fields you changed and try again. |
| `Failed to save settings` | The settings update did not complete. | Reopen **Settings**, review the settings, and try again. |
| `Failed to open change request` | The review request did not open. | Confirm that the review-gated branch applies, then try **Propose change →** again. |
| `Publishing...` | Publication is in progress. | Wait for the publication result. |
| `Published!` | The publication operation completed. | Continue with the public URL or close the publication dialog. |
| `Unpublishing...` | Unpublication is in progress. | Wait for the unpublication result. |
| `Unpublished!` | The unpublication operation completed. | Continue working with the document as a non-draft record. |
| `Document Published!` | The document has been published and the publication dialog is open. | Use the **Public URL** shown in the dialog, then select `Close` or `Open in New Tab`. |
| `Your document is now publicly accessible` | The published document has a public reader URL. | Copy or open the displayed URL. |
| `URL copied to clipboard!` | The public URL copy action completed. | Paste the URL where you need to share it. |

A service error can replace the fallback messages for save, settings, change-request, publish, or
unpublish actions. Use the exact text shown and return to the owning page if the action still does
not complete.

**Result:** You can match the message on screen to the action that stopped and choose the next
available corrective step.

## What happens next

Continue with the page that owns the next document job:

- Use [Create and edit a document](doc:create-and-edit-a-document) for creating a record or
  editing its content in detail.
- Use [Compare document revisions](doc:compare-document-revisions) to inspect differences between
  revisions.
- Use [Translate a document](doc:translate-a-document) to create or manage a translated version.
- Use [Published documentation](doc:published-documentation) for the reader-facing published route.
- Use [Administer documents](doc:administer-documents) for administrative document management.
- Use [Document access reference](doc:document-access-reference) for document access guidance.

**Result:** You know which page owns the next document action.
