Repository navigation
Fix removal re-entry, drag alpha and touch listener ownership - #71
Conversation
Cover removal re-entry, transient drag alpha, host touch listeners and classification after Activity destruction. The transient alpha tests expect the spec to keep the caller's alpha during a drag, so these fail against the current implementation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A dispose from a detach callback now releases once without a second removal, and the outer call keeps DISPOSED. The drag's translucent feedback lives on the window, so spec.alpha keeps the caller's value and leaving DRAGGABLE ends it. The library now touches the View's listener only for its own drag listener, and show or update after Activity destruction reports ACTIVITY_DESTROYED. Also removes dead SDK checks and the per-move log, and documents these contracts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
APPROVE — Codex coordinator — PR #71 head Reviewed the implementation and regression tests against the user's findings. The removal guard prevents duplicate removals and terminal-state resurrection, preserves ordinary removal retries, and documents the reentrant-disposal exception. Drag feedback is separate from caller configuration, including mode changes, explicit alpha updates and failed restoration. Non-draggable operations retain host touch listeners, and Activity-destruction disposal has its own failure classification. The requested cleanup and design updates are included. Review corrections are resolved: NOT_ATTACHED documentation covers disposal, equal updates can retry failed feedback restoration, and tests assert window alpha separately from spec alpha. The documented listener ownership restriction while DRAGGABLE remains explicit: replacing the library listener directly during that mode is not a supported way to preserve a host listener on teardown. Codex validation on this exact head:
The new callback/mode-switch reproductions are Robolectric tests, not physical-device reproductions. API23/26/31/35 and physical devices were not rerun in this pass. JitPack service verification remains post-tag. No blocking findings. This approval permits the task PR's integration into release/3.0.0 under the agreed gates; it does not authorize merging #66 to main, tagging or publication. |
Problem
The review of #66 found lifecycle and drag defects in
core, and some stale documentation. This PR addresses items 1, 2, A1, A2, B and the design-document part of A4. No public signature or enum value changes.Changes
removeViewImmediateruns detach callbacks synchronously, so adispose()from one could remove the view twice, and the outerhide()then overwroteDISPOSEDwithCONFIGURED. A re-entereddispose()now releases at once without a second removal, and the outer call keepsDISPOSED. A re-enteredhide()is a no-op. Forced Activity disposal follows the same path, and an ordinary failed removal still keeps the retry.spec.alphakeeps the caller's value throughout a drag, so leavingDRAGGABLEno longer strands 0.6 and an explicit alpha is no longer overwritten on UP or CANCEL. The feedback also ends when the window is removed, and a rejected restore is reapplied by the next update or gesture.setOnTouchListeneronly to install or remove its own drag listener.DRAGGABLEreplacing a host listener is documented in KDoc and the design document.showandupdateafter Activity destruction reportACTIVITY_DESTROYED, and an ordinarydisposekeepsWINDOW_MANAGER_REJECTED. EachOverlayFailureconstant has KDoc, and the design state table is updated.>= Mand>= JELLY_BEAN_MR1checks and the per-MOVE log, explain the AOSP basis ofisNotAttached, and add full license headers toOverlayPermission.ktandOverlayViewManager.kt.DebugOverlayTree, and mark the remaining Timber mentions as historical.Behavior to review
overlay.spec.alphano longer reports the temporary value during a drag. This is the intended separation; the window alone carries it.dispose()already released the handle, the outer call reports the failure, but the handle staysDISPOSEDwith no retry. The view has already been detached at that point, and this matches the forced-disposal contract.DRAGGABLE, leaving the mode clears the host's listener too, because a View's listener cannot be read back without reflection.Tests
Regression tests are in
OverlayViewStateMachineTest,ActivityLifecycleCleanupTestandDraggableOnTouchListenerTest. Existing drag tests now assert the window's alpha separately from the spec.Against the old implementation at
b036288, these three classes ran 72 tests with 21 failures (Lifecycle 2, StateMachine 9, Drag 10), which reproduces the findings.Validation
Claude could not run Gradle or device tests in its sandbox. The Codex coordinator ran everything below on head
e344aa5.javapfound no signature change in 15 Java-callable public or protected classes, excluding the new internal synthetic helpersNot verified:
This PR does not merge to
main, tag or publish, and leaves the README unreleased wording and the CHANGELOG date unchanged.🤖 Generated with Claude Code