Page MenuHomePhabricator

Enhance Recent Searches with Featured Cases and Suggestions
Closed, ResolvedPublic

Description

Title: Enhance Recent Searches with Featured Cases and Smart Suggestions

Description:
Improve the existing “recent searches” feature by expanding it to include featured cases and intelligent suggestions. This task aims to make the homepage and search experience more informative and engaging.

Domain: Coding
Difficulty: Intermediate

Setup Steps (short):

Run the WebApp locally

Locate recent search logic and UI

Steps:

Review how recent searches are currently stored and displayed.

Add a section for featured or highlighted cases (e.g. landmark judgments).

Display suggested searches based on popular or recent activity.

Ensure suggestions are visually distinct from recent searches.

Handle empty states gracefully.

Expected Outcome:
An enhanced search experience that guides users toward meaningful legal content even before they search.

Submission Method:
Link to the Pull Request with screenshots of the updated UI.

Event Timeline

Fauwaz subscribed.

I am taking this task

Verify Featured Cases Section

  1. Click on the search input (but don't type anything)
  2. Look for the "Featured Cases" section at the top of the dropdown
  3. Verify the following:
    • ✅ Section header shows "⭐ Featured Cases" with a star icon
    • ✅ At least 1-3 featured cases are displayed
    • ✅ Each featured case shows:
      • A gavel icon (⚖️)
      • Case title (bold text)
      • Citation (if available, shown in smaller italic text)
      • A right arrow (→) on hover
    • ✅ Featured cases have a gold/yellow accent border on the left
    • ✅ Hovering over a featured case highlights it with a gold background

Verify Recent Searches Section

  1. Perform a few searches first (to populate history):
    • Search for "contract"
    • Search for "property"
    • Search for "criminal"
  1. Click on the search input (empty, no typing)
  2. Look for the "Recent Searches" section at the bottom
  3. Verify the following:
    • ✅ Section header shows "🕐 Recent Searches" with a clock icon
    • ✅ A trash icon (🗑️) appears on the right to clear history
    • ✅ Your recent searches are listed
    • ✅ Each recent search shows:
      • A clock icon (🕐)
      • The search query
      • Result count (if available)
      • An X button on hover to remove individual items
    • ✅ Recent searches have a red/gray accent border on the left
    • ✅ Hovering highlights with a red background

Expected Visual:

┌─────────────────────────────────────┐
│ 🕐 Recent Searches          🗑️     │
├─────────────────────────────────────┤
│ 🕐 contract              5 results ×│
│ 🕐 property              3 results ×│
│ 🕐 criminal              8 results ×│
└─────────────────────────────────────┘

Verify Visual Distinction

Color Coding Check:

  • ✅ Featured Cases: Gold/Yellow accent (#FCD116 or #F59E0B)
  • ✅ Suggested Searches: Green accent (#006B3F)
  • ✅ Recent Searches: Red accent (#CE1126)

Icon Distinction:

  • ✅ Featured Cases: ⚖️ (gavel) or ⭐ (star)
  • ✅ Suggested Searches: ✨ (sparkles) or 💡 (lightbulb)
  • ✅ Recent Searches: 🕐 (clock)

Verify Empty States

  1. Clear your search history (click the trash icon)
  2. Refresh the page (or wait for cases to load)
  3. Click on the search input (empty)
  4. Verify:
    • ✅ If no data is available, you see an empty state message:
      • "💡 Start typing to see search suggestions"
    • ✅ If only some sections have data, only those sections appear
    • ✅ Empty sections don't show at all (not just blank)

Verify Functionality

  1. Click on a Featured Case:
    • ✅ Should populate the search input with the case title
    • ✅ Should trigger a search automatically
    • ✅ Should navigate to search results
  1. Click on a Suggested Search:
    • ✅ Should populate the search input with the suggestion
    • ✅ Should trigger a search automatically
    • ✅ Should navigate to search results
  1. Click on a Recent Search:
    • ✅ Should populate the search input with the query
    • ✅ Should trigger a search automatically
    • ✅ Should navigate to search results