Meridian (v1.0.0) is structured as a personal learning, habit-tracking, or productivity dashboard. The interface welcomes a user ("William") and displays high-level statistics like a 12-day streak, total topics, a daily time goal, and average mastery. The layout features a tabbed bottom navigation menu (Dashboard, Topics, Sessions, Settings) and several content widgets meant to display active topics, daily goal progress, recommendations, and recent study sessions.
"Please review and update the JavaScript for the Meridian dashboard application.
1. Fix the Data Mapping: The arrays for 'Your Topics', 'Recommendations', and 'Recent Sessions' are not rendering to the DOM. Please wrap the data fetch in a `try/catch` block. If the fetch fails, provide a fallback array of mock data. Then, write `forEach` loops to dynamically create and append HTML elements to their respective container IDs so the dashboard isn't empty.
2. Fix the Daily Goal Logic: There is a bug where the progress shows '0 / 45 min' even though the subtext reads 'Today's sessions: 63 min logged'. Write a function that automatically takes the sum of today's logged session minutes, updates the '0' to reflect the actual minutes spent, and caps the progress bar width at 100% if the user exceeds the 45-minute goal.
3. Navigation State: Add click event listeners to the navigation tabs (Dashboard, Topics, Sessions, Settings) so that clicking a tab hides the other `` elements and only displays the active content container."