Skip to content

ui: Migrate pricing-nodes + programs + transmission-lines pages to API #62

@victorquinn

Description

@victorquinn

Summary

Migrate the three standalone (non-Explorer) pages from static JSON imports to API-backed data fetching. These are the lowest-risk migrations.

Pages to Migrate

  1. app/(shell)/pricing-nodes/page.tsx — List page
  2. app/(shell)/pricing-nodes/[slug]/page.tsx — Detail page
  3. app/(shell)/power-plants/page.tsx — Already uses client fetch, migrate to SWR + API (SKIP — separate issue)
  4. Programs page (if it exists in the app directory)
  5. app/(shell)/transmission-lines/page.tsx — List page

Implementation Pattern

  • Check feature flag: if 'json', use existing static import; if 'database', use API
  • Server Components fetch from API with cache tags
  • Client Components use SWR for interactive filtering
  • Skeleton loading states during data fetch
  • On-demand revalidation via cache tags (NOT time-based ISR)

Acceptance Criteria

  • All three pages work with feature flag set to 'database'
  • All three pages still work with feature flag set to 'json' (rollback)
  • No visual regressions
  • Skeleton loading states during fetch
  • LCP <2.5s
  • npm run build passes

Spec ref: Sections 6.1–6.4
Blocked by: #4, #10, #11, #12 (feature flags, API endpoints), #18 (skeletons)
Blocks: Nothing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions