Skip to content

feat: implement puzzle list page with grid display and filtering#283

Merged
A6dulmalik merged 3 commits intoMindBlockLabs:mainfrom
akintewe:feature/puzzle-list-grid-display
Feb 25, 2026
Merged

feat: implement puzzle list page with grid display and filtering#283
A6dulmalik merged 3 commits intoMindBlockLabs:mainfrom
akintewe:feature/puzzle-list-grid-display

Conversation

@akintewe
Copy link
Contributor

Summary

This PR implements the Puzzle List Page with a responsive grid layout and filter capabilities, replacing the empty stub page that previously only rendered <div>page</div>.

Changes

  • frontend/components/puzzles/PuzzleCard.tsx — New reusable card component with:

    • Color-coded type badge (Logic → purple, Coding → blue, Blockchain → emerald)
    • Color-coded difficulty badge with colored dot indicator (Beginner → green, Intermediate → yellow, Advanced → orange, Expert → red)
    • Puzzle title, 2-line truncated description (line-clamp-2)
    • Footer row: category pill (blue) + time limit
    • Click navigates to /puzzles/:id
    • Hover state (border-gray-600, slightly lighter card bg) and keyboard focus ring
  • frontend/app/puzzles/page.tsx — Full page implementation with:

    • Responsive grid: 1 column (mobile) → 2 columns (sm) → 3 columns (lg/desktop)
    • FilterBar wired via useState<PuzzleFilters> — category and difficulty selections feed directly into the usePuzzles() query params
    • Loading state: 6 animated skeleton cards (pulse animation proportioned to match real cards)
    • Error state: message + "Try again" button that calls refetch()
    • Empty state: icon + "No puzzles found" + "Try adjusting your filters" hint
    • Result count label displayed above the grid

Test plan

  • Navigate to /puzzles — grid renders with puzzle cards
  • Verify 1-column layout on mobile, 2-column on tablet, 3-column on desktop
  • Select a category from the filter dropdown — grid updates to show filtered results
  • Select a difficulty pill — grid updates accordingly
  • Combine category + difficulty filters — both apply simultaneously
  • Click "Clear filters" — grid resets to all puzzles
  • Click a puzzle card — navigates to /puzzles/:id
  • Simulate loading (slow network) — 6 skeleton cards display with pulse animation
  • Simulate API error — error message and "Try again" button appear; clicking retries the request
  • Simulate empty results — empty state icon and message display
  • Verify dark theme matches existing pages (bg-[#050C16], bg-[#0A1628], border-gray-800)

Closes #254

- Create PuzzleCard component with type, difficulty badges, description, category, and time limit
- Rewrite puzzles page with responsive 1/2/3 column grid layout
- Wire FilterBar with category and difficulty filters into usePuzzles query params
- Add skeleton loading grid, error state with retry, and empty state UI
- Fix useReducedMotionCheck to import usePrefersReducedMotion from local hooks, not framer-motion
- Fix usePrefersReducedMotion return type by coalescing null to false so boolean is satisfied
React Query hooks (useQuery) require a QueryClientProvider in the tree.
Create QueryProvider wrapper and add it to the root layout so all pages
including /puzzles can use usePuzzles and useCategories without crashing
during prerender.
@A6dulmalik A6dulmalik merged commit 5e75fbb into MindBlockLabs:main Feb 25, 2026
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.

FRONTENDPuzzle List Page - Grid Display

2 participants