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

don't always set tooltip.keyBindingCommand #308

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aminya
Copy link
Member

@aminya aminya commented Jun 10, 2020

Button creation time:

After:
2020-06-10 00_01_00-Timecop — C__Users_yahyaaba_Documents_GitHub_JavaScript_tool-bar — Atom

Before:
image

This is not shown in the loading time of tool-bar since other packages add buttons using the service, but instead, it can be easily measured using window.performance.now()

@ericcornelissen
Copy link
Contributor

I'm personally not a fan of this, as it actually changes the tool-tip as seen here:

Before After
before after

I would be fine with adding it as an option though.

@aminya
Copy link
Member Author

aminya commented Jun 11, 2020

I'm personally not a fan of this, as it actually changes the tool-tip as seen here:

Before After
before after
I would be fine with adding it as an option though.

We can certainly make a PR to Atom, and see why this key-binding adding takes time. I uploaded the branch that I ported the Atom's tooltip function:
https://github.com/aminya/tool-bar/blob/df0436db663e401471ea4acd4fd6f599f5ada84b/lib/items/tool-bar-button-view.js#L254-L325

We can also add the key-binding to the actual text instead of going through Atom's code.

tooltip.title = tooltip.title + this.options.callback

@ericcornelissen
Copy link
Contributor

We can certainly make a PR to Atom, and see why this key-binding adding takes time.

I prefer that 100% over just removing this feature from the tool-bar. But it's probably because it needs to find the keybind value in a rather large set of callback possibilities, though that doesn't mean it cannot be optimized.

We can also add the key-binding to the actual text instead of going through Atom's code.

tooltip.title = tooltip.title + this.options.callback

That won't work. The callback value, in the case if-branch you removed is entered, is not the keybind string itself, it is the command name.

@aminya
Copy link
Member Author

aminya commented Jun 11, 2020

We can certainly make a PR to Atom, and see why this key-binding adding takes time.

I prefer that 100% over just removing this feature from the tool-bar. But it's probably because it needs to find the keybind value in a rather large set of callback possibilities, though that doesn't mean it cannot be optimized.

We can also add the key-binding to the actual text instead of going through Atom's code.

tooltip.title = tooltip.title + this.options.callback

That won't work. The callback value, in the case if-branch you removed is entered, is not the keybind string itself, it is the command name.

I see. Thanks for the clarification. We can look into the actual function. The performance is not that bad though, but we may able to boost it a bit.

@ericcornelissen
Copy link
Contributor

I see. Thanks for the clarification. We can look into the actual function. The performance is not that bad though, but we may able to boost it a bit.

That means we can close this PR, right?

Again, though, I'm not against adding an option that disables this feature 😉

@aminya
Copy link
Member Author

aminya commented Jun 11, 2020

Let's keep it open for the future reference. If I close it, it might get lost 😄

@aminya aminya marked this pull request as draft June 11, 2020 17:47
@aminya aminya closed this Jul 22, 2021
@aminya aminya closed this Jul 22, 2021
@aminya aminya reopened this Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Performance] improve atom.tooltips.add
2 participants