> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Version Comparison

> Compare two versions of a document side-by-side, reviewing metadata differences and optional text diffs.

The Version Comparison page displays a side-by-side comparison of two versions of a document, showing metadata differences and allowing users to select which two versions to compare. It is reached at `/documents/:id/compare`.

## Overview

The page resolves the `:id` URL parameter as a document ID. It fetches all versions of the document via `useDocumentVersions` and loads a specific pair via `useDocumentVersionComparison`. Version A (older) and Version B (newer) are auto-selected from the two most recent versions, and can be changed via dropdowns.

The comparison view renders version metadata for both sides and a `metadataDiff` summary. Navigation back to the document is provided via a **Back** button.

## Who it's for

Access follows your organization's role and module configuration. Access is controlled by organization scoping at the data layer.

## Before you start

* The document must have at least two versions for the comparison to render (component returns a message if fewer than two versions exist).
* Navigate from the Document Library or a document detail page to access this route.

## Steps

1. Open a document in the Document Library (`/documents`).
2. Navigate to the version comparison view at `/documents/:id/compare`.
3. The two most recent versions are selected automatically.
4. Use the version dropdowns to select a different pair for comparison.
5. Review the metadata differences shown for each version.

## Key concepts

**Version A / Version B** — the two document snapshots being compared. A is the older version, B is the newer one by default.

**Metadata diff** — a summary of field-level differences between the two versions.

## Related

<Columns cols={2}>
  <Card title="Platform Foundation" icon="layer-group" href="/pf/overview">
    Platform Foundation overview.
  </Card>

  <Card title="Governance & parity" icon="scale-balanced" href="/governance/index" />
</Columns>

<Note>
  This page documents shipped product behavior. It is not medical, legal, or
  billing advice. Verify against your organization's policies and applicable
  regulations before using it for clinical, compliance, or billing decisions.
  Protected health information (PHI) shown in the product is governed by your
  tenant's access controls and is never exposed in this documentation.
</Note>

<Accordion title="Documentation sources">
  * src/routes/platform.tsx
  * src/platform/documents/pages/VersionComparisonView\.tsx
  * src/platform/documents/hooks/useDocumentVersionComparison.ts
</Accordion>
