8000 Fix forwarded messages double click (#1271) by ekrem-qb · Pull Request #1304 · team113/messenger · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix forwarded messages double click (#1271) #1304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ekrem-qb
Copy link
Contributor

Resolves #1271

Synopsis

Text inside forwarded messages can be selected, but only manually by dragging the cursor. Double clicking on forwarded messages can't select the text.

Flutter chooses deepest child GestureRecognizer for PointerEvents, so WidgetButton blocks SelectionArea of ChatView.

We could add SelectionAreas for every forwarded message but it would make them heavy to render on Web.

Solution

This PR fixes the problem without adding additional SelectionAreas. It does that by manually processing double taps and applying selection changes in parent SelectionArea.

Checklist

  • Created PR:
    • In draft mode
    • Name contains issue reference
    • Has type and k:: labels applied
  • Before review:
    • Documentation is updated (if required)
    • Tests are updated (if required)
    • Changes conform code style
    • CHANGELOG entry is added (if required)
    • FCM (final commit message) is posted or updated
    • Draft mode is removed
  • Review is completed and changes are approved
    • FCM (final commit message) is approved
  • Before merge:
    • Milestone is set
    • PR's name and description are correct and up-to-date
    • All temporary labels are removed

@ekrem-qb
Copy link
Contributor Author

FCM

Fix forwarded messages double click (#1304, #1271)

@ekrem-qb ekrem-qb added bug Bugs and incorrectness problems k::UI/UX UI (user interface) and UX (user experience) changes labels Jun 27, 2025
@ekrem-qb ekrem-qb added this to the 0.6.0 milestone Jun 27, 2025
@ekrem-qb ekrem-qb self-assigned this Jun 27, 2025
@ekrem-qb ekrem-qb requested a review from SleepySquash June 27, 2025 12:51
// https://github.com/flutter/flutter/issues/124787
const WidgetSpan(child: SizedBox(width: 95)),
],
child: DoubleTapTextSelector(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this indeed fixes the issue with double tapping the text, it still doesn't feel as easy and as native as in ChatItemWidget:

Screen.Recording.2025-06-27.at.16.02.13.mp4
  1. Double tap + tap outside.
    In ChatItemWidget: selection disappears.
    In ChatForwardWidget: selection stays and forwarded message is redirected.

  2. Triple tap.
    In ChatItemWidget: the whole text becomes selected.
    In ChatForwardWidget: selection stays on a single word and forwarded message is redirected.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To fix all of this, we need to copy a lot of SelectableRegion code to this "FixWidget".

Pros:

  • It fixes the problem without adding SelectionAreas to every forwarded message.

Cons:

  • Code would be outdated and could break after Flutter update.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I do it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ekrem-qb, are you really sure this is the only solution to the problem?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ekrem-qb, are you really sure this is the only solution to the problem? I don't find such a solution appropriate. Copying Flutter code is bad due to the reasons you stated.

@SleepySquash
Copy link
Contributor

@ekrem-qb, and about labels: ~"bug" label cannot be applied to PR, because PR is not a bug. PR fixes a bug.

@ekrem-qb ekrem-qb removed the bug Bugs and incorrectness problems label Jun 27, 2025
@ekrem-qb ekrem-qb force-pushed the 1271-fix-forwarded-messages-double-click branch from 3332013 to 9e67a6b Compare June 27, 2025 16:12
@ekrem-qb ekrem-qb marked this pull request as ready for review June 27, 2025 16:13
@SleepySquash
Copy link
Contributor

@ekrem-qb, I see you're using force pushing all the time by default. While force push itself is a useful feature, it shouldn't be used in a team practice, as it breaks the history completely and makes the previous code reviews messy - the comments left won't lead to the appropriate commits and team won't be able to even see what was there before you force pushed. https://www.reddit.com/r/git/comments/1db7n1w/comment/l7pnp8r/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

@ekrem-qb
Copy link
Contributor Author

@SleepySquash I am not using force push all the time by default, I did rebase, that's why I used force push. Rebase or Merge is a controversial topic but if force pushing is forbidden, I won't do it anymore, I am sorry.

@SleepySquash
Copy link
Contributor

@ekrem-qb, it's not forbidden and may be used in certain situations that require it. It's your development branch after all, not the mainline branch. The downsides are stated in the previous comment. Fast forward merge commit won't have those downsides, I suppose.

- fix `Copy text` menu option visibility for forwarded messages with empty note
- add ability to copy all quotes from forwarded messages without text selection
- add ability to copy certain quote from forwarded messages without text selection
@SleepySquash SleepySquash modified the milestones: 0.5.2, 0.6.0 Jul 1, 2025
@SleepySquash SleepySquash assigned SleepySquash and unassigned ekrem-qb Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
k::UI/UX UI (user interface) and UX (user experience) changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Forwarded messages can't be selected via double click and there's no Copy text option
2 participants
0