feat(ui): dual-shell user-h5 — mobile H5 + desktop rider console (S36) - #4
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
One user-facing app, two experiences, switched at runtime by viewport width (
matchMedia (min-width: 1024px), live on resize):src/styles.csshas zero changes and the mobile screens were moved verbatim.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
App.tsxis split intosrc/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.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).src/desktop/+desktop.css: all classesdsk--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.maskedPreviewonly; sensitive values surface exclusively through the explicit per-item 查看 reveal (existing/revealPOST). The desktop login never auto-fills the code.Testing
e2e/desktop-login.spec.ts)../scripts/verify.shfully green: all Maven module tests + workspace-widepnpm typecheck/pnpm build(lockfile untouched).🤖 Generated with Claude Code