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

Several fixes for Hotkey Inlay Hints #1895

Merged
merged 4 commits into from
Jul 10, 2024
Merged

Conversation

steveyegge
Copy link
Contributor

Based on user feedback from GTM and Product, discussions with @danielmarquespt , and my own testing, I've made the following round of fixes to the hotkey hint feature, which shows an inlay with "Ctrl + Alt + ↵ to Edit" at the end of your selections in the editor window:

  1. There is a new Preferences option for disabling the feature:
image
  1. The hint no longer draws if the selection is only on one line.
  • this takes care of many annoying cases, such as Find/Replace lighting it up everywhere
  1. The hint now draws below the last line of the selection.

This makes it less intrusive, IMO, as it's out of the way of the cursor.

I think it's also more intuitive. Several users claim that it "used to work that way". It never actually worked that way; it always drew at the end of the last line of the selection. But now it does work that way.

The one downside is that the hint can sometimes draw rather far from the selection, appearing to be two lines below. We will see how people respond to it.

Coincidentally and usefully, this change also fixes CODY-2541. Getting the hint inlay out of the way of the cursor removed the interference with fine-tuning the selection.

These changes also appear have to fixed CODY-2748, because I reported it and I can no longer reproduce it. It used to be 100% reproducible, so I'm going to mark it closed until it resurfaces.

fixes CODY-2541
fixes CODY-2748

Test plan

This requires UI testing to verify with actual integration tests.
I reviewed the test plan, and these changes do not affect the plan.

- there is a new Preferences option for disabling it
- the hint no longer draws if the selection is only on one line
  - this takes care of many annoying cases, such as Find/Replace lighting it up everywhere
- the hint now always draws below the last line of the selection.
  - this makes it less intrusive, IMO, as it's out of the way of the cursor
  - it's more intuitive, I think -- several users claim that it "used to work that way".
    It never actually worked that way; it always drew at the end of the last line of
    the selection. But now it does work that way.
  - coincidentally and usefully, this also fixes CODY-2541
    - getting the hint inlay out of the way of the cursor removed the interference

fixes: CODY-2541
@steveyegge steveyegge enabled auto-merge (squash) July 9, 2024 06:19
@@ -41,17 +41,22 @@ class CodySelectionInlayManager(val project: Project) {
val startOffset = event.newRange.startOffset
val endOffset = event.newRange.endOffset
if (startOffset == endOffset) {
// Don't show if there's no selection.
return
return // Don't show if there's no selection.
Copy link
Contributor

Choose a reason for hiding this comment

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

@steveyegge Shouldn't isCodyUIHintsEnabled be also checked somewhere in this code block?
I fail to see any place where it is actually used, but perhaps I miss something obvious

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Damn, good catch. I had it at one point, and a merge killed it. Fixed.

@steveyegge steveyegge requested a review from pkukielka July 9, 2024 14:31
Copy link
Contributor

@pkukielka pkukielka left a comment

Choose a reason for hiding this comment

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

LGTM

@steveyegge steveyegge merged commit d65ffc9 into main Jul 10, 2024
7 checks passed
@steveyegge steveyegge deleted the stevey/hotkey-hint-inlay-fixes branch July 10, 2024 09:30
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.

2 participants