Skip to content
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

Remove 500ms focus delay from PropertyTitle #6524

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

Conversation

ochen1
Copy link

@ochen1 ochen1 commented Nov 26, 2024

02a2914 was a great commit but 3 years later I am unsure why the arbitrary 500ms delay is necessary. I want to remove it.

Use case: I have a userscript that enables Google Calendar keybindings (eg. e to edit) and this delay significantly impedes my workflow (when editing the name of an event). The entire name-editing process should take 500ms total, but with the current configuration the user must wait at least 500ms for the input to focus.

I tested the removal of the delay via devtools resource override on Edge and the focus still works consistently. I hope this minor change can make the event name editing pipeline more performant for everyone.

Adding a delay ensures the element receives focus even if the directive is triggered before the component is fully mounted (e.g., during event creation).

Signed-off-by: ochen1 <[email protected]>
@ochen1
Copy link
Author

ochen1 commented Nov 26, 2024

I tested event creation and I now understand the original intention behind the 500ms delay. The popover takes some time to mount if it didn't exist before (e.g. as a quick preview), while the directive to focus is called immediately. The e.focus() call within the directive has no effect if the PropertyTitle input is not yet mounted. As such, I propose calling it twice to accommodate for both cases. In the original case, we can hope nobody finishes making title edits in under 100ms and decides to tab away to edit the date as well. Even if they do, I believe it would be an improvement from having to wait 500ms to start making edits.

A more elegant solution would probably involve finding a way to avoid triggering the focus directive until the necessary components are fully mounted and visible.

@SebastianKrupinski
Copy link
Contributor

Hi @ochen1

I see no reason not to accept your PR but we need to see what the affects are first.

On that note we have made significant changes to the calendar in the last two months in our main branch, have you pulled the latest changes to see how it all looks and works now?

Also, a screenshot or video of what we are looking for would be helpful for testing purposes.

Copy link

codecov bot commented Dec 1, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 23.33%. Comparing base (a099e7b) to head (6530e18).
Report is 31 commits behind head on main.

Files with missing lines Patch % Lines
src/directives/focus.js 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6524      +/-   ##
============================================
- Coverage     23.33%   23.33%   -0.01%     
  Complexity      453      453              
============================================
  Files           248      248              
  Lines         11777    11778       +1     
  Branches       2257     2256       -1     
============================================
  Hits           2748     2748              
- Misses         8705     8706       +1     
  Partials        324      324              
Flag Coverage Δ
javascript 14.94% <0.00%> (-0.01%) ⬇️
php 59.29% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants