Skip to content

feat(ui): Bond Forensic Timeline Frontend#3

Merged
bordumb merged 11 commits intomainfrom
fn-4
Jan 24, 2026
Merged

feat(ui): Bond Forensic Timeline Frontend#3
bordumb merged 11 commits intomainfrom
fn-4

Conversation

@bordumb
Copy link
Contributor

@bordumb bordumb commented Jan 24, 2026

Summary

  • Complete React + Vite + Tailwind frontend for viewing Bond agent traces
  • Timeline view with thinking, text, and tool call blocks
  • Demo mode with pre-recorded events for showcasing
  • Live SSE connection support for real-time streaming
  • Inspector panel for examining block details
  • Replay controls with pause, scrub, and speed adjustment

Features

  • Timeline rendering with Framer Motion animations
  • Active cursor affordance (glow + shimmer) for streaming blocks
  • Replay mode - pause stream, scrub through history, jump to live
  • Inspector panel - click any block to see full details, copy as JSON
  • Demo mode - play pre-recorded sessions without backend
  • Keyboard shortcuts - Space (pause), L (live), J/K (step), Escape (close)

Test plan

  • Run pnpm dev in ui/ directory
  • Click "Run Demo" to see pre-recorded session
  • Verify timeline renders thinking, text, and tool blocks
  • Test pause/play with Space key
  • Test scrubbing with slider
  • Click blocks to open inspector
  • Press Escape to close inspector

🤖 Generated with Claude Code

bordumb and others added 11 commits January 24, 2026 19:29
- Initialize Vite + React + TypeScript project in ui/
- Configure Tailwind CSS v4 with @tailwindcss/vite plugin
- Add shadcn/ui components: Button, Card, ScrollArea, Badge
- Install Framer Motion (motion package)
- Create App shell layout with:
  - Header with Bond logo, Run Demo and Connect buttons
  - Run header/status line showing trace ID, status, event count
  - Connection indicator (connected/disconnected)
  - Sidebar with Session card
  - Timeline area with ScrollArea
- Apply dark theme: zinc-950 background, zinc-800 borders
- Configure path aliases (@/) for clean imports

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Define WireEvent type for WebSocket/SSE wire format
- Define BondEvent union type for normalized internal events
- Define Block types: TextBlock, ThinkingBlock, ToolBlock, UnknownBlock
- Add isActive flag for streaming cursor affordance
- Implement normalization layer:
  - normalizeWireEvent() for WebSocket JSON
  - normalizeSSEEvent() for named SSE events
  - normalizeTraceEvent() for replay/demo NDJSON
- Implement bondReducer with:
  - Active block tracking
  - tool_delta attachment to active tool_call block
  - tool_execute/tool_result correlation by id field
  - Graceful handling of unknown block kinds

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create useBondStream hook with:
  - EventSource connection management
  - Status tracking (idle, connecting, live, error)
  - Pause control with event buffering
  - Integration with bondReducer for state updates
- Create useEventHistory hook for replay buffer:
  - Stores events for timeline scrubbing
  - Configurable max history size
  - getUpTo() for replay state derivation
- Handle named SSE events (block_start, text, etc.)
- Proper cleanup on disconnect and unmount
- Flush buffered events when unpausing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements Timeline component with auto-scroll behavior using
Intersection Observer. BlockCard provides active cursor affordance
(soft glow + shimmer animation). TextBlock, ThinkingBlock, and
ToolBlock render each content type with appropriate styling.

Completes fn-4.4

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements useReplayState hook for tracking replay position and
deriving visible state from event history. ReplayControls component
provides scrubber slider, play/pause toggle, live/replay indicator,
and jump-to-live button. Includes state caching for smooth scrubbing.

Completes fn-4.5

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements Inspector component that slides in from right showing
selected block details. Includes useSelection hook for managing
selection state with Escape key and click-outside support.
Copy as JSON button with visual feedback.

Completes fn-4.6

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements useBondReplayFromFile hook that loads TraceEvents from
NDJSON files and plays them with timing-accurate delays. DemoControls
component provides play/pause, speed selection (0.5x/1x/2x), and
progress indicator. Includes demo-events.ndjson with realistic session.

Completes fn-4.7

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Wires all components together in App.tsx with full functionality:
- Live SSE streaming mode with connection management
- Demo mode with pre-recorded event playback
- Replay mode for scrubbing through history
- Inspector panel for block details
- Keyboard shortcuts (Space, L, J/K, Escape)
- Contextual help in sidebar

Completes fn-4.8 and entire fn-4 epic

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add type guards for Block types (isTextBlock, isThinkingBlock, etc.)
- Change UnknownBlock.kind to literal "unknown" with originalKind field
- Update reducer, BlockCard, Inspector to use type guards
- Fix Tailwind v4 border-border utility issue in index.css
- Remove unused isPaused variable in DemoControls

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add description of what the timeline shows (thinking, text, tool blocks).
Include example of connecting to a live Bond agent via SSE endpoint.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bordumb bordumb merged commit 221f640 into main Jan 24, 2026
5 checks passed
@bordumb bordumb deleted the fn-4 branch January 24, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant