Skip to content

search: Query input tooltip tweaks (CodeMirror)

Warren Gifford requested to merge fkling/query-input-tooltip-tweaks into main

Created by: fkling

A couple of small improvements to the token tooltip behavior:

  • Fixed the end position of type: field tokens. It looks like - 1 was intentionally subtracted to ensure that Monaco would highlight the token with a different color, but that doesn't seem necessary. Monaco highlights the separator correctly even without that change.

    2022-07-14_12-37
  • Extend and use getTokensTooltipInformation also in the extension for highlighting the token, so that we don't need to duplicate (and sync) the logic for determining whether we have tooltip information for a token.

  • Fixed the end position of the hover tooltip to be inclusive. This ensures that the proper tooltip is shown when moving the cursor from left to right to the next token. Otherwise the information for the previous token might still be shown. This is especially apparent for single character tokens.

  • Extend the highlight/hover range for field tokens to include the filter separate (:)

  • Show token info above the line by default to prevent interference with the autocompletion popover

Before/after autocompletion interference:

https://user-images.githubusercontent.com/179026/178967409-c17e181f-8b94-48c3-b8bd-197facfe72c5.mp4

Before/after filter highlight and single character tooltips:

https://user-images.githubusercontent.com/179026/178967488-c6690e48-d692-4d4a-8d60-6e7b2ed8bc99.mp4

Test plan

Enter query, e.g. file:test/.* and hover over the individual tokens.

App preview:

Check out the client app preview documentation to learn more.

Merge request reports

Loading