Skip to content

Fix text-selection handle drag/visuals and onboarding page 1 vibrancy - #15

Open
Chethan616 wants to merge 1 commit into
mainfrom
fix-text-selection-handles-and-onboarding
Open

Chethan616 wants to merge 1 commit into
mainfrom
fix-text-selection-handles-and-onboarding

Conversation

@Chethan616

@Chethan616 Chethan616 commented Sep 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Selection handles couldn't be dragged in any direction. Root cause: the drag gesture's pointerInput was keyed on selectedOcrRanges, which the gesture itself mutates on every move. The instant a drag moved past touch slop, Compose saw the key change and cancelled + restarted the gesture coroutine mid-drag — the restarted awaitEachGesture then waited on a fresh touch-down that never came since the same finger was still pressed. Fixed by reading the live selection via rememberUpdatedState instead of keying on it.
  • Handle shape redesigned to match real Android/Chrome/Google Docs handles: a circle with one sharp corner notched out exactly at the anchor point, asymmetric per side (bulges lean into the selection), replacing a symmetric "balloon on a flat neck" shape. Verified geometrically (numeric assertions + rendered PNG previews of the actual curves) before writing any Kotlin.
  • Highlight band between the handles is now a fully-rounded capsule instead of a flat, barely-rounded rectangle, so it reads as one selection with the handles instead of two balloons on a rod.
  • Onboarding page 1: the fanned stack of format-sheets behind the assembled book was permanently washed out (0.20/0.34 fill alpha once landed) — raised to 0.75 card / full-opacity lines, with a deliberate contrast gap kept between the two.

Test plan

  • Select text and drag each handle in all four directions repeatedly — should never stall.
  • Pinch-zoom with one finger already selecting text — second finger should cleanly cancel the selection.
  • Compare the new handle/highlight look against stock Android text selection (Chrome, Google Docs) for proportion.
  • Step through onboarding page 1 — the sheets fanned behind the book should read as vivid, distinct colors, not pale/grey.

Text selection:
- The handle-drag gesture's pointerInput was keyed on selectedOcrRanges
  — the exact value the gesture itself mutates on every move
  (onSelectOcrRange inside updateRange()). The instant a drag moved
  past touch slop, that update fired, Compose saw the key change, and
  cancelled + restarted the gesture coroutine mid-drag. The restarted
  awaitEachGesture then waited on a fresh touch-down that never came
  (the same finger was still down), so a handle drag died after the
  first movement regardless of direction. Fixed by reading the
  selection via rememberUpdatedState instead of keying on it.
- Replaced the symmetric "balloon on a flat neck" handle shape with
  the actual Android/Chrome/Google Docs construction: a circle with
  one sharp corner notched out exactly at the anchor point, asymmetric
  per side (each handle's bulge leans into the selection it bounds).
  Verified geometrically (numeric assertions + rendered PNG previews)
  before implementing in Kotlin.
- The highlight band between the handles is now a fully-rounded
  capsule (radius = half its own height) instead of a flat rectangle
  with a 2-5px corner clamp, so it reads as one selection with the
  handles rather than two balloons stuck onto a separate bar.

Onboarding page 1:
- The fanned stack of format-sheets behind the assembled book sat at
  a permanent 0.20/0.34 fill alpha once landed (only the last-landing
  sheet ever fades, as the book takes over) — pale enough on the light
  background to read as dull/grey. Raised to 0.75 card / full-opacity
  lines, keeping a real contrast gap between the two so the "document
  lines" still read against the card instead of both washing into one
  flat block.
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.

1 participant