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

Fixed docstring collapse/expand icon not changing when clicking rapidly #2217

Merged
merged 16 commits into from
Oct 12, 2023

Conversation

Hetarth02
Copy link
Contributor

@Hetarth02 Hetarth02 commented Aug 17, 2023

Now click all you want!

Edit by @mortenpi: close #2103

@Hetarth02 Hetarth02 mentioned this pull request Aug 17, 2023
7 tasks
Copy link
Member

@mortenpi mortenpi left a comment

Choose a reason for hiding this comment

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

This shouldn't have a CHANGELOG because it's not a change relative to a previous versions (though we could add the issue and PR reference to the original changelog entry).

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
@mortenpi
Copy link
Member

So two things I notice here now:

  1. There is now this weird lag after you click (once) which doesn't seem ideal. I think it should react immediately to the first click and then ignore the following ones.
  2. If you're now clicking rapidly, nothing happens at all until you stop. This is not a big deal though, since there's not much reason to normally rapidly click anyway.

@mortenpi mortenpi added the Format: HTML Related to the default HTML output label Aug 17, 2023
@mortenpi mortenpi added this to the 1.0.0 milestone Aug 17, 2023
@Hetarth02
Copy link
Contributor Author

  1. There is now this weird lag after you click (once) which doesn't seem ideal. I think it should react immediately to the first click and then ignore the following ones.

This is because it is wrapped in the debounce function with a 300ms delay. And debounce runs everytime, so best we can do is decrease the delay to 100ms.

  1. If you're now clicking rapidly, nothing happens at all until you stop. This is not a big deal though, since there's not much reason to normally rapidly click anyway.

Again, due to debounce.

@mortenpi
Copy link
Member

This is because it is wrapped in the debounce function with a 300ms delay. And debounce runs everytime, so best we can do is decrease the delay to 100ms.

I am not sure the lag is an improvement over the current status quo. The bug with rapid clicking is an unlikely edge case, but the lag is something the users will run into every time they collapse/open something. And reducing the debounce time doesn't seem like the right approach either. As I said, I think the UI should react right away to the first click, and then debounce the following clicks.

@Hetarth02
Copy link
Contributor Author

Ok, maybe a mix of throttling and debounce could be the way to go. Let me see what I can do.

(As far as I know, lodash debounce has some options relating to this.)

@mortenpi mortenpi modified the milestones: 1.0.0, 1.1.0 Aug 30, 2023
@mortenpi mortenpi removed this from the 1.1.0 milestone Sep 28, 2023
@Hetarth02
Copy link
Contributor Author

Hetarth02 commented Oct 5, 2023

@mortenpi I have made some changes, would you be able take a look?

Copy link
Member

@mortenpi mortenpi left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @Hetarth02!

@mortenpi mortenpi enabled auto-merge (squash) October 12, 2023 07:47
@mortenpi mortenpi merged commit a86549b into JuliaDocs:master Oct 12, 2023
19 of 21 checks passed
@Hetarth02 Hetarth02 deleted the Issue-2103 branch October 15, 2023 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Format: HTML Related to the default HTML output Type: Bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docstring collapse/expand icon not changing when clicking rapidly
2 participants