Implement Scalable Challenge Grid UI#4
Open
spark33 wants to merge 3 commits into
Open
Conversation
Transform the frontend interview platform from a static 2-task list into a scalable card grid that can handle 10-50+ challenges with comprehensive filtering and categorization capabilities. ## Changes ### New Features - Card grid layout with responsive columns (1/2/3 based on screen size) - Filtering by category, difficulty, and search text - Dynamic routing via /challenges/[slug] - Backward compatibility with old URLs (/task1, /task2) - Reusable component architecture ### Files Added - src/data/challenges.ts - Central challenge registry with TypeScript types - src/components/ChallengeBadge/ChallengeBadge.tsx - Badge component - src/components/ChallengeCard/ChallengeCard.tsx - Card component - src/components/ChallengeFilters/ChallengeFilters.tsx - Filter UI - src/app/challenges/[slug]/page.tsx - Dynamic route handler - src/app/task2/Task2Content.tsx - Extracted task 2 content - IMPLEMENTATION_NOTES.md - Complete implementation documentation ### Files Modified - src/app/page.tsx - Refactored to card grid with filters - src/app/task1/page.tsx - Added redirect to new URL structure - src/app/task2/page.tsx - Updated to use Task2Content component - src/app/task1/debug/page.tsx - Updated navigation links ## Benefits - Scalable: Easy to add 10, 50, 100+ challenges - Maintainable: Single source of truth in challenges.ts - Type-safe: Full TypeScript support - Mobile-friendly: Responsive by default - Extensible: Easy to add progress tracking, sorting, etc. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replace useBreakpointValue with responsive props to avoid SSR issues. The hook returns undefined during server-side rendering, causing errors. Using responsive props directly is more SSR-friendly. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Wrap the app with ChakraProvider to enable Chakra UI styles across all pages. This fixes the issue where Chakra components weren't rendering with proper styles. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Transform the frontend interview platform from a static 2-task list into a scalable card grid that can handle 10-50+ challenges with comprehensive filtering and categorization capabilities.
Changes
New Features
/challenges/[slug]/task1,/task2)Files Added
src/data/challenges.ts- Central challenge registry with TypeScript typessrc/components/ChallengeBadge/ChallengeBadge.tsx- Badge component for difficulty/category/timesrc/components/ChallengeCard/ChallengeCard.tsx- Interactive card componentsrc/components/ChallengeFilters/ChallengeFilters.tsx- Filter UI componentsrc/app/challenges/[slug]/page.tsx- Dynamic route handlersrc/app/task2/Task2Content.tsx- Extracted task 2 content for reusabilityIMPLEMENTATION_NOTES.md- Complete implementation documentationFiles Modified
src/app/page.tsx- Refactored to card grid with filterssrc/app/task1/page.tsx- Added redirect to new URL structuresrc/app/task2/page.tsx- Updated to use Task2Content componentsrc/app/task1/debug/page.tsx- Updated navigation linksArchitecture Benefits
challenges.tsRoutes
/- Homepage with challenge grid and filters/challenges/debug-dashboard- Task 1 (debugging challenge)/challenges/emptystate-component- Task 2 (component design)/task1- Redirects to/challenges/debug-dashboard(backward compatibility)/task2- Shows task 2 content (backward compatibility)/task1/debug- Direct access still worksAdding New Challenges
Adding new challenges is now simple (3 steps):
src/data/challenges.tsSee
IMPLEMENTATION_NOTES.mdfor detailed instructions.Testing
🤖 Generated with Claude Code