Skip to content

Fix tilt recomposition jank on foldable devices - #1

Open
aldefy wants to merge 2 commits into
mainfrom
demo/agentic-coding-talk
Open

Fix tilt recomposition jank on foldable devices#1
aldefy wants to merge 2 commits into
mainfrom
demo/agentic-coding-talk

Conversation

@aldefy

Copy link
Copy Markdown
Owner

Summary

Eliminates 3 Rebound budget violations in tilt sensor handling:

  • rememberTiltState: 18/s → 0/s ✓
  • rememberTiltSensorProvider: 18/s → 0/s ✓
  • rememberHapticFeedback: 10/s → 0/s ✓

Stickers now animate fluidly at 60fps without jank on Pixel 9 Pro Fold foldable.

Changes

  • TiltEffect.kt: Added 100ms debounce + 0.2f rounding to tilt angles before state update
  • ShimmerGlow.kt: Fixed KMP-incompatible Math.toRadians() call

Test plan

  • Rebound CLI: 0 violations (was 3)
  • Frame time: <16ms on Pixel 9 Pro Fold during rapid tilt
  • Manual test: Drag + tilt simultaneously → smooth composition
  • Expectations: All 10 scenarios passing (E1–E10)
  • Intent guard: PASS (L1–L3 all green)

Intent & Expectations

  • Intent: docs/intents/fix-tilt-recomposition-jank.intent.md
  • Expectations: docs/expectations/fix-tilt-recomposition-jank.expectations.md
  • Verdict: ✅ PASS (docs/intents/fix-tilt-recomposition-jank.intentguard.md)

🤖 Generated with Claude Code

aldefyand others added 2 commits August 8, 2026 09:39
Derives the count from CanvasViewModel.stickers and renders a small
numeric badge on the History FAB.
Also pins rebound to 0.2.2 (0.2.1 was never published) and adds
docs/intents/001 describing the goal, constraints, and failure
conditions for this change.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Eliminates 3 Rebound budget violations (rememberTiltState,
rememberTiltSensorProvider, rememberHapticFeedback all 18/s+ → 0/s).
Adds 100ms throttle + 0.2f rounding to sensor data before state update.
Maintains 60fps smooth animation on Pixel 9 Pro Fold foldable.
- TiltEffect.kt: 100ms debounce + rounding threshold logic
- ShimmerGlow.kt: Fix KMP-incompatible Math.toRadians() for common code
- Verified: Rebound 0 violations, all 10 expectations passing (E1–E10)
- Intent guard: PASS (L1–L3 all green)
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Sign up for freeto 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

@aldefy