[GH-ISSUE #2498] [Bug] Calendar events open up speed #1077

Closed
opened 2026-03-23 20:45:11 +00:00 by mirror · 5 comments
Owner

Originally created by @annieappflowy on GitHub (May 10, 2023).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/2498

Originally assigned to: @richardshiue on GitHub.

Bug Description

https://github.com/AppFlowy-IO/AppFlowy/assets/12026239/c8aae426-7fe4-4d88-b7b0-225099c09d36

feel a bit sluggish when opening up an event card
not sure if it's just me

How to Reproduce

Create a calendar
Add an event to a date
Close it
Open it up

Expected Behavior

Feel smooth and agile?

Operating System

MacOS

AppFlowy Version(s)

Main branch

Screenshots

No response

Additional Context

No response

Originally created by @annieappflowy on GitHub (May 10, 2023). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/2498 Originally assigned to: @richardshiue on GitHub. ### Bug Description https://github.com/AppFlowy-IO/AppFlowy/assets/12026239/c8aae426-7fe4-4d88-b7b0-225099c09d36 feel a bit sluggish when opening up an event card not sure if it's just me ### How to Reproduce Create a calendar Add an event to a date Close it Open it up ### Expected Behavior Feel smooth and agile? ### Operating System MacOS ### AppFlowy Version(s) Main branch ### Screenshots _No response_ ### Additional Context _No response_
mirror 2026-03-23 20:45:11 +00:00
Author
Owner

@richardshiue commented on GitHub (May 10, 2023):

I can feel it as well

<!-- gh-comment-id:1542258145 --> @richardshiue commented on GitHub (May 10, 2023): I can feel it as well
Author
Owner

@Xazin commented on GitHub (May 13, 2023):

Try in release mode, if you're in dev environment.

<!-- gh-comment-id:1546485359 --> @Xazin commented on GitHub (May 13, 2023): Try in release mode, if you're in dev environment.
Author
Owner

@richardshiue commented on GitHub (May 14, 2023):

Hey there @Xazin, this is observable in v0.1.5 as well.

I've tracked down the problem to the following:

  • There are two GestureDetectors in place here, one being the background card that's listening to onDoubleTap (to create a new event) and the child event card further down in the widget tree listening to onTap (to open the event as a page).
  • When a click is detected within the boundaries of the child, that event is sent to the gesture arena, where it could be matched for either onTap or onDoubleTap.
  • In order to discern which of the two it is, a 300 ms timer is started to listen for a second tap. Only when it is absolutely sure that the event is not a double tap will the onTap handler be called.
  • To see this in action, remove the onDoubleTap handler and see that clicking on an event card opens the event editing page almost instantaneously.
  • Following this logic, there is another bug. If I double-click on the card, a new event will be created. This is unintended behavior as well.

We should make the child perform hit testing immediately, while the area of parent under the child should be blocked from possibly being able to enter the gesture arena. However, I haven't figured out a way to separate and block the event propagation properly.

  • IgnorePointer and AbsorbPointer are both useless since they block the child, not the parent.
  • adding an empty onDoubleTap handler to the child GestureDetector solves the problem of double tapping on the card creating a new event, but actually opening the event still takes a while.

ref: https://github.com/flutter/flutter/issues/22950

<!-- gh-comment-id:1546808389 --> @richardshiue commented on GitHub (May 14, 2023): Hey there @Xazin, this is observable in v0.1.5 as well. I've tracked down the problem to the following: - There are two `GestureDetector`s in place here, one being the background card that's listening to `onDoubleTap` (to create a new event) and the child event card further down in the widget tree listening to `onTap` (to open the event as a page). - When a click is detected within the boundaries of the child, that event is sent to the gesture arena, where it could be matched for either `onTap` or `onDoubleTap`. - In order to discern which of the two it is, a 300 ms timer is started to listen for a second tap. Only when it is absolutely sure that the event is not a double tap will the `onTap` handler be called. - To see this in action, remove the `onDoubleTap` handler and see that clicking on an event card opens the event editing page almost instantaneously. - Following this logic, there is another bug. If I double-click on the card, a new event will be created. This is unintended behavior as well. We should make the child perform hit testing immediately, while the area of parent under the child should be blocked from possibly being able to enter the gesture arena. However, I haven't figured out a way to separate and block the event propagation properly. - `IgnorePointer` and `AbsorbPointer` are both useless since they block the child, not the parent. - adding an empty `onDoubleTap` handler to the child `GestureDetector` solves the problem of double tapping on the card creating a new event, but actually opening the event still takes a while. ref: https://github.com/flutter/flutter/issues/22950
Author
Owner

@MayurSMahajan commented on GitHub (May 21, 2023):

When I was trying the calendar, I clicked on the event and because it did not open up, I kept clicking it, and the event never opened up as a page, I thought maybe its only my device.
Can we remove the feature of double tap to create a new event completely since the plus icon at the top left corner can be used to create a new event ?

<!-- gh-comment-id:1556152091 --> @MayurSMahajan commented on GitHub (May 21, 2023): When I was trying the calendar, I clicked on the event and because it did not open up, I kept clicking it, and the event never opened up as a page, I thought maybe its only my device. Can we remove the feature of `double tap to create a new event` **completely** since the plus icon at the top left corner can be used to create a new event ?
Author
Owner

@Xazin commented on GitHub (May 21, 2023):

When I was trying the calendar, I clicked on the event and because it did not open up, I kept clicking it, and the event never opened up as a page, I thought maybe its only my device.
Can we remove the feature of double tap to create a new event completely since the plus icon at the top left corner can be used to create a new event ?

I think this is a good idea.

<!-- gh-comment-id:1556152553 --> @Xazin commented on GitHub (May 21, 2023): > When I was trying the calendar, I clicked on the event and because it did not open up, I kept clicking it, and the event never opened up as a page, I thought maybe its only my device. > Can we remove the feature of `double tap to create a new event` **completely** since the plus icon at the top left corner can be used to create a new event ? > I think this is a good idea.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#1077
No description provided.