Skip to content

feat: restore order details page with generic 5-step progress pipeline and interactive CAD previews#3486

Closed
itisrohit wants to merge 5 commits into
tscircuit:mainfrom
itisrohit:feat/restore-order-details
Closed

feat: restore order details page with generic 5-step progress pipeline and interactive CAD previews#3486
itisrohit wants to merge 5 commits into
tscircuit:mainfrom
itisrohit:feat/restore-order-details

Conversation

@itisrohit
Copy link
Copy Markdown
Contributor

@itisrohit itisrohit commented May 23, 2026

Description

This PR restores the Order Details page (/orders/:orderId) which previously resulted in a 404 when navigating from /my-orders.

Following feedback from @imrishabh18, this has been fully updated to remove all JLCPCB-specific logic. The page now uses a clean 5-step generic order progress pipeline driven by the existing Stripe checkout flags on the order schema.

Note: Rebased on top of #3487 (merged cleanup of old order steps).

Screenshot

Order details page showing 5-step pipeline with PCB viewer and simulation toolbar

What's New

5-Step Generic Order Pipeline

Maps directly to real order schema flags — no JLCPCB dependency:

Step Flag
Order Placed always done
Payment Received is_stripe_payment_paid
Fabrication Files Ready is_started
In Production is_started && !is_finished
Completed & Shipped is_finished

Features

  • Real-time status stepper with animated active step indicator and progress bar
  • Auto-polling via React Query (every 2s while is_running)
  • Dev simulation toolbar — Pay, Start Production, Complete, Fail, Reset buttons (via _simulate_paid, _simulate_started, _simulate_finished, _simulate_error, _simulate_reset query params)
  • Tabbed CAD preview panel — PCB layout, 3D CAD board view, Schematic diagram, Circuit JSON table inspector
  • Error state display with structured error code and message banner

Changes Made

  • src/App.tsx — Registered /orders/:orderId route pointing to ViewOrderPage
  • src/pages/view-order.tsx — New page with 5-step generic stepper, simulation toolbar, and tabbed viewers
  • fake-snippets-api/routes/api/orders/get.ts — Replaced _simulate_scenario + JLCPCB state machine with clean _simulate_paid/started/finished/error/reset flags; also exposes circuit_json and error for the UI
  • fake-snippets-api/routes/api/sessions/create_passwordless.ts — New dev-only passwordless login endpoint to enable local /dev-login flow
  • fake-snippets-api/lib/db/seed.ts — Added two seeded orders with realistic circuit JSON for local testing

Verification

  • bun run lint ✅ Biome format clean (632 files checked)
  • bun run typecheck ✅ Zero TypeScript errors
  • bun test bun-tests/fake-snippets-api/routes/orders/orders.test.ts ✅ 4/4 tests pass
  • Manually tested:
    1. Login via /dev-login
    2. Visit /my-orders → click View Details
    3. Verify 5-step stepper renders correctly in default state
    4. Click simulation buttons (Pay → Start → Complete) and confirm stepper advances
    5. Click Fail to confirm error banner appears
    6. Click Reset to restore initial state

Copy link
Copy Markdown
Member

@imrishabh18 imrishabh18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't support jlcpcb ordering, and the order steps which you are using are old steps which needs to be get ridden off. We might use that timeline UI to show progress

@imrishabh18
Copy link
Copy Markdown
Member

I have merged a PR which cleans up the old order steps

@itisrohit itisrohit force-pushed the feat/restore-order-details branch from 999153f to 00a88d7 Compare May 23, 2026 10:40
Copy link
Copy Markdown
Contributor Author

@itisrohit itisrohit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated! I've rebased onto the cleanup PR (#3487) that you merged. The PR now:

  • ✅ Completely removes all JLCPCB references from the order page
  • ✅ Uses the generic 5-step pipeline: Placed → Paid → Files Ready → In Production → Completed, mapped directly to the Stripe order flags (is_stripe_payment_paid, is_started, is_finished)
  • ✅ Dev simulation toolbar with 5 simple buttons: Pay, Start Production, Complete, Fail, Reset (using _simulate_paid, _simulate_started etc.)
  • ✅ Tabbed CAD previews: PCB, 3D View, Schematic, JSON inspector
  • ✅ Zero TypeScript errors, Biome format clean

As you suggested, the timeline UI is now repurposed to show the generic Stripe progress pipeline — ready to be adapted if/when a new fabrication flow is added.

@itisrohit itisrohit changed the title feat: restore and upgrade order details page with JLCPCB stepper and interactive previews feat: restore order details page with generic 5-step progress pipeline and interactive CAD previews May 23, 2026
@github-actions
Copy link
Copy Markdown

This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs.

@github-actions github-actions Bot added the stale label May 28, 2026
@github-actions
Copy link
Copy Markdown

This PR was closed because it has been inactive for 1 day since being marked as stale.

@github-actions github-actions Bot closed this May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants