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

Feat Request: Custmizable delay before activating blame #139

Closed
aaravind100 opened this issue Mar 28, 2023 · 10 comments
Closed

Feat Request: Custmizable delay before activating blame #139

aaravind100 opened this issue Mar 28, 2023 · 10 comments

Comments

@aaravind100
Copy link

Could we have an option to set a delay before the blame is activated?

Use case: Having enabled inline blame, when sifting through code, the inline blame often lags behind the cursor, This can be jarring as the inline blame is not a subtle color. I can post a video later.

Having a delay can sorta mitigate this, like the cursor has to stay on a line for several 100 ms before the blame would get activated.

@Sertion
Copy link
Owner

Sertion commented Mar 28, 2023

Hey Ajith! Thank you for the feature request.

I think I understand the issue. I currently don't have a lot of time to spend on the extension but I do accept pull requests if you (or anybody else) want to make an attempt at building it.

@aaravind100
Copy link
Author

Hey Albin, I understand.

TS/JS is not my speciality, but I'll try to give it a go :D

@aaravind100
Copy link
Author

@Sertion i got some time to look into the code and test some things. Initial thought was just to wait for few ms and display the line blame. This sorta works partially, but when zipping around, you see a trail of the past blames and this makes it even worse than before 🙃

After thinking it through, a better solution would be have an event handler which captures cursor events (up/down cursor movements) and events which remain unchanged for x ms would triggers the line blame.

Now that i think about it, this is much more complex than adding a delay and may not be worth adding for a minor annoyance.

Do you have something else in mind or maybe give me some pointers?

@Sertion
Copy link
Owner

Sertion commented Apr 7, 2023

@aaravind100 Thanks a lot for having a look.

The entire extension is sort of build around the idea that everything happens "eventually". Perhaps something can be done similar to how the statusbar element is updated and super short Promise.race?

@aaravind100
Copy link
Author

@aaravind100 Thanks a lot for having a look.

The entire extension is sort of build around the idea that everything happens "eventually". Perhaps something can be done similar to how the statusbar element is updated and super short Promise.race?

@Sertion adding a delay in this method kinda a solves the problem.

Before:
Before

After adding 200ms delay:
After

Would you like me to create a pr for this?

@Sertion
Copy link
Owner

Sertion commented Apr 7, 2023

Impressive! Please do!

@aaravind100
Copy link
Author

@Sertion i've created this (#141) pr

Sertion added a commit that referenced this issue Apr 8, 2023
add a delay before blame is shown (#139)
@Sertion
Copy link
Owner

Sertion commented Apr 8, 2023

Merged.

@Sertion Sertion closed this as completed Apr 8, 2023
@Sertion
Copy link
Owner

Sertion commented Apr 8, 2023

A new version has been released. It sometimes can take a few hours before it is available for everyone.

Thank you for your time and effort!

@aaravind100
Copy link
Author

Thanks a lot!!

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

No branches or pull requests

2 participants