Skip to content

Conversation

@Garulf
Copy link
Member

@Garulf Garulf commented Dec 1, 2021

Pressing Tab will replace the current Query with the selected result's Title.

2021-12-03.10-37-15.mp4

Todo:

  • Cycle to next result if query matches result (Feels weird and unnatural and doesn't work very well)
  • Allow plugins to change inserted text
  • Shift+Tab to insert result subtitle

@Garulf Garulf added the enhancement New feature or request label Dec 1, 2021
@onesounds
Copy link
Contributor

onesounds commented Dec 2, 2021

  • I think alt+right arrow is better. Rather than using the tab as an automatic completion, it seems more appropriate to give it to a one-handed manipulator. It is used more often.
  • The cursor must move to the end when pressed key.

@Garulf
Copy link
Member Author

Garulf commented Dec 2, 2021

  • I think alt+right arrow is better. Rather than using the tab as an automatic completion, it seems more appropriate to give it to a one-handed manipulator. It is used more often.
  • The cursor must move to the end when pressed key.

Maybe we can add setting to allow the user to change hotkeys? I feel Tab is most natural as default however.

@onesounds
Copy link
Contributor

  • I think alt+right arrow is better. Rather than using the tab as an automatic completion, it seems more appropriate to give it to a one-handed manipulator. It is used more often.
  • The cursor must move to the end when pressed key.

Maybe we can add setting to allow the user to change hotkeys? I feel Tab is most natural as default however.

yeah, I think we should. However, it seems a little strange to provide only this function with a key change. For now, it would be good to proceed with tab, and work on that part in another pr later.

@Garulf
Copy link
Member Author

Garulf commented Dec 3, 2021

  • The cursor must move to the end when pressed key.

Text cursor should be moving when Tab is used. Is it not working on your end?

@Garulf
Copy link
Member Author

Garulf commented Dec 3, 2021

Replacing Query with QuerySuggestionBox.Text, using result.Title if its unavailable for some reason.

Above all else we use the result.SuggestionText field

Custom suggestion field:
https://user-images.githubusercontent.com/535299/144630236-62f19803-49a0-4fa2-b0da-217d28b71024.mp4

/// </summary>
public string ActionKeywordAssigned { get; set; }

public string SuggestionText { get; set; } = string.Empty;
Copy link
Member

Choose a reason for hiding this comment

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

do we want to change this to 'AutoCompleteText' to be more specific? I didnt get what it is for on first glance until i read the code.

This is good btw, it will allow plugins to do their own autocomplete, as @onesounds have indicated, if we change how Explorer display Title and Subtitle result, this will allow Explorer to put its own autocompelete text

string _suggestion = queryText + selectedResultPossibleSuggestion.Substring(queryText.Length);
if (String.IsNullOrEmpty(selectedResult.SuggestionText))
{
selectedItem.Result.SuggestionText = _suggestion;
Copy link
Member

Choose a reason for hiding this comment

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

@taooceros will this modifying result cause results comparison issue afterwards?

Copy link
Member

@jjw24 jjw24 Dec 5, 2021

Choose a reason for hiding this comment

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

Instead of using Result's initialised field to hold the new constructed suggestion string, use ResultViewModel instead. As a general rule we dont want to modify an object after it is constructed, otherwise it's hard to reason what state/information the object has.

Copy link
Member

@jjw24 jjw24 left a comment

Choose a reason for hiding this comment

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

lgtm, just some small tweaks

Copy link
Member

@jjw24 jjw24 left a comment

Choose a reason for hiding this comment

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

@Garulf ready to go, just made some minor tweaks, please test it, and if it's good then merge it in.

@jjw24 jjw24 added this to the 1.9.0 milestone Dec 5, 2021
@Garulf
Copy link
Member Author

Garulf commented Dec 5, 2021

Looks good to me. 👍

@Garulf Garulf merged commit 06a76f5 into Flow-Launcher:dev Dec 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants