UX issues with tooltips
- Dominant language
- JavaScript
- Stars
- 776
- Forks
- 180
- PR merge metrics
- No merged PRs in 30d
Description
Four issues:
1) I noticed a flicker when clicking from within the body of one function to anywhere else in a program.
For example:
```
point(clientX, clientY);
image(getImage("avatars/leaf-blue"), 0, 0, 200, 200);
```
Say my cursor is between the "g" and "e" of `getImage()`. If I then click onto one of the parameters of `point()` then the tooltip for `image()` will flicker briefly before disappearing.
2) When the cursor is within the body of a function where tooltips are available (and the tooltip is showing), if I click onto a commented line of code, the tooltip doesn't disappear.
3) When writing a function which takes another function as a parameter (such as `image()` above), once I close the parens for the first function, the tooltip does not show for the rest of the function.
4) When typing on a commented line, the autosuggest feature remains active
Tracking down the first one took a while, as I'm new to the project so a lot of it is just getting used to the structure. I think I've figured out why it's happening, but I have a question.
```
setTimeout(function(){
if (shiftPressed) {
editor.selection.selectToPosition(pos);
}
else if (!this.$clickSelection) {
editor.selection.moveToPosition(pos);
}
this.select();
}.bind(this), 0);
```
Is there any reason for the `setTimeout()` here?
Secondly, I noticed some inconsistencies when using the mouse and keyboard. With the keyboard, if I press left or right, the tooltip appears where the cursor moves to. If I click to the left or right with the mouse, the tooltip does not appear, and only appears on the second click on in that same location. Is the desire to have the tooltip show up right away when clicking with the mouse as well?
Anyway, I'm happy to continue to spend some time on these and will submit a PR with the four fixes once I've managed to get everything figured out.
Contributor guide
No contributing guide indexed for this repository
Research direction
No files or tests are named. Start by reproducing the four tooltip and autosuggest cases, then trace the tooltip and selection handling around the shown setTimeout callback and compare mouse and keyboard paths. Done means the four reported behaviors no longer occur and mouse clicks show the intended tooltip state.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100