Skip to content

Feature/contract analysis UI - #21

Merged
MaximilianRau04 merged 8 commits into
mainfrom
feature/contract-analysis-ui
Aug 24, 2026
Merged

MaximilianRau04 merged 8 commits into
mainfrom
feature/contract-analysis-ui

Conversation

@priyanshuvishwakarma273403

Copy link
Copy Markdown
Collaborator

Overview

This PR implements a detailed Contract Details view surfacing automatically extracted metadata (signatories, key clauses, terms, and obligations) alongside document text in a modern dual-pane desktop view. It supports interactive passage linking, graph view highlighting, and asynchronous processing statuses (pending/failed/completed).

Key Changes

1. Dual-Pane Contract Detail View (apps/web/src/App.tsx)

  • Split Layout: Displays the full document body in the left pane (preserving search result highlights) and a dedicated "Contract Intelligence" panel in the right pane.
  • Extracted Parties: Displays signatories (names, email addresses) along with a link to navigate directly to their node inside the Knowledge Graph.
  • Extracted Clauses: Displays key covenants (Payment Terms, Confidentiality Term, Deliverables) along with action triggers:
    • 🔍 Show: Auto-scrolls and highlights the exact clause sentence inside the document body.
    • 🌐 Graph: Switches to the Graph View and focuses on the selected clause node.
  • Key Details Summary: Surfaces critical deliverables and deadlines (e.g. payment windows, survival durations, and delivery dates).

2. Analysis Status State Handling (apps/web/src/App.tsx)

  • Supports three distinct contract processing states:
    • Completed (doc-1): Surfaces the full list of extracted parties, clauses, and metadata terms.
    • Processing (doc-2): Displays an animated skeleton loader indicating contract structure parsing is still in progress.
    • Failed (doc-3): Displays an error card with error codes and a fully functioning "Retry Analysis" button. Retrying simulates re-parsing and dynamically completes analysis in 2 seconds.

3. Graph Focus & Highlight Indicators (packages/graph-view/src/GraphView.tsx)

  • Added highlightNodeId camera-centering capabilities.
  • Pans and centers canvas zoom coordinates on the targeted entity when selected.
  • Draws an amber border indicator ring around the focused node in the canvas layout to easily locate it in the network.

Verification Results

  • pnpm lint: Passed (0 warnings/errors)
  • pnpm test: Passed (14/14 tests)

@MaximilianRau04 MaximilianRau04 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Party/clause/graph-focus wiring is real and correctly derived from data. Two spots are demo-only fixtures, not disclosed as such in the description.

Comment thread apps/web/src/App.tsx Resolved
Comment thread apps/web/src/App.tsx Resolved

@MaximilianRau04 MaximilianRau04 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified: Key Details are now derived from real clause/doc content via regex extraction, and Retry Analysis does real client-side extraction instead of a blind timeout. Works for any document now, not just doc-1/2/3. One residual nit noted inline. Approving.

Comment thread apps/web/src/App.tsx Resolved
Addresses non-blocking review nit on #21: any never-analyzed document
that wasn't literally id 'doc-2' fell into the else branch and was
marked 'failed' by default instead of 'pending'. Now preserves an
explicit prior 'failed' state (e.g. from a failed retry) and otherwise
defaults to 'pending' for any document with no clauses yet, regardless
of id.
@MaximilianRau04
MaximilianRau04 merged commit fd3b566 into main Aug 24, 2026
1 check passed
@MaximilianRau04
MaximilianRau04 deleted the feature/contract-analysis-ui branch August 24, 2026 13:35
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.

2 participants