Overview
The DSA Tracker is a dedicated component for logging Data Structures and Algorithms problems you solve each day. It helps you maintain accountability and track your coding practice alongside your workout routine.The DSA Tracker component exists in the codebase (
DsaTrackerTab.jsx) but is currently not integrated into the main navigation. This documentation covers its design and intended functionality.Component Structure
The DSA Tracker features a clean, focused interface:- Header card - Shows solved problem count for today
- Input section - For logging new problems
- Solved list - Displays all problems logged today
- Clear function - Reset today’s DSA progress
Header Design
FromDsaTrackerTab.jsx:12-22:
Gradient Design
Uses an emerald-to-blue gradient to distinguish it from workout tracking.
Live Counter
Shows the number of problems solved today in real-time.
Logging Problems
To log a DSA problem you’ve solved:Enter problem name
Type the problem name or number in the input field (e.g., “347. Top K Frequent Elements”).
Implementation Details
FromDsaTrackerTab.jsx:30-49:
The input field automatically trims whitespace and clears after adding a problem, making it easy to log multiple problems in succession.
Viewing Solved Problems
The solved list displays all problems you’ve logged today:- Gradient cards - Each problem appears in a white-to-emerald gradient card
- Problem name - The full problem text you entered
- Remove button - Trash icon to delete incorrectly logged problems
- Empty state - Shows “No problems logged yet” when the list is empty
List Implementation
FromDsaTrackerTab.jsx:63-92:
Why use index as part of the key?
Why use index as part of the key?
The key uses both
problem and index because users might solve the same problem multiple times in a day (e.g., different approaches). Using only the problem name would cause React key conflicts.Removing Problems
To remove a problem from today’s list:- Click the trash icon next to the problem name
- The problem is immediately removed from the list
- The counter in the header updates automatically
Clearing Today’s List
To reset all DSA problems for today:
From
DsaTrackerTab.jsx:51-59:
Data Management
The DSA Tracker expects these props:Recommended Storage Structure
Store DSA problems in localStorage with date keys, similar to workout tracking. This allows for historical tracking and streak calculations.
Integration Guide
To integrate the DSA Tracker into the main app:Dark Mode Support
The DSA Tracker is fully compatible with dark mode:- Gradient header - Adjusts from emerald-cyan-blue to deeper tones
- Problem cards - Transitions to zinc-based backgrounds
- Text colors - Uses zinc palette for optimal readability
- Icons - Maintains visibility with adjusted opacity
Potential Enhancements
Difficulty Tags
Add Easy/Medium/Hard tags to track problem difficulty distribution.
Platform Links
Auto-detect LeetCode numbers and add direct links to problems.
Time Tracking
Log how long each problem took to solve.
Streak Counter
Track consecutive days of solving at least one problem.