Skip to content

Reply to a Remotes message by pulling it toward its edge - #157

Open
simonhamp wants to merge 1 commit into
mainfrom
feat/swipe-to-reply
Open

simonhamp wants to merge 1 commit into
mainfrom
feat/swipe-to-reply

Conversation

@simonhamp

Copy link
Copy Markdown
Member

The swipe on a Remotes message used to open a slot of React, Reply and Pin. Now it just replies.

Someone else's message pulls left and yours pulls right, the same ways the swipe went before. Reply slides in from the other side of the thread as you pull, growing, turning upright and fading in. At 64 points the phone gives one light buzz, and letting go there sets the composer replying to the message and puts the keyboard up. The message springs back either way. Pulling back under 64 before letting go cancels without another buzz, and crossing again buzzes again.

The pull, the buzz and the spring back all run on the phone, through a new trigger on the gesture area: NativePHP/mobile-air#651 (trigger-x, @trigger) and NativePHP/mobile-ui#197 (the renderers). Only the reply comes back to PHP. This can't merge until those are released and the lock is bumped. I tested it through path repos to 4.7.0 and 0.9.0 with those commits on top.

What went with the slot: $actionsForId, hideActions(), draggedMessage(), SwipeTapWindow, partials/message-actions and the taps that put the slot away. Everything it offered was already in the long-press menu (Reply, React, and Pin or Unpin for an org's maintainers), so nothing is lost. React from the menu now opens the quick reactions pointing at the message, where before it went straight to the phone's emoji picker unless the slot was open. A pinned message keeps its pin beside the bubble. Double tap still hearts.

A short bubble only follows the pull as far as keeps some of it on screen, as the slot did. Bubbles now stop 64 points short of the far side rather than leaving room for the slot, so org bubbles are a little wider.

This supersedes #155, which only took out the swipe tap window. Whichever lands second needs main merged in.

Worth a look

  • Directions: theirs left, yours right. On iOS 26 a right swipe that starts on your own message replies rather than going back. A right swipe on someone else's message still goes back, and the edge swipe always does.
  • The haptic only plays on a real phone. Simulators and emulators don't.
  • The light Android recording shows Gboard's floating toolbar on the left. That's the emulator's hardware keyboard, not the app.

Testing

New Native::test() coverage: the pull's direction, trigger distance and the icon's bindings, a short bubble stopping partway, replying through trigger() (strip, autofocus, reply_to_id on send), the quick reactions from React in the menu, and Pin and Unpin from the menu in place of the slot. The tests that only covered the slot are gone or now go through the menu. The screen tests pass (1103), and the whole suite passes apart from the arch preset php check, which trips on the path repos.

I tried it against a local dev-null.sh at production on an iPhone 17 Pro simulator (iOS 26.2) and an Android 15 emulator. Theirs and yours both reply, a short pull only springs back, a vertical drag starting on a message still scrolls the thread, long press and double tap still work, and ✕ on the reply strip keeps the keyboard up on both.

Screenshots

swipe

iOS light iOS dark Android light Android dark
Before
After

Recordings: Android dark, after, Android light, after, Android light, before, iOS dark, after, iOS light, after, iOS light, before

thread

iOS light iOS dark Android light Android dark
Before
After

Recordings are slow pulls past the point: Reply comes in, the message springs back, then the strip and the keyboard.

🤖 Generated with Claude Code

The swipe on a message used to open a slot of React, Reply and Pin. Now
it only replies. Someone else's message pulls left and yours right, as
the swipe went before. Reply slides in from the other side of the thread,
growing, turning upright and fading in with the finger. Past 64 points
the phone buzzes lightly, and letting go there sets the composer replying
to the message and raises the keyboard. The message springs back either
way. The pull, the buzz and the spring back run natively through the
gesture area's new trigger-x and @trigger (NativePHP/mobile-air and
NativePHP/mobile-ui), so only the reply comes to PHP.

A short bubble only follows the pull as far as keeps some of it on
screen, as the slot did.

The slot, its show and hide state, the tap-to-hide handling and the swipe
tap window are gone. Everything the slot offered is in the long-press
menu already: Reply, React, and Pin or Unpin for an org's maintainers.
React from the menu now opens the quick reactions, pointing at the
message, rather than going straight to the phone's emoji picker. A
pinned message keeps its pin beside it. Bubbles stop 64 points short of
the far side instead of leaving room for the slot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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