DEV Community


Posted on • Updated on

Hacktoberfest - Part 2

For part 2, I decided to work on an issue to fix a bug in AppFlowy, an open-source note taking app. I found the project interesting, and it also happened to be built using rust. I have started to enjoy the features of rust and wanted to know how rust is used in developing applications. The bug I worked on was related to the hover effect on an element disappearing in less than a second after it was hovered over. The hover action also opened a popup, which I suspected to be the cause.

Thus, I began to setup the project on my local to investigate this issue. Setup was fairly simple, and I was able to replicate the issue locally. However, it took me a while to understand how the app was setup. The UI of the app was built using flutter, which I had not used before. It took me a couple of hours to understand the basics of the project, and how things were structured. Finally, I figured out the components which were causing the issues.

From what I understood; what was happening is that whenever the mouse would move over the element, it would get the hover effect added, and some milliseconds later, the popup with options would get shown, resulting in the original element being rendered again. However, since the mouse did not move (i.e., re-enter the element), the onEnter hook would not trigger again, and the hover effect would not get added.

To fix this, I tried to change the onEnter hook to onHover. Since the function already had a check to see if the hover effect was already applied (which would cause it to return immediately), I concluded that it would not cause any significant performance differences. This fixed the issue somewhat. It also resulted in the hover effect temporarily disappearing some milliseconds after the element was hovered over, and then coming back. I tried deleting the delay that existed to render the popup with the options and that fixed the issue.
I tested to check if my changes broke any functionality. Since everything seemed good, I committed my changes, and created a pull request.

Latest comments (0)