services/timeline: touch drag-to-scroll and pull-to-swap for the notification body#1786
Open
tsutomu1984-hub wants to merge 3 commits into
Open
services/timeline: touch drag-to-scroll and pull-to-swap for the notification body#1786tsutomu1984-hub wants to merge 3 commits into
tsutomu1984-hub wants to merge 3 commits into
Conversation
Give the notification-body swap layer its own touch drag-to-scroll, following the same pattern as the ScrollLayer/MenuLayer touch support: touchdown records the current notification's scroll offset, position updates follow the finger 1:1 (content-scroll direction: dragging up reveals content further down), and the offset is hard-clamped to the current notification's bounds. Swapping to the adjacent notification is left to the existing UP/DOWN buttons for now. The swap layer subscribes to touch_service directly from its click config provider (and unsubscribes on deinit). Owning that subscription also makes touch_has_app_subscribers() true, so the touch-to-click synthesis bridge, if present, stops synthesizing button clicks for this window without any extra arbitration. Includes a focused unit test that drives the captured touch handler and asserts direction, threshold, clamping, and gesture lifecycle. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: tsutomu sasaki <tsutomu1984@gmail.com>
Extend the swap_layer touch drag so pulling the finger past a clamped scroll edge by more than an over-pull margin swaps to the adjacent notification, reusing the same prv_handle_swap_attempt path as the physical UP/DOWN buttons. Over-pulling at the top goes to the previous notification, at the bottom to the next; a normal scroll that only reaches the edge does not swap. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: tsutomu sasaki <tsutomu1984@gmail.com>
The notification body's swap_layer subscribes to the touch service so it can be dragged. When the action menu (or any higher modal) is opened via SELECT and covers the body, the swap_layer kept its KernelMain touch subscription: touch_has_app_subscribers() stayed true, which suppressed the touch-to-click synthesis bridge for the now-focused action menu, and touch events were still delivered to the hidden body. Release the subscription from the notification window's disappear handler. On re-expose the modal manager re-runs the click config provider, which re-subscribes the swap_layer, so drag-to-scroll is restored. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: tsutomu sasaki <tsutomu1984@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on: #1784 (touch_service list_node fix).
What
Touch support for the notification body (
swap_layer):prv_handle_swap_attemptpath as the physical UP/DOWN buttonsswap_layer's touch subscription when the body is covered by a higher modal (e.g. the action menu opened via SELECT), so touch reaches the focused modal instead of the hidden body; re-subscribed automatically on re-exposeScope — no third-party impact (re: the #1773 review discussion)
swap_layeris an internal system-UI widget for the notification body; it is not part of the third-party app SDK. This PR changes only system notification behavior and does not alter the runtime behavior of any third-party app.Testing
Unit tests:
test_swap_layer_touch(11, incl. drag / clamp / edge-swap / subscription lifecycle). Verified on-device (Pebble Time 2): sticky scrolling the notification body, edge pull-to-swap between notifications, and body → action-menu → back with scrolling restored.🤖 Generated with Claude Code