Skip to content

TimeMachine - Navigation

Click any point on the timeline to jump to that version:

●━━━●━━━━━●━━━━━━━●
v1 v2 v3 v4 (current)

Hover over timeline points to preview a version without selecting it. The preview shows the read model state at that point in time.

  • Filled circles: Versions with events
  • Highlighted: Currently selected version
  • Preview highlight: Hovered version
  • Swipe left: Move to previous version
  • Swipe right: Move to next version
  • Smooth scrolling accumulates to change versions
  • Swipe left/right to navigate between versions
  • Pinch to zoom timeline (if implemented)
  • Scroll in read model view to navigate versions
  • Only when not hovering over a card (allows card scrolling)

Navigation arrows are available:

[← Previous] Timeline [Next →]
  • Previous: Go to earlier version
  • Next: Go to later version
  • Buttons disable at timeline ends

(If implemented):

  • Left Arrow: Previous version
  • Right Arrow: Next version
  • Home: First version
  • End: Latest version
  • Esc: Close detail view

The view switcher shows current mode:

[Read Model] | Events

Click to switch between viewing modes.

Transitions between versions are animated for clarity:

  • Cards fade in/out
  • Properties highlight when changed
  • Timeline indicator moves smoothly

The component remembers:

  • Current version index
  • View mode (Read Model vs Events)
  • Scroll position within cards
  • Zoom level (if applicable)

Programmatically navigate to a specific version:

const [versionIndex, setVersionIndex] = useState(0);
// Jump to specific version
setVersionIndex(5);
<TimeMachine
versions={versions}
currentVersionIndex={versionIndex}
onVersionChange={setVersionIndex}
/>

Find versions by criteria:

const findVersionByTimestamp = (targetDate: Date) => {
return versions.findIndex(v =>
v.timestamp >= targetDate
);
};
const index = findVersionByTimestamp(new Date('2024-01-15'));
setVersionIndex(index);

Jump to version containing a specific event:

const findVersionByEvent = (eventType: string) => {
return versions.findIndex(v =>
v.events?.some(e => e.type === eventType)
);
};
const index = findVersionByEvent('ProductPublished');
setVersionIndex(index);

Adjust how much scrolling triggers version change:

<TimeMachine
scrollSensitivity={100} // Need more scrolling
versions={versions}
/>

Lower values (25-50): Quick navigation, less control Higher values (100-200): Precise navigation, more deliberate

  1. Use timeline for quick jumps: Click directly on target version
  2. Use gestures for browsing: Swipe through versions sequentially
  3. Hover to preview: Check version before selecting
  4. Watch for highlights: Changed properties show what’s different
  5. Use buttons for step-by-step: Navigate methodically through history
  6. Check event view: See all events chronologically