Skip to content

Design pipeline: bolder, onboard, animate, polish, adapt, distill, harden, e2e#23

Merged
m4cd4r4 merged 8 commits intobaseline/pre-design-pipelinefrom
master
Mar 13, 2026
Merged

Design pipeline: bolder, onboard, animate, polish, adapt, distill, harden, e2e#23
m4cd4r4 merged 8 commits intobaseline/pre-design-pipelinefrom
master

Conversation

@m4cd4r4
Copy link
Copy Markdown
Owner

@m4cd4r4 m4cd4r4 commented Mar 13, 2026

Summary

Full design pipeline pass on BrightClause dashboard and document detail page. Eight sequential skill runs, each building on the last.

  • bolder - Replaced 4 identical stat cards with a horizontal data strip, left-border risk treatment instead of glow shadows, stacked risk bar, inline risk badges on contract rows
  • onboard - Rewrote walkthrough and empty state copy for lawyers, not engineers. First-time walkthrough now only triggers once (localStorage flag). Upload zone teaches the value prop before upload.
  • animate - Stacked risk bar fills left-to-right on mount, risk numbers stagger in, badges pop with spring, clause list entrance staggered, extraction button pulsing state
  • polish - Removed font-mono uppercase tracking-wide from Risk panel, stat strip, activity feed headers, and walkthrough step counter. Cleaned inconsistent label treatment.
  • adapt - grid-cols-3 always for stat strip (was 2x2 on mobile), document list height 60vh on mobile, Eye button 44px touch targets, logo subtitle no longer monospace
  • distill - Removed Search from nav (inline search covers it), dropped "Sections analyzed" stat (jargon), removed "Contract Portfolio" h2 (obvious from context), removed entire Activity Feed, simplified empty Risk panel from ghost-loaded zeros to Shield icon + prompt
  • harden - Concurrent search guard, risk level normalization against known RiskLevel[], null-safe clause_type in dashboard and document detail, ?? 'border-l-ink-600' fallback, removed stale Zap import
  • e2e-testing - Rewrote tests/dashboard.spec.ts from 152 lines to 763 lines (65 tests). API mocking for deterministic timing, hasTouch: true for mobile context, .tap() for mobile nav. All 65 tests passing.

Key files changed

  • src/app/dashboard/page.tsx - primary target, most changes
  • src/app/documents/[id]/page.tsx - harden + animate
  • src/lib/navigation.tsx - remove Search nav item
  • src/lib/walkthrough.tsx - onboard copy + first-time flag
  • tests/dashboard.spec.ts - full rewrite (65 tests)

Test plan

  • E2E suite: 65 tests passing (npx playwright test tests/dashboard.spec.ts)
  • Verify stat strip renders 3 columns at all breakpoints (no 2x2 on mobile)
  • Confirm walkthrough shows on first visit, skips on return (clear localStorage to test)
  • Select a contract row and verify Risk panel populates
  • Upload a contract and verify empty-state copy is visible before upload

Generated with Claude Code

m4cd4r4 and others added 8 commits March 13, 2026 19:11
- Replace 4 identical stat cards with a horizontal data strip
  No icon boxes, no cards, no glow - just numbers + labels + dividers
- Remove riskGlow shadow effects, replace with 4px left-border accents
- Replace 2x2 risk distribution grid with flat number row + stacked bar
- Add inline risk badge (CRITICAL/HIGH/MEDIUM/LOW) next to contract names
- Ghost empty state updated to match new flat layout
- Remove unused Database, TrendingUp imports

Result: dashboard reads like data, not an AI template

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Walkthrough steps:
- Remove all jargon: vector embeddings, chunked, AI pipeline, hybrid search
- Rewrite 5 step descriptions around outcomes lawyers care about
- Focus on: risk rating, flagged clauses, plain-English answers

Empty state:
- "What happens next: Extract → Score → Index" → "What you get: Every clause read → Risk flagged → Nothing missed"
- "extract clauses, score risks, build a searchable index" → "read every clause, flag risky provisions"
- "Add your first contract" (not "Upload your first contract")

Not-yet-analyzed state:
- "Run AI analysis to extract clauses, assess risk levels..." → outcome-focused copy

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Dashboard:
- Stacked risk bar segments animate scaleX 0→1 from left, staggered 70ms
- Risk breakdown numbers (critical/high/medium/low) fade+slide up with 60ms stagger
- Overall risk level panel slides in from left (x: -8 → 0)
- Risk badges pop in with scale 0.7→1 when analysis data loads

Graph page:
- Extraction button shows elapsed time: "Analyzing · 45s" (updates every 1s)
- Empty state copy: "No Entities Extracted" → "No knowledge graph yet"
- CTA: "Extract Entities" → "Build Knowledge Graph"

All animations: ease-out-quart [0.25,1,0.5,1], transform+opacity only, 200-500ms

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dashboard/page.tsx:
- Contract Portfolio subtitle: font-mono removed, copy → "X contracts · Click to see risk"
- Document rows: remove uppercase tracking-wide from page count, sections, Ready status
  "chunks" → "sections" (lawyer vocabulary)
- Risk Assessment panel subtitles: font-mono uppercase → plain text-xs
- "Attention Required" h3: font-mono uppercase → text-xs
- "Advanced View" → "Search" with Search icon (honest about the link target)
- Activity feed: font-mono count → text-xs

walkthrough.tsx:
- Step counter: "text-xs font-mono text-ink-300 uppercase tracking-wide" → "text-xs text-ink-400"
  "Step 1 of 5" → "1 of 5" (quieter, less ceremony)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Stat strip: grid-cols-4 always (was grid-cols-2 causing broken divide-y borders on mobile)
- PortfolioStat: fluid font sizing (text-xl → text-3xl → text-4xl) and padding at breakpoints
- Document list max-height: 60vh on mobile, calc(100vh-300px) on sm+
- Eye button: 44x44px touch target on mobile (p-3 min-w-[44px] min-h-[44px])
- Nav logo subtitle: removed font-mono uppercase decorative treatment

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Nav: remove Search item (redundant with inline search input)
- Stat strip: drop "Sections analyzed" (engineering metric), now 3 stats
- Contract Portfolio: remove section header, keep minimal count line
- Risk panel: replace ghost panel (noisy zeros) with minimal hint
- Activity Feed: removed (lawyers don't need action logs)
- loadData: no longer fetches activity
- Clean up unused imports (Activity, MessageCircle, FileBarChart, Trash2, RotateCcw)
- Remove font-mono decorative usage from search results

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove unused Zap import (was left from activity feed removal)
- Guard concurrent search: add `searching` check to prevent overlapping requests
- Normalize risk level from API: validate against known values, fallback to 'low'
- Guard riskAccentBorder lookup with ?? 'border-l-ink-600' fallback
- Guard clause_type.replace() with ?? '' to handle null/undefined clause types
- Apply clauseTypeLabels in secondary clause panel (was showing raw snake_case)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rewrote dashboard.spec.ts from 12 to 65 tests covering all recent changes:
- Navigation: 5 nav items (no Search), inline search, tour/upload buttons
- Stat strip: 3-column grid (Contracts, Clauses found, Ready to review)
- No 4th stat (Sections analyzed removed), no Activity Feed
- Empty state: CTA, value prop steps, risk panel minimal hint
- Document list: count line, click-to-load risk panel, Eye button
- Risk panel: portfolio view, document view, "Not yet analyzed" state
- Walkthrough: localStorage guard, auto-start, dismiss, prev/next, restart
- Mobile nav: touch events, hamburger menu, mobile link visibility
- Search: inline results, clear button, concurrent search guard
- Upload: disabled state, file picker trigger, drag-drop overlay

Fixed flaky walkthrough tests by mocking API to return empty state instantly.
Fixed mobile nav test: added hasTouch:true, use tap() over click({force}).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
contractclarity Ready Ready Preview, Comment Mar 13, 2026 1:49pm

Request Review

@m4cd4r4 m4cd4r4 merged commit c423a05 into baseline/pre-design-pipeline Mar 13, 2026
2 checks passed
m4cd4r4 added a commit that referenced this pull request Mar 13, 2026
27 targeted tests covering the 4 behaviors from PR #23:
- Stat strip grid-cols-3 at desktop/tablet/mobile (no 2x2)
- Walkthrough first-visit vs return-visit behaviour
- Risk panel populates on contract row click
- Empty state copy visible before upload

All 27 tests pass on chromium + mobile-chrome.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@m4cd4r4
Copy link
Copy Markdown
Owner Author

m4cd4r4 commented Mar 13, 2026

PR verification complete ✅

Ran targeted Playwright specs (tests/pr-verification.spec.ts) against all 4 test plan items. 27/27 passing on both Chromium and mobile-chrome.

# Verification Tests Result
1 Stat strip 3 columns at all breakpoints 6 tests: desktop 1280px, tablet 768px, mobile 390px (class + overflow + single-row y check) ✅ pass
2 Walkthrough shows on first visit, skips on return 5 tests: auto-start, step counter, no-reshow, dismiss writes flag, reload suppresses ✅ pass
3 Contract row click populates Risk panel 7 tests: before/after selection state, overall risk level, breakdown labels, stacked bar, View Full Analysis CTA ✅ pass
4 Empty state copy visible before upload 9 tests: heading copy, value prop copy, Choose PDF button, PDF input accept, no Activity Feed, Shield prompt, zero doc rows ✅ pass

Spec committed as tests/pr-verification.spec.ts (commit 2dfde92).

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