# Article workspace

## Article workspace overview

An Article workspace is the page where you read an article, see who wrote it, review its
tags and comments, and choose what to do next with it. Comments are discussion entries
attached to the article. Metadata is the author's image, name, and creation date. The
article body is displayed as Markdown.

| If you need to… | Go to… |
| --- | --- |
| Read the article and review its tags | [Understand the article workspace](#understand-the-article-workspace) |
| Edit or delete an article you own | [Choose the article action](#choose-the-article-action) |
| Follow the author or favorite the article | [Choose the article action](#choose-the-article-action) |
| Add or remove a comment | [Handle sign-in and comment branches](#handle-sign-in-and-comment-branches) |
| Open the editor | Create and edit an article |
| Sign in or create an account | Sign in or Create an account |
| Open the author's profile | View a profile |

## Before you start

The Article workspace changes its visible actions according to the article you opened, your
account state, and whether you own the article or a comment.

| Before you start | What it changes |
| --- | --- |
| The article loads | The article content and workspace appear. |
| You own the article | **Edit Article** and **Delete Article** appear. |
| You do not own the article | The follow and favorite controls appear. |
| You are signed in | The comment form appears. |
| You are signed out | **Sign in**, **sign up**, and the prompt to add comments appear. |
| You own a displayed comment | Its delete target appears. |
| The article is already favorited | The favorite control says **Unfavorite Article**. |
| You already follow the author | The follow control says **Unfollow** followed by the author's name. |

**Prerequisites**

- Open the article you want to read at its Article workspace.
- Know whether you are signed in.
- If you plan to change the article, own the article.
- If you plan to remove a comment, own that comment.

With these conditions clear, find and open the article you want to use.

## Find and open an article

An article record is the Article workspace for one article. Use its article route when you
already have an article destination.

**Prerequisites**

- Have the article destination.

**Steps**

1. Open the article's destination in the browser.

**Result:** The Article workspace opens for that article.

## Understand the article workspace

The Article workspace puts the article's identity, content, tags, and discussion in one
reading surface. The author image and author name open the author's profile.

The metadata area appears above the article and again below it. The article body is rendered
as Markdown, and the article's tags appear below the body.

The comment area contains the comments already attached to the article. The Article workspace
presents this reading and discussion content directly; it does not present a grid of columns.

Use the ownership and relationship actions that appear for your situation to continue.

## Choose the article action

Choose an article action according to your relationship with the article and the author.

### Edit or delete an article you own

Use this procedure when the Article workspace shows the owner actions.

**Prerequisites**

- Own the article.
- Decide whether you need to change the article or remove it.

**Steps**

1. Select the action that matches your goal.

   | If you need to… | Select… |
   | --- | --- |
   | Change the article | **Edit Article** |
   | Remove the article | **Delete Article** |

**Result:** **Edit Article** takes you to the article editor. After **Delete Article**
completes, the page navigates to `/`.

### Follow the author or favorite the article

Use this procedure when the Article workspace shows the relationship actions instead of
the owner actions.

**Prerequisites**

- Do not own the article.
- Decide whether you want to follow the author or favorite the article.

**Steps**

1. Select the relationship action that matches your goal.

   | If you need to… | Select… |
   | --- | --- |
   | Follow the author | **Follow** followed by the author's name |
   | Stop following the author | **Unfollow** followed by the author's name |
   | Favorite the article | **Favorite Article** |
   | Remove the article from your favorites | **Unfavorite Article** |

**Result:** The selected relationship changes, the follow or favorite label changes to its
opposite, and the favorite count changes when you favorite or unfavorite the article.

## Handle sign-in and comment branches

The controls available in this area depend on whether you are signed in and whether you
authored a displayed comment.

| Your situation | What appears |
| --- | --- |
| You are signed out | **Sign in**, **sign up**, and the prompt to add comments. |
| You are signed in | **Write a comment...** and **Post Comment**. |
| You authored a displayed comment | The comment delete target. |
| You did not author a displayed comment | No delete target for that comment. |

### Sign in or create an account before commenting

**Prerequisites**

- Have the Article workspace open.
- Be signed out.

**Steps**

1. Select **Sign in** or **sign up** according to your goal.

**Result:** The selected account page opens.

### Post a comment

**Prerequisites**

- Be signed in.
- Have the comment text ready.

**Steps**

1. Enter the comment text in **Write a comment...**.
2. Select **Post Comment**.

**Result:** The new comment appears at the top of the comment list, and **Write a comment...**
is cleared.

### Remove your comment

**Prerequisites**

- Be signed in.
- Own the comment you want to remove.

**Steps**

1. Select the delete target on your comment.

**Result:** The comment is removed from the displayed comment list.

## When the article task goes wrong

The Article workspace displays page and comment errors in an error list. Use the message on
screen to choose the next action.

| What you see | What it means | What to do |
| --- | --- | --- |
| `Failed to load article` | The article could not be loaded. | Return to an article destination and open it again. |
| `Comment body cannot be empty` | The submitted comment has no text. | Enter text in **Write a comment...** and select **Post Comment** again. |
| `Must be logged in` | The action requires a signed-in account. | Select **Sign in** and return to the article. |
| `Article not found` | The article destination does not identify an article. | Open a valid article destination. |
| `Comment not found` | The selected comment is not available. | Return to the displayed comment list. |
| `Cannot delete this comment` | The comment cannot be removed by this account. | Continue without deleting that comment. |
| `Cannot delete` | The article cannot be removed by this account. | Continue without deleting the article. |

The error list displays the error strings returned by the article or comment operation.
API-provided error strings render as list items.
The Article workspace does not display a success or confirmation message for posting, following,
favoriting, or deleting; use the changed comment list, label, count, or destination to check
the result.

After resolving the message, continue with the destination that matches your next task.

## Know what comes next

After you choose an action, continue in the page that owns that part of the work.

| What you selected or need next | Continue with… |
| --- | --- |
| **Edit Article** | Create and edit an article |
| **Sign in** | Sign in |
| **sign up** | Create an account |
| Author image or author name | View a profile |
| **Post Comment** or comment removal | Comment on an article |
| **Favorite Article** or **Unfavorite Article** | Favorite articles |
| **Follow** or **Unfollow** | Follow a user |
| **Delete Article** | The home route `/` |
