Skip to content

Message view long-press: add pressed-state visual feedback #1220

@denis-obukhov

Description

@denis-obukhov

What are you trying to achieve?

When the user long-presses a message, there is currently no immediate visual feedback during the “press-and-hold” phase (before the actions / context menu appears). The message looks identical until the menu shows up.

This makes the interaction feel unresponsive and unnatural:

  • Users don’t get confirmation that their press was recognized.
  • The gesture is harder to discover (some users never realize long-press exists).

I want the message cell to provide a subtle pressed state (e.g., scale down, opacity change, highlight, blur, or haptic) while the finger is held, and then transition into showing the actions view.

If possible, how can you achieve this currently?

There is no supported way to customize or hook into the “pressed / isHolding” state for the message view. The library controls the long-press handling internally and does not expose a modifier, callback, or style API for the pre-menu visual feedback.

What would be the better way?

Expose customization for the long-press pressed state so apps can match their interaction design and improve discoverability.

Possible API directions (any one of these would work):

  1. Style / modifier for the pressed state
  • Add something like a messagePressStyle(...) / longPressFeedbackStyle(...) modifier that applies while the long-press is active (finger is down, before the actions view is presented).
  • The style could be a closure that receives isPressed and returns a View.
  1. Expose a pressed-state binding / callback
  • Provide onMessageLongPressStateChange { }
  • This would let the app drive any custom animation (scale, shadow, overlay, etc.) without the library prescribing the visuals.
  1. Built-in defaults with configurability
  • Provide a reasonable default pressed animation (e.g., scaleEffect(0.98) + slight dimming) and allow opting out or tuning it:
    • pressedScale: CGFloat
    • pressedOpacity: Double
    • pressedOverlay: AnyView (or a typed closure)
    • pressedAnimation: Animation

Even a minimal solution (just scale + opacity) would materially improve perceived responsiveness and gesture discoverability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions