Commit Graph

6 Commits

Author SHA1 Message Date
Frudrax Cheng 30e3ac67d2 Require dual signatures for aftersales confirmation 2026-06-02 10:38:40 +08:00
Frudrax Cheng 7747995b3f Allow portrait signature confirmation 2026-05-28 10:45:14 +08:00
Frudrax Cheng 2a614851db Improve Android signature orientation detection 2026-05-28 10:39:29 +08:00
Frudrax Cheng 8b930ff44d fix: improve Android orientation detection in signature overlay 2026-05-28 09:42:31 +08:00
Frudrax Cheng 0f6d4a5f07 Use real device rotation for signature overlay
CSS transform: rotate(90deg) only rotates the visual; pointer events
still fire in the unrotated viewport coordinate system, and
canvas.getBoundingClientRect returns the rotated bounding box with
swapped width/height. signature_pad computed stroke positions from
clientX/clientY minus that swapped rect, so most strokes landed
outside the canvas drawing buffer. The brief flash of marks visible
when the phone was rotated back to portrait was the small fraction of
points that happened to land inside the canvas, revealed once the CSS
rotation was undone.

Drop the CSS fake-landscape and gate the signature pad behind real
device orientation: portrait shows a rotate-your-phone prompt, and
the pad only renders in landscape where the coordinate system is
clean. Attempt screen.orientation.lock('landscape') where supported;
iOS users with portrait lock see the prompt with a hint.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 09:17:56 +08:00
Frudrax Cheng ab5acbc452 Open signature in a landscape overlay and fix mobile touch
The inline signature pad on the confirm page was unusable on phones:
the canvas had a fixed 480px internal width but shrank via max-width
on small screens, so pointer coordinates landed in only the top-left
fraction of the drawing buffer. Edge-of-screen strokes also collided
with iOS Safari back-swipe.

Tapping the new signature trigger now opens a full-screen overlay
that rotates to landscape (via 100dvh/100dvw + CSS rotate on portrait
phones, plus an opportunistic screen.orientation.lock) so customers
get the widest possible signing area, away from the system edge.

Also swap the hand-rolled drawing logic for signature_pad, with a
ResizeObserver-driven resize that preserves strokes via
toData/fromData and scales the canvas to devicePixelRatio.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 09:11:05 +08:00