Skip to content

feat: Add compact view mode and redesign dashboard UI - #24

Merged
mertkaradayi merged 5 commits into
mainfrom
dev
Dec 15, 2025
Merged

feat: Add compact view mode and redesign dashboard UI#24
mertkaradayi merged 5 commits into
mainfrom
dev

Conversation

@mertkaradayi

@mertkaradayi mertkaradayi commented Dec 15, 2025

Copy link
Copy Markdown
Owner

Summary

This PR introduces a new compact view mode for contracts, redesigns the dashboard header with a visual risk breakdown, and enhances evidence parsing for better bytecode display.

Key Features

Compact View Mode

  • Added new compact card layout for efficient browsing
  • Implemented view mode toggle with localStorage persistence
  • Added modal-like UX for expanded compact cards with:
    • Escape key handler to close
    • Click-outside overlay with backdrop blur
    • Close button (X) on expanded card
    • Proper z-index layering
  • Set compact view as default mode

Dashboard Redesign

  • Replaced hero stats cards with streamlined header
  • Added visual risk breakdown bar showing distribution across all levels
  • Display percentages and counts for critical/high/moderate/low
  • More focused, cleaner dashboard layout
  • Added QuickStatsBar for at-a-glance risk filtering
  • Moved filter buttons from search row to QuickStatsBar

Enhanced Evidence Parsing

  • Significantly improved bytecode extraction from evidence text
  • Added multiple pattern matching for different evidence formats
  • Better handling of "Evidence: CODE" format with line numbers
  • Cleaner separation of explanation text and code snippets
  • Support for inline bytecode without quotes

LLM Output Quality

  • Enforced bytecode evidence with line numbers in prompts
  • Added strict formatting rules for evidence code snippets
  • Enhanced schema descriptions to guide LLM output quality
  • Ensures actual bytecode instructions are included, not descriptions

UI Components

  • Added CompactContractCard component for space-efficient display
  • Added ViewModeToggle component with localStorage persistence
  • Added QuickStatsBar for risk distribution filtering
  • Added RiskScoreGauge component for consistent score display
  • Added SkeletonCard for improved loading states
  • Added CodeSnippet component for syntax-highlighted code
  • Added EvidenceBlock component for formatted evidence text
  • Enhanced AnalyzedContractCard with:
    • Staggered animations using framer-motion
    • Dynamic risk-based colors throughout
    • Better visual hierarchy

Files Changed

Backend:

  • backend/src/lib/langchain-prompts.ts - Enhanced evidence requirements
  • backend/src/lib/langchain-schemas.ts - Improved schema descriptions

Frontend Components:

  • New: CompactContractCard.tsx, ViewModeToggle.tsx, QuickStatsBar.tsx, RiskScoreGauge.tsx, SkeletonCard.tsx, CodeSnippet.tsx, EvidenceBlock.tsx
  • Updated: AnalyzedContractCard.tsx, DeploymentsTable.tsx

Frontend Pages:

  • frontend/app/dashboard/page.tsx - Dashboard redesign with compact mode support

Frontend Utils:

  • frontend/app/dashboard/risk-utils.ts - Dynamic color utilities
  • frontend/app/components/EvidenceBlock.tsx - Improved parsing logic

Commits Included

  1. Add compact view mode, enhanced evidence parsing, and UI improvements
  2. Improve compact card layout and move filters to QuickStatsBar
  3. Add modal-like UX for expanded compact cards
  4. Redesign dashboard header with risk breakdown bar and dynamic colors
  5. Polish UI styling and animations

Test Plan

  • Verify compact view displays cards correctly
  • Test view mode toggle switches between full/compact
  • Confirm view mode persists across page refreshes
  • Test expanded compact card modal behavior (click outside, Escape key, X button)
  • Verify risk breakdown bar shows correct percentages
  • Check QuickStatsBar filtering functionality
  • Confirm evidence blocks parse and display bytecode correctly
  • Test skeleton loading states
  • Verify dynamic risk-based colors apply correctly
  • Check staggered animations on card load

…ements

Backend:
- Enforce bytecode evidence with line numbers in LLM prompts
- Add strict formatting rules for evidence code snippets
- Enhance schema descriptions to guide LLM output quality

Frontend:
- Add compact view mode with CompactContractCard component
- Add ViewModeToggle with localStorage persistence
- Add QuickStatsBar for at-a-glance risk distribution
- Add RiskScoreGauge component for consistent score display
- Add SkeletonCard for improved loading states
- Enhance EvidenceBlock with better bytecode extraction patterns
- Add staggered animations to AnalyzedContractCard
- Support expandable compact cards for detailed view
- Add fixed widths to CompactContractCard elements to prevent layout shifts
- Improve alignment and spacing in compact view
- Remove duplicate filter buttons from search row (now in QuickStatsBar)
- Simplify active filters display to only show search term
- Better responsive design for compact cards
- Add Escape key handler to close expanded card
- Add click-outside overlay with backdrop blur
- Add close button (X) on expanded card
- Improve z-index layering for better visual hierarchy
…ic colors

- Replace hero stats cards with compact header
- Add visual risk breakdown bar showing distribution
- Set compact view as default mode
- Use dynamic risk-based colors in contract cards
- Apply getRiskLevelEmphasis and getRiskLevelSubtle utilities
- Improve card styling and spacing
- Enhance animations and transitions
- Refine QuickStatsBar visual design
- Update compact card layout
@vercel

vercel Bot commented Dec 15, 2025

Copy link
Copy Markdown

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

Project Deployment Review Updated (UTC)
redflag Ready Ready Preview, Comment Dec 15, 2025 2:12pm

@mertkaradayi
mertkaradayi merged commit 0ec9269 into main Dec 15, 2025
3 checks passed
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