Skip to content

Card screen cleanup: remove dead v1 path, harden gestures and small-window layout - #141

Open
simonas-dev wants to merge 1 commit into
mainfrom
worktree-cards-review
Open

Card screen cleanup: remove dead v1 path, harden gestures and small-window layout#141
simonas-dev wants to merge 1 commit into
mainfrom
worktree-cards-review

Conversation

@simonas-dev

Copy link
Copy Markdown
Owner

Summary

  • Remove the dead CardScreen v1 path: deletes CardScreen, CardViewModel, GetNextQuestion and their tests — a superseded code path kept only as reference next to CardScreen2 (no remaining references; all source sets compile).
  • Card gestures: pointerInput now keys on pointerInputKey/drag-listener presence and routes callbacks through rememberUpdatedState, so listener changes no longer restart (or go stale in) the gesture loop; press tracking simplified with awaitFirstDown + pressed-pointer loop.
  • Small-window support (UISizing): cards scale down to fit multi-window/foldable windows preserving aspect ratio; bigSpace is clamped at zero, and the menu is kept fully on-screen when the width constraint binds.
  • CardScreen2:
    • user-facing strings extracted to strings.xml
    • accessibility: state descriptions for cards; visually absent cards hidden via hideFromAccessibility()
    • idle/screen-on timers driven by quantized timestamps on the monotonic clock (SystemClock.elapsedRealtime), avoiding one effect-restart per motion event and immunity to wall-clock jumps
    • drag release now decays drag offsets concurrently with the state transition, so the card's visual position stays continuous from the release point
    • window resizes snap cards to their new positions instead of replaying the last state transition
  • QuestionComponent: sequential AtomicInteger ids replace UUID.randomUUID().hashCode() (collision-free within a process).

Also includes the maintenance/metro-migration commits this branch is based on (dependency bumps, Gradle 9.7.1 wrapper, Kotlin 2.4 named context parameters, detekt workaround for context-parameter files).

Test plan

  • :app:compileDebugKotlin, :app:compileDebugUnitTestKotlin, :app:compileDebugAndroidTestKotlin pass
  • :app:testDebugUnitTest passes
  • :app:detekt passes
  • Manual: card drag/click flows, idle screen-saver fade, multi-window resize on device

🤖 Generated with Claude Code

https://claude.ai/code/session_01TibSLSyWAedEWR41QxCByw

…mall-window layout

- Delete superseded CardScreen/CardViewModel/GetNextQuestion and their tests
  (dead code path next to CardScreen2)
- Card: honor pointerInputKey and drag-listener changes via
  rememberUpdatedState; simplify press tracking with awaitFirstDown
- CardScreen2: extract user-facing strings to resources, add screen-reader
  state descriptions and hide visually absent cards from accessibility
  (hideFromAccessibility), quantize touch-driven idle timestamps using the
  monotonic clock, decay drag offsets concurrently with state transitions
- UISizing: scale cards down to fit small windows (multi-window, foldables)
  preserving aspect ratio; clamp bigSpace at zero and keep the menu fully
  on-screen when the width constraint binds
- Relocate cards on window resize by snapping to the new position instead of
  replaying the last state transition
- QuestionComponent: sequential AtomicInteger ids instead of UUID hashCode

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TibSLSyWAedEWR41QxCByw
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