# Personalizing your workspace

## Personalizing your workspace

Your settings page is where you review and update your personal profile details.
It contains fields for your profile picture URL, username, short bio, email, and a new password.

| If you need to… | Go to |
|---|---|
| Open the settings page | [Open your settings](#open-your-settings) |
| Check which profile values you can change | [Review your profile fields](#review-your-profile-fields) |
| Submit changed profile values | [Update your profile settings](#update-your-profile-settings) |
| Understand a successful or failed save | [Handle the save outcomes](#handle-the-save-outcomes) |
| Read a returned error | [When the update does not go through](#when-the-update-does-not-go-through) |
| Find broader settings guidance | [Manage your settings](./manage-your-settings) |
| Find general error-message guidance | [General error messages](./general-error-messages) |

## Before you start

The settings page works with the signed-in user's profile values. The current user is the signed-in
user whose profile values appear in the form.
Have the values you want to review or change ready before you begin.

**Prerequisites**

- Be signed in so the page can receive the current user's profile values.
- Know whether you want to change the profile picture URL, username, short bio, email, or password.
- Open the settings route at `/settings`.

## Open your settings

The settings page is the personal profile surface at `/settings`, separate from article and profile
routes.

**Prerequisites**

- Be signed in.

**Steps**

1. Open `/settings` in the application.

**Result:** The settings page opens with the heading Your Settings, the profile fields, the
**Update Settings** button, and the **Or click here to logout.** button.

## Review your profile fields

Use the table below to identify each input before changing it.

| Field | Type | What appears initially |
|---|---|---|
| **URL of profile picture** | Text input | The current profile-picture URL, or an empty value when no image is present |
| **Username** | Text input | The current username |
| **Short bio about you** | Text area with eight rows | The current bio |
| **Email** | Email input | The current email |
| **New Password** | Password input | An empty value |

The first four fields receive values from the current user when the form loads or when a new current
user is received. The profile-picture field uses an empty value when the current user has no image.
None of the five fields has a required marker in the form.

## Update your profile settings

Use this procedure when you want to change one or more personal profile values.

**Prerequisites**

- Be on `/settings`.
- Know the values you want to enter.

**Steps**

1. Enter the new value in the field you want to change:

   | If you want to change… | Enter the new value in… |
   |---|---|
   | Your profile-picture URL | **URL of profile picture** |
   | Your username | **Username** |
   | Your short description | **Short bio about you** |
   | Your email address | **Email** |
   | Your password | **New Password** |

2. Select **Update Settings**.

If you leave **New Password** empty, the submitted update leaves the password out. The settings
request sends the values to the user update endpoint.

**Result:** The application processes the settings update.

## Handle the save outcomes

The save outcome tells you whether the application accepted the profile update or returned errors.

| What happens | What you see next |
|---|---|
| The update is in progress | **Update Settings** is disabled while processing |
| The update succeeds | The current user is replaced and the application redirects to `/` |
| The update fails | The settings errors are stored and the redirect target remains empty |
| Errors are available | The error area lists each returned error key and value |

**Result:** A successful update takes you to `/`; a failed update keeps the settings page available for
correction.

## When the update does not go through

Returned settings errors appear above the form in the error area. Each item combines the returned
error key and value, so use the text shown there to decide what to correct before selecting
**Update Settings** again.

| What you see | What to do |
|---|---|
| A returned error item above the form | Read the key and value, correct the related profile field, and select **Update Settings** again |
| No returned error item | Continue with the result shown after the update |

## After updating your settings

After a successful update, the application replaces the current user and redirects to `/`.
If you want to leave the settings page without submitting another change, select **Or click here to logout.**

**Prerequisites**

- Be on the settings page.

**Steps**

1. Select **Or click here to logout.**

**Result:** The application clears the current user and redirects to `/`.
