Skip to content

Press the shared buttons like the composer's controls - #123

Merged
Tarquinen merged 1 commit into
devfrom
button-press-scale
Nov 17, 2026
Merged

Tarquinen merged 1 commit into
devfrom
button-press-scale

Conversation

@Tarquinen

@Tarquinen Tarquinen commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

The app's shared buttons (OpenCodePrimaryButton, OpenCodeSecondaryButton, OpenCodeIconButton) answered a press only with Material's ripple. They felt inert next to the controls that already use the shared press: the composer's + button and Share's Send.

Now all three apply motionPress inside the component, on the button's own interaction source. That's the existing 0.97 scale on Motion.press, with a dim instead under Reduce Motion. Every caller gets it from this one change, and the ripple stays on top.

What I decided:

  • One amount everywhere. On a full-width button, 0.97 pulls each edge in about 1% under the ripple. It reads as a light push, not a heavy one, so wide buttons don't need a smaller amount.
  • Bare and tiled icon buttons barely show it. On a bare header glyph, or a button whose visible tile belongs to its parent (the drawer's Settings button), only the ripple and glyph shrink, by about 1 dp. That's harmless, and those buttons still get the ripple.
  • No double scale. No existing press scale wraps these components. The composer's + button, Share's Send and the open answer-bar-button-motion branch (the answer and dictation bar buttons) all use their own Box + clickable, so nothing will scale twice once both merge.
  • Disabled buttons don't move. Material emits no press when enabled = false.
  • The task's premise was off. On dev, the composer's Send/Stop/Call button doesn't scale under the finger. 7d895578 only gives it a pulse when the control changes. The finger press lives on the + button and Share's Send.

Verified: vm.sh build and vm.sh check :core are green. I recorded before and after on an emulator against session-lab, at real speed and at animator_duration_scale 5, and checked the frames. It hasn't been checked on a phone, so the amount and timing on wide buttons still need a look on a real device.

The video shows What's New's "Choose a Model" (full width) and the drawer's Settings icon button, before and after, at real speed and slowed 5x.

button-press-before-after.mp4

Follow-ups, not in this PR: the 28 clickables that switch the ripple off, call controls, the camera shutter, busy-button spinners, and icon swaps inside the icon button.

OpenCodePrimaryButton, OpenCodeSecondaryButton and OpenCodeIconButton
showed only Material's ripple under the finger. They now also apply the
shared motionPress (0.97 on Motion.press, a dim under Reduce Motion) on
the button's own interaction source, so every caller gets it. The
ripple stays. Disabled buttons emit no press, so they don't move.

No other press scale wraps these components (the composer + button,
Share's Send and the answer/dictation bars are custom Box clickables),
so nothing scales twice.

Verified: vm.sh build and vm.sh check :core green; before/after
recorded on the FX_1 emulator against session-lab (What's New
"Choose a Model" and the drawer's Settings button, real speed and at
animator_duration_scale 5). Not checked on a phone.
@Tarquinen
Tarquinen merged commit d49ec30 into dev Nov 17, 2026
3 checks passed
@Tarquinen Tarquinen mentioned this pull request Nov 18, 2026

This branch was previously deployed

1 inactive deployment
release — b5242d7b Deployed Nov 17, 2026 by Tarquinen via check #406
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