Skip to content

services/timeline: touch drag-to-scroll and pull-to-swap for the notification body#1786

Open
tsutomu1984-hub wants to merge 3 commits into
coredevices:mainfrom
tsutomu1984-hub:touch-swap-layer-scroll
Open

services/timeline: touch drag-to-scroll and pull-to-swap for the notification body#1786
tsutomu1984-hub wants to merge 3 commits into
coredevices:mainfrom
tsutomu1984-hub:touch-swap-layer-scroll

Conversation

@tsutomu1984-hub

Copy link
Copy Markdown

Depends on: #1784 (touch_service list_node fix).

What

Touch support for the notification body (swap_layer):

  • 1:1 drag-to-scroll the body (finger-following, replacing discrete button steps)
  • pull-to-swap: over-pulling past the top/bottom edge swaps to the previous/next notification, reusing the same prv_handle_swap_attempt path as the physical UP/DOWN buttons
  • release the swap_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-expose

Scope — no third-party impact (re: the #1773 review discussion)

swap_layer is 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

tsutomu1984-hub and others added 3 commits July 22, 2026 15:14
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>
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