Skip to content

feat(ui): dual-shell user-h5 — mobile H5 + desktop rider console (S36) - #4

Merged
llfzzz merged 1 commit into
mainfrom
claude/mobile-desktop-interface-redesign-bb70d1
Jul 18, 2026
Merged

feat(ui): dual-shell user-h5 — mobile H5 + desktop rider console (S36)#4
llfzzz merged 1 commit into
mainfrom
claude/mobile-desktop-interface-redesign-bb70d1

Conversation

@llfzzz

@llfzzz llfzzz commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

One user-facing app, two experiences, switched at runtime by viewport width (matchMedia (min-width: 1024px), live on resize):

  • Narrow viewports: the existing H5 Trip Flow, preserved as-is — src/styles.css has zero changes and the mobile screens were moved verbatim.
  • Wide viewports: a new desktop rider console echoing the admin Dispatch shell (216px sider + breadcrumb topbar), with rider-friendly fj-ui cards, docked master-detail panes and timelines instead of dense tables. No new npm dependencies, no Ant Design in user-h5.

Full feature parity on desktop: login, trip search/publish, booking (docked pane), orders + payment intent + cancel + review, demo inbox, driver onboarding 4-step funnel, profile/logout.

Key changes

  • Shared logic extraction: the 1317-line App.tsx is split into src/lib/{types,labels,session,api,format,queries}.ts; every TanStack Query hook keeps its exact query keys, polling intervals (orders/inbox 5s, payment-intent/identity 4s), idempotency keys and invalidations. Both shells consume the same hooks, zustand session and query cache, so crossing the breakpoint keeps auth and lands on warm data.
  • Viewport gate src/lib/useViewport.ts: matchMedia change listener + 500ms timer sync fallback — CDP viewport emulation (Playwright, embedded browser previews) resizes pages without dispatching resize/matchMedia events; the fallback keeps the gate honest there and is render-free (React bails out on an unchanged boolean).
  • Desktop shell src/desktop/ + desktop.css: all classes dsk--prefixed, strictly disjoint from the mobile stylesheet; shell CSS adapted from admin-console. Icon names constrained to fj-ui's built-in iconMask set; Timelines use icon-less colored dots.
  • Security invariant preserved on desktop: the demo inbox renders maskedPreview only; sensitive values surface exclusively through the explicit per-item 查看 reveal (existing /reveal POST). The desktop login never auto-fills the code.
  • AGENTS.md: S36 step record, dual-shell frontend baseline, refreshed verification results.

Testing

  • Playwright 3/3 passed: mobile login smoke (pinned 390×844), desktop login card at default 1280×720, and a 1023↔1024 live shell-swap spec (e2e/desktop-login.spec.ts).
  • ./scripts/verify.sh fully green: all Maven module tests + workspace-wide pnpm typecheck / pnpm build (lockfile untouched).
  • Manual browser pass at 390px (mobile screens pixel-identical) and 1280px (all five desktop views + login), including logged-in live resize swaps in both directions and graceful offline/empty states with the gateway down. Full clickable business loop against the real Docker stack is left for the next stack bring-up.

🤖 Generated with Claude Code

…1024px viewport gate (S36)

- extract shared logic from App.tsx into src/lib (types/labels/session/api/format/queries);
  query keys, polling intervals, idempotency keys and invalidations unchanged
- move mobile screens verbatim to src/mobile (styles.css untouched, pixel-identical)
- add src/desktop rider console: Dispatch-style sider + crumb bar shell, docked booking
  and order detail panes, Stat/Tabs/Timeline/List views, dsk-* scoped desktop.css
- useDesktopViewport: matchMedia(min-width:1024px) + 500ms timer sync fallback (CDP
  viewport emulation dispatches no resize/matchMedia events)
- demo-inbox invariant preserved on desktop: maskedPreview only, explicit reveal
- Playwright: pin mobile viewport in login.spec, add desktop-login + breakpoint-swap specs
- AGENTS.md: S36 record, dual-shell baseline, verification results

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 18, 2026 14:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@llfzzz
llfzzz merged commit be9cb87 into main Jul 18, 2026
1 check passed
@llfzzz
llfzzz deleted the claude/mobile-desktop-interface-redesign-bb70d1 branch July 18, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants