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

Search delay #1677

Draft
wants to merge 14 commits into
base: dev
Choose a base branch
from
Draft

Search delay #1677

wants to merge 14 commits into from

Conversation

taooceros
Copy link
Member

@taooceros taooceros commented Dec 18, 2022

For What?

  • For plug-ins with loading until results appear, such as translation or youtube (receving data from web). Each typing tries to load the results, causing a delay in typing.
  • e.g : tr h(stuck)e(stuck)l(stuck)l(stuck)o(stuck)...
  • To address this issue, this pr provides a setting to load the results after a certain period of time after typing stops rather than every typing.

What's the PR

image

  • Default Delay setting is possible in Flow. The default is 50 ms.
  • 50ms / 100ms / 150ms.
  • The plug-in creator can set the delay. In this case, the delay value by the plug-in takes precedence.
  • Resolve Add input box input anti-shake function #1322
  • If there is no delay specified by the plug-in, use the default value for flow.
  • Each delay operates on a per-plug-in basis.

Test Cases

  • When entering a query, the result window must be displayed at the appropriate speed for each delay.
  • If delay is defined in the plug-in, the plug-in delay is applied.

References

image
image
image

@onesounds onesounds marked this pull request as draft December 18, 2022 06:57
@onesounds onesounds self-assigned this Dec 18, 2022
@onesounds onesounds added the enhancement New feature or request label Dec 18, 2022
@onesounds onesounds marked this pull request as ready for review December 19, 2022 02:50
try
{
// Check the code, WhenAll will translate all type of IEnumerable or Collection to Array, so make an array at first
await Task.WhenAll(tasks);
await Parallel.ForEachAsync(plugins, currentCancellationToken,
Copy link
Member Author

Choose a reason for hiding this comment

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

This is for a better concurrency so we don't really need to do a context switch

@jjw24
Copy link
Member

jjw24 commented Dec 27, 2022

If delay is defined in the plug-in, the plug-in delay is applied.

Is this tested?

@jjw24 jjw24 modified the milestones: 1.11.0, Future Dec 27, 2022
@taooceros
Copy link
Member Author

If delay is defined in the plug-in, the plug-in delay is applied.

Is this tested?

I test it

# Conflicts:
#	Flow.Launcher/Languages/en.xaml
#	Flow.Launcher/Languages/ko.xaml
@jjw24 jjw24 added the review in progress Indicates that a review is in progress for this PR label Jan 1, 2023
@jjw24
Copy link
Member

jjw24 commented Jan 16, 2023

I am running into issue with this sort of result on the default delay:

image

Is it possible to have no delay?

@jjw24
Copy link
Member

jjw24 commented Jan 16, 2023

Another one I am finding is using the default delay if you type dddddddddddddddddddddddddddd then delete it one by one, the trailing query suggestion text makes it feel really slow, like there is a bit of lag almost. On a prd release the trailing query suggestion text is removed a lot faster.

@jjw24
Copy link
Member

jjw24 commented Jan 16, 2023

Correct me if I am wrong PRD has no query delay at all right?

@taooceros
Copy link
Member Author

taooceros commented Jan 17, 2023

I am running into issue with this sort of result on the default delay:

image

Is it possible to have no delay?

I don't think this makes sense, because the current query model also have 45ms delay for global query. How fast do you type?

@github-actions

This comment has been minimized.

@taooceros
Copy link
Member Author

Another one I am finding is using the default delay if you type dddddddddddddddddddddddddddd then delete it one by one, the trailing query suggestion text makes it feel really slow, like there is a bit of lag almost. On a prd release the trailing query suggestion text is removed a lot faster.

could you try run without debugger? the debugger makes thing much slower

await Task.Delay(pair.Metadata.SearchDelay
?? (string.IsNullOrEmpty(query.ActionKeyword)
? Settings.GlobalSearchDelay
: 0));
Copy link
Contributor

@VictoriousRaptor VictoriousRaptor Jan 17, 2023

Choose a reason for hiding this comment

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

Is it possible for non global plugins to notify that should use user specified delay value?

Copy link
Contributor

Choose a reason for hiding this comment

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

And why use delay only for global searches?

@github-actions

This comment has been minimized.

@VictoriousRaptor
Copy link
Contributor

Should we delay when typing the FIRST character?

@github-actions
Copy link

github-actions bot commented Jan 17, 2023

@check-spelling-bot Report

🔴 Please review

See the 📂 files view or the 📜action log for details.

Unrecognized words (22)
ASponsor
combobox
embeded
happlebao
installbtn
IPublic
mainwindow
metadatas
Mvvm
otalcmd
overriden
Preinstalled
receving
Reloadable
scm
settingwindow
Txb
uninstallbtn
updatebtn
viewupdate
Wpf
ZIndex
To accept ✔️ these unrecognized words as correct and remove the previously acknowledged and now absent words, run the following commands

... in a clone of the [email protected]:Flow-Launcher/Flow.Launcher.git repository
on the search_delay branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/main/apply.pl' |
perl - 'https://github.com/Flow-Launcher/Flow.Launcher/actions/runs/3938000201/attempts/1'

To have the bot do this for you, reply quoting the following line:
@check-spelling-bot apply updates.

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

@jjw24
Copy link
Member

jjw24 commented Jan 17, 2023

I am running into issue with this sort of result on the default delay:
image
Is it possible to have no delay?

I don't think this makes sense, because the current query model also have 45ms delay for global query. How fast do you type?

I dont type that fast, but this is done with my normal speed.

@jjw24
Copy link
Member

jjw24 commented Jan 17, 2023

Another one I am finding is using the default delay if you type dddddddddddddddddddddddddddd then delete it one by one, the trailing query suggestion text makes it feel really slow, like there is a bit of lag almost. On a prd release the trailing query suggestion text is removed a lot faster.

could you try run without debugger? the debugger makes thing much slower

This was tested not with debugger but an actual build, are you able to see what I am describing?

@taooceros
Copy link
Member Author

you mean this?
image

@taooceros
Copy link
Member Author

What about removing the autosuggestion whenever query change?

@jjw24 jjw24 removed the review in progress Indicates that a review is in progress for this PR label Mar 2, 2023
@jjw24 jjw24 added the review in progress Indicates that a review is in progress for this PR label Jun 23, 2023
@jjw24 jjw24 removed the review in progress Indicates that a review is in progress for this PR label Aug 8, 2023
@taooceros
Copy link
Member Author

Should we delay when typing the FIRST character?

huh maybe not

@jjw24 jjw24 marked this pull request as draft June 22, 2024 02:06
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
Status: Todo (High Priority)
Development

Successfully merging this pull request may close these issues.

4 participants