Skip to content

[Feature]: Add dynamic Gemini-powered Roadmap Loader and Error Fallbacks on Dashboard #236

Description

@misthykoshta05-design

Before submitting

  • I have searched existing issues and discussions to make sure this idea is not already covered.
  • I have read the contribution guidelines.

Problem statement

The dashboardPage.jsx file is the central command station for CodeLens. It is designed to render unified developer telemetry profile information and coordinate directly with backend modules to display Gemini AI-synthesized learning roadmaps
.
Because this feature relies on multiple streaming external components (scraping data from LeetCode/Codeforces, communicating with the GitHub API, and executing runtime analysis prompts via the @google/generative-ai SDK), it introduces a synchronous structural dependency. If any of these downstream APIs experience standard developer edge cases (such as API downtime, structural shifts in data layout, API key configuration dropouts, or network rate-limiting), the current frontend page fails aggressively.

Proposed solution

The proposed solution introduces a structural overhaul of dashboardPage.jsx to transition the user experience from a fragile, direct-render cycle to a resilient, state-driven lifecycle. By decoupling the interface into three clean rendering states (Loading, Error, and Success), the component handles system faults gracefully without breaking the core application layout.

  1. Unified State Lifecycle Management

Integrate local React state wrappers (isLoading, error, telemetry, roadmap) to tightly couple network conditions directly to structural rendering components.
All operations are contained within a centralized async function (fetchDashboardData), making data retrieval declarative and easily reusable.
Incorporates a defensive try...catch...finally block that traps backend exceptions, prevents runtime TypeError: cannot read properties of null crashes, and maps error logs down to human-readable strings.

  1. High-Fidelity Tailwind Shimmer Skeletons ()
    Replaced the traditional, jarring blank screens and generic global loading loops with matching layout skeletons.
    Uses layout-exact containers styled with Tailwind CSS's native .animate-pulse and bg-zinc-850/900 dark-mode tones.
    Mimics the precise wireframes of the metrics grid and the chronological AI milestone timeline, reducing layout shift (CLS) and increasing perceived application performance while background APIs resolve data.

  2. Isolated Error Bounds & Self-Healing Triggers
    Instead of breaking the interface when Gemini or competitive programming platform aggregators time out, the UI safely drops back into a clean, contained Exception Handling Card.
    Provides explicit error diagnostics (e.g., separating token issues from standard backend handshake delays).
    Employs an interactive "Retry Synthesizing Roadmap" manual trigger button that re-fires the async fetching cycle, giving the application self-healing capabilities without forcing a browser-wide hard refresh
    .

  3. Smooth Layout Transitions
    Wrapped the populated data containers inside an animate-fadeIn styling block, smoothing the visual presentation as the application shifts state from placeholder skeleton frames into live telemetry profiles.

I would like to work on this issue under GSSoC'26.
Kindly assign this issue to me
Thank you

Alternative solutions considered

Instead of manually orchestrating useState hooks and tracking error lifetimes inside the component lifecycle, this approach delegates state tracking, network re-fetching, and cache validation to a dedicated state manager. It wraps the entire dashboard page in a native React Error Boundary to isolate platform anomalies.
1Robust Global Cache & Request Deduplication

Eliminate useEffect Boilerplate: Utilize TanStack Query’s useQuery hook to manage server data fetching. This completely eliminates manual error and loading state tracking.
Auto-Retry & Edge-Case Resilience: Configures a standard 3-time automatic retry policy with an exponential backoff. If Google Gemini or Codeforces APIs face a temporary network hiccup, the query engine automatically re-attempts the handshake behind the scenes.
Stale-While-Revalidate Engine: Implements global data caching. If a user toggles between different tabs (e.g., Home, Explore, and Dashboard), data is immediately served from the cache, preventing redundant concurrent Axios calls.

Use case or motivation

Robust Application Stability via Fault Isolation

Zero Fragmented Application Crashes: By implementing a declarative ErrorBoundary, a failure inside the Gemini API handshake or the competitive programming web scrapers is cleanly trapped. Instead of crashing the entire site or throwing a blank white screen, only the specific dashboard viewport displays a failure state, leaving global headers, profile drop-downs, and sidebars fully operational.
Self-Healing Request Lifecycle: With built-in request re-tries (configured with exponential backoff), transient micro-timeouts or temporary network drops automatically resolve themselves in the background without requiring user intervention.

Elimination of Code Smells & State Boilerplate

References or mockups

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions