[PR #5706] [MERGED] fix(client): give avatar crop handles a mobile-sized touch target #6894

Closed
opened 2026-10-23 04:14:40 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5706
Author: @Gunterlie
Created: 8/31/2026
Status: ✅ Merged
Merged: 8/31/2026
Merged by: @Gunterlie

Base: staging ← Head: fix/avatar-crop-handle-touch-target


📝 Commits (2)

  • 025eaa3 fix(client): give avatar crop handles a mobile-sized touch target
  • 2673316 Merge branch 'staging' into fix/avatar-crop-handle-touch-target

📊 Changes

1 file changed (+46 additions, -15 deletions)

View changed files

📝 packages/client/src/components/ui/AvatarCropWidget.tsx (+46 -15)

📄 Description

Closes #5705

Why

The avatar crop corner handles are 14×14 CSS px, which is roughly 3.5mm on a phone — well under the ~44px mobile minimum. The reporter's video shows repeated missed taps ("I only tap the drag handles by luck").

Two things made it worse than the size alone suggests:

  • The handle element had no touch-action. The crop box sets touch-none, but touch-action is not inherited, so a drag starting on a handle could be claimed by the WebView as a scroll before setPointerCapture in onPointerDown took effect.
  • The visible square is the hit target, so there was no margin for error at all.

What

The visible 14px square is unchanged and still drawn exactly where it was. It is now wrapped in a 44px transparent touch target with touch-action: none.

The target reaches mostly outward from the crop corner — it intrudes only HANDLE_VISUAL_PX / 2 (7px) into the crop box. That matters because MIN_CROP_PX is 24: centred 44px targets would have covered a minimum-size crop entirely and made panning unreachable on touch. Reaching outward keeps the pan area usable at every crop size and stops the four corners overlapping each other.

AvatarCropWidget is shared by CharacterEditor and PersonaEditor, so this covers the persona crop the reporter suspected was also affected.

Test plan

  • pnpm check
  • node scripts/run-regressions.mjs
  • Manually crop a character avatar on a touch device and confirm the corner handles are reliably grabbable
  • Manually confirm the same for a persona avatar
  • Manually shrink the crop to its minimum and confirm panning by dragging the middle still works
  • Manually confirm the handles look unchanged on desktop and still resize with the mouse
  • Manually confirm a drag that starts on a handle does not scroll the page on mobile

Summary by CodeRabbit

  • Bug Fixes
    • Improved avatar crop corner handles for more reliable touch interaction.
    • Preserved more of the crop area for panning, especially when using the minimum crop size.
    • Maintained clear, visible corner indicators while expanding their touch targets.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/5706 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 8/31/2026 **Status:** ✅ Merged **Merged:** 8/31/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `fix/avatar-crop-handle-touch-target` --- ### 📝 Commits (2) - [`025eaa3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/025eaa377268beec00afd972406b815e5478f643) fix(client): give avatar crop handles a mobile-sized touch target - [`2673316`](https://github.com/Pasta-Devs/Marinara-Engine/commit/267331656f40ae00d7413df7a68ef2f12f0b2d73) Merge branch 'staging' into fix/avatar-crop-handle-touch-target ### 📊 Changes **1 file changed** (+46 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/ui/AvatarCropWidget.tsx` (+46 -15) </details> ### 📄 Description Closes #5705 ## Why The avatar crop corner handles are 14×14 CSS px, which is roughly 3.5mm on a phone — well under the ~44px mobile minimum. The reporter's video shows repeated missed taps ("I only tap the drag handles by luck"). Two things made it worse than the size alone suggests: - The handle element had no `touch-action`. The crop box sets `touch-none`, but `touch-action` is not inherited, so a drag starting on a handle could be claimed by the WebView as a scroll before `setPointerCapture` in `onPointerDown` took effect. - The visible square *is* the hit target, so there was no margin for error at all. ## What The visible 14px square is unchanged and still drawn exactly where it was. It is now wrapped in a 44px transparent touch target with `touch-action: none`. The target reaches mostly **outward** from the crop corner — it intrudes only `HANDLE_VISUAL_PX / 2` (7px) into the crop box. That matters because `MIN_CROP_PX` is 24: centred 44px targets would have covered a minimum-size crop entirely and made panning unreachable on touch. Reaching outward keeps the pan area usable at every crop size and stops the four corners overlapping each other. `AvatarCropWidget` is shared by `CharacterEditor` and `PersonaEditor`, so this covers the persona crop the reporter suspected was also affected. ## Test plan - [ ] `pnpm check` - [ ] `node scripts/run-regressions.mjs` - [ ] Manually crop a character avatar on a touch device and confirm the corner handles are reliably grabbable - [ ] Manually confirm the same for a persona avatar - [ ] Manually shrink the crop to its minimum and confirm panning by dragging the middle still works - [ ] Manually confirm the handles look unchanged on desktop and still resize with the mouse - [ ] Manually confirm a drag that starts on a handle does not scroll the page on mobile <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved avatar crop corner handles for more reliable touch interaction. * Preserved more of the crop area for panning, especially when using the minimum crop size. * Maintained clear, visible corner indicators while expanding their touch targets. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:14:40 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#6894
No description provided.