Skip to content

feat(frontend): View Transitions API + Premium UI/UX Overhaul (#113)#148

Merged
DevanshuNEU merged 3 commits into
OpenCodeIntel:mainfrom
DevanshuNEU:feature/113-view-transitions-api
Jan 5, 2026
Merged

feat(frontend): View Transitions API + Premium UI/UX Overhaul (#113)#148
DevanshuNEU merged 3 commits into
OpenCodeIntel:mainfrom
DevanshuNEU:feature/113-view-transitions-api

Conversation

@DevanshuNEU

@DevanshuNEU DevanshuNEU commented Jan 5, 2026

Copy link
Copy Markdown
Collaborator

🎬 View Transitions API + Premium UI/UX Overhaul

Closes #113

Overview

This PR transforms the search results experience from "functional" to "premium" with dramatic animations, intelligent UX for stale results, and a complete visual redesign of result cards.


Animation System

Framer Motion Integration

  • Added framer-motion dependency for cross-browser animation support
  • Created useViewTransition hook for native View Transitions API (future-ready)
  • Created view-transitions.css for CSS-based animations

Result Card Animations

Property Before After
Y offset 20px 60px (more dramatic)
Blur 10px 20px (more noticeable)
Scale 0.98 0.9 (real pop)
Stagger 75ms 120ms (more visible cascade)
Physics ease-out Spring (damping: 25, stiffness: 200)
3D effect none rotateX: 15deg

Loading State

  • Before: Boring spinner
  • After: Skeleton cards that animate in with stagger

Search Bar During Loading

  • Glows with indigo pulse animation
  • Search icon rotates continuously
  • Input border turns indigo with shadow

UX Fix: Stale Results Indicator

Problem: When user typed a new query, old results stayed visible, causing confusion.

Solution:

  • Separate inputQuery (what user is typing) vs searchedQuery (what was searched)
  • When they differ, results become "stale":
    • Blur to 2px
    • Fade to 40% opacity
    • Scale down to 0.98
  • Yellow pulsing indicator: "Press Enter to search for [new query]"
  • Shows "(showing results for [old query])" for clarity

Visual Redesign: Premium Cards

Match Score Badge (THE HERO)

Color-coded based on confidence:

  • 🟢 70%+ → Emerald gradient (from-emerald-400 to-green-500)
  • 🔵 50-70% → Blue gradient (from-blue-400 to-indigo-500)
  • 🟠 <50% → Amber gradient (from-amber-400 to-orange-500)

Card Layout

Before After
Cramped (px-5 py-4) Spacious (px-6 py-5)
Small function name Large (text-lg), turns blue on hover
Truncated path Full file path visible
Heavy badge Minimal badge (bg-white/5)
Endless code Max 200px with expand button

Code Block Improvements

  • Maximum height of 200px with gradient fade
  • "Show X more lines" button to expand
  • "Show less" button to collapse
  • Darker background (#08080a)
  • Better padding

Hover Effects

  • Cards lift up 4px
  • Scale to 1.02
  • Blue glow shadow appears
  • Border turns blue

📁 Files Changed

Created

  • frontend/src/hooks/useViewTransition.ts - View Transitions API hook
  • frontend/src/styles/view-transitions.css - Animation CSS

Modified

  • frontend/package.json - Added framer-motion
  • frontend/src/main.tsx - CSS import
  • frontend/src/pages/LandingPage.tsx - Major updates:
    • SkeletonCard component
    • ResultCard complete redesign
    • CompactSearchBar with loading animations
    • Stale results state management

🧪 Testing

  1. Animation Test:

    • Perform a search
    • Watch cards fly in with blur-to-focus + spring physics
    • Hover over cards to see lift effect
  2. Stale Results Test:

    • Search for something
    • Type a different query WITHOUT pressing Enter
    • Verify: Results blur/fade, yellow indicator appears
    • Press Enter → Fresh results animate in
  3. Code Expand Test:

    • Find a result with long code (>8 lines)
    • Click "Show X more lines"
    • Verify expansion works
    • Click "Show less" to collapse
  4. Accessibility:

    • Test with prefers-reduced-motion: reduce
    • Animations should be disabled

📸 Screenshots

Stale Results Indicator

![Stale results blur with yellow indicator]

Premium Cards with Color-Coded Scores

![Cards with green/blue/amber match badges]

Loading State

![Skeleton cards during search]


✅ Checklist

  • Framer Motion fallback for browsers without View Transitions API
  • Respects prefers-reduced-motion
  • Skeleton loading cards
  • Staggered blur-to-focus animation
  • Spring physics for organic feel
  • Stale results UX indicator
  • Color-coded match scores
  • Code block expand/collapse
  • Hover effects with lift and glow
  • Build passes
  • No console errors

This transforms the search experience from "functional dev tool" to "premium product" 🚀

…penCodeIntel#113)

- Add framer-motion dependency for animation fallback
- Create useViewTransition hook for native View Transitions API
- Create view-transitions.css for CSS animations
- Update ResultCard with staggered blur-to-focus animation:
  - 75ms delay between cards
  - blur(10px) → blur(0px) effect
  - translateY(20px) → translateY(0) slide up
  - scale(0.98) → scale(1) subtle grow
- Wrap results list with AnimatePresence for exit animations
- Respect prefers-reduced-motion for accessibility

Fixes OpenCodeIntel#113
…ects, spring physics

Animation improvements:
- Skeleton loading cards instead of boring spinner
- Search bar glows and pulses when loading (indigo glow)
- Search icon rotates during search
- Result cards now have DRAMATIC entrance:
  - y: 60px (was 20px) - more noticeable slide
  - blur: 20px (was 10px) - more dramatic blur
  - scale: 0.9 (was 0.98) - more noticeable pop
  - rotateX: 15deg - subtle 3D tilt effect
  - Spring physics (damping: 25, stiffness: 200)
  - Stagger delay: 120ms (was 75ms)
- Hover effect with lift and blue glow shadow
- Border turns blue on hover

This is the 'premium feel' we promised. Not subtle - NOTICEABLE.
…ium cards

UX FIX - Stale Results Problem:
- Separate inputQuery (typing) vs searchedQuery (what was searched)
- When user types new query, results blur/fade to 40% opacity
- Yellow indicator: 'Press Enter to search for X' with pulsing dot
- Shows '(showing results for Y)' to clarify what's displayed
- Results have subtle 2px blur + scale down to 0.98 when stale

VISUAL REDESIGN - Premium Card Design:
- Removed cramped border-b between header and code
- More padding (px-6 py-5 vs px-5 py-4)
- Function name is now the HERO (text-lg, hover turns blue)
- Match score in colored box with gradient text:
  - Green (70%+): emerald gradient
  - Blue (50-70%): blue/indigo gradient
  - Amber (<50%): orange gradient
- Full file path shown (not truncated)
- Type badge is minimal (bg-white/5, no border)

CODE BLOCK IMPROVEMENTS:
- Max height 200px with gradient fade
- 'Show X more lines' button to expand
- 'Show less' button to collapse
- Darker code background (#08080a)
- Better padding in code block

SPACING:
- Cards now have space-y-6 (was space-y-4)
- More breathing room overall

This transforms the 'meh' results page into a premium experience.
@vercel

vercel Bot commented Jan 5, 2026

Copy link
Copy Markdown

@DevanshuNEU is attempting to deploy a commit to the Dev's projects Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Jan 5, 2026

Copy link
Copy Markdown

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

Project Deployment Review Updated (UTC)
opencodeintel Ready Ready Preview, Comment Jan 5, 2026 7:32pm

@DevanshuNEU DevanshuNEU merged commit a35a035 into OpenCodeIntel:main Jan 5, 2026
6 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.

feat(frontend): View Transitions API for search results animation

1 participant