Revision compare

A React component in Beamline's Content & display category.

Two revisions of a drawing on one camera: side by side, they pan and zoom together (a crosshair in one pane marks the point under the pointer in the other) or apart when unlocked; the changes the app found are numbered places you fly to with Next and Previous; issue pins stay on the revision they were placed on, and a pin where the drawing changed says so; hold B (or Blink) and the after pane shows the before revision at the same spot, so what moved jumps. In a narrow room one pane switches revisions in place. A pair that is not aligned is refused in words, never compared.

Use it for

  • Reviewing a reissued drawing, plan, map or layout against the revision before it: what moved, where, and which issues sit on changed ground.
  • Any two registered versions of one picture where the place matters (site plans, floor plans, PCB layouts, signage maps, warehouse layouts).

Not for

Anatomy

  • toolbar: Before and After revision pickers (each revision with its date, state and, if it cannot be shown, why), Locked, Changes, zoom out, the zoom in words, zoom in, Fit, Blink
  • two panes (split form): each headed by its revision and its state (Current, Pending approval, Superseded), the drawing on one camera, the change regions numbered in place, the pins placed on that revision, a crosshair where the other pane's pointer is
  • one pane (single form, under 720 px): a Before/After switch for the revision it shows, the same camera
  • changes list: each change numbered with its words and the pins it touches, Previous and Next; Comparing… while the app computes
  • pins: a numbered mark with the issue's code; on a revision the after revision changed under it, ringed in the warning tone and said (Area changed in Rev D)

States

  • at rest: the camera frames every change (their box with a little room) until the person moves; Fit shows the whole sheet
  • aligned and locked: both panes on one camera; the crosshair follows the pointer across
  • unlocked: each pane has its own camera; locking again glides the after pane onto the before pane's camera
  • changes hidden: no regions drawn, the list still there
  • flying to a change: both panes travel in one spring to frame it; the list marks it
  • blink held: the after pane (or the one pane) shows the other revision at the same spot, labelled Showing Rev C
  • pins visible, and a pin on changed ground
  • revision unavailable: listed with its reason, cannot be picked; a pane whose revision is unavailable says so
  • comparison processing (changes null): the panes work, the list says Comparing…, no regions
  • not aligned (unaligned reason): Locked, Changes and Blink off with the reason said; the panes move apart
  • single form on a phone: one pane, the revision switch, Blink; before a zoom a finger pans the camera sideways only and vertical moves scroll the page

Keyboard

  • each pane is a focusable region named for its revision: arrows pan a tenth of the view (Shift: half), + and − zoom, 0 fits, N and P go to the next and previous change, B held blinks
  • the toolbar's pickers, switches and buttons are standard controls; the changes list is a list of buttons; pins are buttons

Motion

Dragging moves the camera 1:1 under the hand (both panes when locked), and a release carries with the look's carry, rubber-banded at the drawing's edge; a change, Fit, a zoom key or relocking travels in one spring. Each move decides where it lands when it starts: the zoom in words and onCameraChange say it at once, and only the drawing travels. Pins, change numbers and the crosshair keep their size at every zoom. Nothing moves at rest; reduced motion places the camera at once and does not carry. Blink is instant.

Props

PropTypeDefaultDescription
revisions (required)DrawingRevision[]—Every revision, oldest first.
size (required)Size—The drawing space every revision is drawn in (a 42 000 × 29 700 mm sheet, or a picture's pixels).
beforestring—The revision on the left, compared from (a revision id). Default: the newest but one that can be shown. Watch `onBeforeChange` and `onAfterChange` to compute the pair's `changes`.
defaultBeforestring—
onBeforeChange((id: string) => void)—
afterstring—The revision on the right, compared to (a revision id). Default: the newest that can be shown.
defaultAfterstring—
onAfterChange((id: string) => void)—
changesDrawingChange[] | null—What changed between `before` and `after` (the app computes it when the pair changes); null while it is being computed (Comparing…). Default none.
pinsDrawingPin[]—Issue pins on any revision; each is drawn only on its own.
onPinOpen((pin: DrawingPin) => void)—A pin pressed (open the issue).
unalignedstring | null—Why the pair cannot be laid over each other (different sheets, not registered). When set, the panes move apart and changes and Blink are off, with the reason said.
lockedboolean—Both panes on one camera. Default true.
defaultLockedboolean—
onLockedChange((locked: boolean) => void)—
showChangesboolean—Change regions drawn. Default true.
defaultShowChangesboolean—
onShowChangesChange((show: boolean) => void)—
activeChangestring | null—The change in view (the list marks it; setting it flies the camera there).
defaultActiveChangestring | null—
onActiveChangeChange((id: string | null) => void)—
cameraCamera—The camera (of the before pane, which leads when locked). `onCameraChange` hears where a move lands as soon as it is decided (a key, a button, a change, a release's projected landing), once per move; the drawing then travels there. Default: the part opens framing every change (the whole sheet when there are none) and keeps that until the person moves; Fit always shows the whole sheet.
defaultCameraCamera—
onCameraChange((camera: Camera) => void)—
heightstring | number—The part's height. Default 560.
aria-labelstring—
classNamestring—Classes on the documented visual root; no override by default.
styleCSSProperties—Inline styles on the documented visual root; no overrides by default.
refRef<HTMLDivElement>—Receives the documented native target or imperative handle; omitted by default.

Built from

Dependencies

lucide-react

Import

import { RevisionCompare } from "@beamline/revision-compare";

Get it

Revision compare is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Get Beamline · Connect your agent

More in Content & display

  • Image compare: Two images in one frame with a divider: drag anywhere, or arrow keys on the handle; horizontal or vertical, with captions.
  • Live cursors: Who else is working on this, and where: over any shared surface, each person's pointer in the colour their name always gets, with a name flag, gliding…
  • Document viewer: A PDF or a paged document read and marked up in place: page thumbnails beside it, zoom to the width, the page or a percentage, pages by keyboard, a…
  • Video player: A video player on the native <video> element: title bar with an external link and close, centre play with ±10 s, scrub, time, volume, speed, captions…
  • Lightbox: A full-screen image viewer: a thumbnail grows into it and shrinks back, arrows and ←/→ step through the set, Esc or a downward drag closes it.
  • File diff: A change to one file as a unified diff: line numbers, tinted lines, only the changed words marked, long unchanged stretches folded; give rows or just…
  • QR Code: A scannable code set as gradient dots with rounded finder rings and an optional centre mark; a new value ripples out from the centre.
  • Data matrix: A DataMatrix (ECC 200, ISO/IEC 16022) any scanner reads: crisp square modules in SVG at any size, the smallest symbol that holds the value (10×10 to…
  • Slot text: Text and numbers that roll into their new value on reels, digit by digit from the right; other characters fade. Read as plain text by assistive tech.
  • Text reveal: A headline whose words rise into place once, the first time it scrolls into view; never repeats.
  • Text morph: A short label that becomes its next state letter by letter: shared letters glide into place, new ones arrive, old ones leave.
  • Code block: Code to read and copy: highlighted in the system's colours, numbered, marked lines, long files folded behind “Show all”.
  • Inbox list: Conversations waiting for a person, triaged in place: sender, subject and the first words, time, unread weight, star, labels and attachments, grouped by…
  • Comment thread: A discussion attached to something: replies, reactions, @mentions, editing and deleting your own, resolve that folds the thread.
  • Timeline: What happened, newest first and grouped by day: people with avatars, systems with toned icons, relative times with the exact time on hover, details in…
  • Description list: The details of one record as label and value pairs: beside each other or stacked, in as many columns as the room holds; a copy button arrives on the row…
  • Text shimmer: Ongoing work said in words (“Thinking…”) with a calm band of light passing across them; stops when inactive.
  • Logo Carousel: A wall of logos shown a few at a time: every few seconds the slots turn left to right, each logo leaving upward as the next rises in.
  • Avatar group: A team in a small space: overlapping faces that name themselves on hover or focus, and “+N” naming the rest.
  • Avatar: A person or account in a small space: a photo, or initials on the hue their name always gets; presence dot; circle for people, square for companies.
  • Item: The generic list row: media, title, description, meta and trailing actions; becomes a link or button when interactive.
  • Marker: A labelled point in a stream: a status event with an icon between messages, or a label such as "Today" between two hairlines.
  • Credit: "Designed with Beamline" for a site's footer: the Beamline mark and a quiet line, or a small badge. With your partner code, each new customer's first…
  • Badge: A short status, category or count label: six tones, an icon or a status dot, two sizes.
  • Kbd: Keyboard keys as keycaps, for combinations and sequences (G then A); `mod` resolves to ⌘ or Ctrl per platform, symbols are spoken as words.

Part of Beamline UI: polished, editable React components and complete screens for custom applications. Build your own style from any look; tokens, fonts, radii, motion; not only colours.