# Preview, apply and undo CSS fixes

Source: https://saer.app/docs/fixes
Updated: 2026-10-31

**Short answer.** Use `/fix` in the workspace to preview supported CSS edits and confirm before applying. The command-line equivalent is `saer fix`, which previews by default. Applying requires the exact reviewed SHA. Saer then rescans; you still run your own build, tests and visual checks.

## What this can change

This fixes a narrow case: a plain CSS colour literal that exactly matches one unambiguous token declared in `:root` in the same file. Review the proposed replacement and its context before approval. No semantic role, brand intention or theme mapping is guessed.

TSX, JavaScript, Tailwind classes/configuration, SCSS, CSS modules, themed or ambiguous contexts, components and refactors are outside automatic-fix scope. Unsupported-file coverage is not a finding count. No supported edits does not mean the project is clean.

These CSS opportunities are separate from the existing report's exact-drift policy, which excludes stylesheet occurrences from that count. Report drift counts can stay unchanged after a successful edit. Use the preview, source diff and fresh scan together.

## Preview without changing anything

Run this from the project folder, or put a project path after fix. Preview reads selected local source without writing source, reports or backups, and does not upload the preview.

Preview supported CSS edits in this project:

```
$ saer fix
```

Limit the preview to one project-relative CSS file:

```
$ saer fix --file path/to/styles.css
```

Replace path/to/styles.css with your file. Read the complete diff, supported-edit count and manual-review or coverage notes. The output prints a Reviewed SHA binding that exact plan to the current project, source and selection rules.

## Approve that exact plan

Apply the reviewed single-file preview:

```
$ saer fix --file path/to/styles.css --apply --reviewed REVIEWED_SHA256
```

Replace REVIEWED_SHA256 with the SHA from that preview, and keep the same project and file selection. Without --apply, nothing is applied. A changed plan, source or selection rule requires another preview; the old SHA cannot approve a different change.

In the interactive workspace, `/fix` and `/fix path/to/styles.css` show the preview and ask Apply exactly these changes? before applying. Declining leaves source unchanged. Do not edit the project while an apply is running: Saer refuses detected changes, but this is not a filesystem-wide transaction against concurrent editors.

## Check the result

Apply preserves a local backup, writes only the approved CSS edits and runs a fresh full scan. A large project can take a few minutes. Check both the write result and post-write scan status, then inspect the diff and UI, run your normal build and tests, and use `/changes` before finishing. Saer never executes project scripts or installs dependencies.

If source was written but the scan failed or access expired, the output says that validation is incomplete. An interrupted command may also have written source. Inspect the source and retained backups before retrying; do not assume an error means nothing changed.

## Preview and approve undo

Preview the reverse diff for a local backup:

```
$ saer fix --restore BACKUP_ID
```

Approve the exact reverse preview:

```
$ saer fix --restore BACKUP_ID --apply --reviewed REVERSE_REVIEWED_SHA256
```

Use the backup ID printed after apply and the new SHA from the reverse preview. `/undo BACKUP_ID` offers the same preview and confirmation inside the workspace. Undo restores only supported edits from a backup belonging to this project; it refuses to overwrite later user changes.

Backups live in `.saer/fix-backups/BACKUP_ID/`, with original/applied bytes, a manifest and RECOVERY.txt. Keep them until you have reviewed the result, and keep `.saer/` out of commits. Owned undo and the recovery files remain available offline after premium access expires. A fresh premium rescan may then be unavailable, so do not treat restored source as freshly analysed. RECOVERY.txt explains manual recovery if the command cannot run.

## Keep the existing privacy and agent workflow

Preview sends no source or diff to Saer. Explicit apply writes selected CSS, local backups and refreshed reports. Approved cloud summaries can sync after a fresh successful post-write scan only if you already enabled sync for that project; this command does not grant consent or add summary fields. A cloud outage does not cancel an applied source edit.

The ten MCP tools remain read/check tools; there is no new MCP source-writing tool. Agents can propose edits through their usual reviewed workflow, then rescan and check changes. [Agent setup](https://saer.app/docs/agents), [cloud controls](https://saer.app/docs/cloud) and [privacy](https://saer.app/docs/privacy-and-security) explain those boundaries.
