Skip to content

Implement preview on highlighting quickpick in quick search #191259

Closed

Description

@andreamah

It would be nice to show a preview editor that changes in the background based on which quick search item you have open. Furthermore, it'd be nice to highlight the result like we do in the symbol editor.

Image

This might be sort of non-trivial to tackle, as existing pickers that change the background editor only deal with a single open editor. In our case, we would need to implement a preview editor for this.

Activity

  1. added
    feature-request
    search
    on Aug 24, 2023
  2. bpasero commented on Jan 3, 2024

    @bpasero
    Contributor

    Andrea Mah (@andreamah) I think this is a duplicate of #8939

    I think one challenge here is that while you show preview editors in the background, you do not accumulate or alter the editor state (there is some discussion around this in the referenced issue). For example, I would expect:

    • that cancelling quick pick restores editor UI as it was
    • that the editors that open in the background do not appear in the editor history (e.g. "Go Back")

    We currently do not really have support for the latter.

    That said, I find it nice how ST shows preview editors in the background without even opening a tab. Notice how the editor opens without a tab associated to it:

    Recording 2024-01-03 at 15 50 43

    //cc TylerLeonhardt

  3. modified the milestones: On Deck, on Jan 3, 2024
  4. andreamah commented on Jan 3, 2024

    @andreamah
    ContributorAuthor

    Yeah, I can see how that's tricky. How I see this version is as follows (slightly summarized using #8939 (comment))

    1. If the editor with the match already exists as an open editor, use that editor to show the match. Moving to another match in another file or escape-ing the menu will restore that editor to its original line number.
    2. Otherwise, open up a preview editor at the match that can persist if the user presses enter.

    In this, we don't need to worry about which line to open preview editors at, since we have a specific match to highlight.

    As for the tab-less navigation, I agree that it looks nice, but does it align with anything else that we have? I think it would be slightly confusing to introduce new UX within this feature.

    Is this main concern regarding the Go Back/Forward functionality? And if so, can't we just fix this by adding an option to openEditor that determines whether the open editor should contribute to the editor history?

    As I see this right now, this whole feature involves extending AbstractEditorNavigationQuickAccessProvider to optionally support what I'm currently using from PickerQuickAccessProvider.

  5. bpasero commented on Jan 3, 2024

    @bpasero
    Contributor

    Just fyi, preview editors can be disabled (and many do so, including me). There is no way to enforce preview editors when they are disabled via settings currently.

    As for the non-tab editor, I agree its probably out of place with our UI, but wanted to share it nevertheless.

    As for the history, most of that is tracked in src/vs/workbench/services/history/browser/historyService.ts and is loosely coupled to the editor that opens.

    How would we decide to open an editor in the background? If I type quickly in quick pick, many different results might appear as first result - selected. If we were to open these as preview editors it might look quite hectic (it actually is hectic in ST as well).

  6. andreamah commented on Jan 3, 2024

    @andreamah
    ContributorAuthor

    Just fyi, preview editors can be disabled (and many do so, including me). There is no way to enforce preview editors when they are disabled via settings currently.

    Yeah, I think that things like the Replace Preview from search would just persist in that case also (but is a preview editor if the user allows it). I think that allowing the same behavior (preview editor if we can) is sufficient for this case also.

    How would we decide to open an editor in the background? If I type quickly in quick pick, many different results might appear as first result - selected. If we were to open these as preview editors it might look quite hectic (it actually is hectic in ST as well).

    I would think that proper debouncing would help. But I agree that we would often end up opening the first result and it would be annoying for that to persist. I guess there's no other way to have a 'temporary' editor other than with preview editors, right?

  7. TylerLeonhardt commented on Jan 6, 2024

    @TylerLeonhardt
    Member

    I do wonder If the tooltip UX would be a good option here.
    image

    This could show a smaller version of the file to the right of the quick pick.

    It could be debounced so it doesn't show up too fast.

    seems like it could be less jarring than changing the editor in the background

  8. andreamah commented on Jan 8, 2024

    @andreamah
    ContributorAuthor

    I'm not too sure whether people would want a tooltip since:

    1. Users might want more context on the file.
    2. Tooltips usually take ~1 second to show up, which might be sort of slow for some users who are quickly going through results.

    I think the tooltip is a good idea, though! Just maybe not for this particular use case?

  9. TylerLeonhardt commented on Jan 9, 2024

    @TylerLeonhardt
    Member

    Just to be clear, I'm specifically talking about quickpickitem tooltips which can be triggered instantly with ctrl+space and can have rich content in them.

    Think of it like the "more info" tooltip in the editor when you do ctrl+space of a completion item

  10. added 3 commits that reference this issue on Jan 12, 2024
    41b4581
    53c1e16
    79c82bc
  11. added
    unreleased
    insiders-released
    and removed
    unreleased
    on Jan 18, 2024
  12. added
    on-release-notes
    on Jan 26, 2024
  13. locked and limited conversation to collaborators on Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestinsiders-releasedon-release-noteson-testplansearch

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions