Skip to content

Enhancement: Support Untrimmed query for Flow Launcher's Query #2605

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

Open
AminSallah opened this issue Mar 8, 2024 · 12 comments · May be fixed by #3502
Open

Enhancement: Support Untrimmed query for Flow Launcher's Query #2605

AminSallah opened this issue Mar 8, 2024 · 12 comments · May be fixed by #3502
Labels
enhancement New feature or request keep-fresh

Comments

@AminSallah
Copy link
Contributor

I noticed that Flow launcher consistently provides a trimmed query when using query.Search or even query.RawQuery, returning a value without white spaces. This seems unusual to me compared to other launcher apps. Therefore, my question is: is this intentional for some specific reason, or is it something that can be fixed?

@jjw24
Copy link
Member

jjw24 commented Mar 8, 2024

query.Search should return query without any action keyword, and raw should return with action keyword if exists. This is intentional. Sorry not 100% clear on what you are asking, are you asking why they don't include a space at the end?

@AminSallah
Copy link
Contributor Author

yeah they don't include white spaces

@AminSallah
Copy link
Contributor Author

Is it possible to know if query contains spaces at the end?

@jjw24
Copy link
Member

jjw24 commented Mar 8, 2024

Unfortunately no, we never came across a scenario where whitespaces were needed to be kept for a plugin. What's your use case?

@AminSallah
Copy link
Contributor Author

I see it before in some alfred workspaces. it's used frequently if user types space show available commands if not use default one.
In my case, with the Notion plugin I wanna implement a similar scenario. i split query by char ! then i wanna check if what after ! mark is whitespace show available properties names else use first index and start recording the page name. this gonna be more faster.

The current behavior after split by exclamation mark show property names after user select one show pages. I prefer to skip step one if no spaces, i hope if could explain my point.

spaces

@jjw24
Copy link
Member

jjw24 commented Mar 8, 2024

Yeah that makes sense.

I thought both search and rawquery only trim the whitespaces at the start of the query string?

@AminSallah
Copy link
Contributor Author

I thought this too, technically turns out it's trimming the end as well, i tried Search and RawQuery and SearchTerm also and they all return trimmed string. and i couldn't figure why it is trimmed.

@Garulf
Copy link
Member

Garulf commented Mar 8, 2024

I thought I fixed this in a PR sometime ago. 🤔

Edit: #1121

@AminSallah
Copy link
Contributor Author

Please double check it, I used this plugin to check whether is contain spaces or not.
Release link

https://github.com/AminSallah/Flow.Launcher.Plugin.whitespaces/releases/download/v1.0.0/Flow.Launcher.Plugin.whitespaces.zip

Action keyword s

@jjw24 jjw24 added the bug Something isn't working label Mar 9, 2024
Copy link

github-actions bot commented May 9, 2024

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 60 days.\n\nAlternatively this issue can be kept open by adding one of the following labels:\nkeep-fresh

@cibere
Copy link
Contributor

cibere commented Jan 22, 2025

Just wanted to add:

This breaks the UpdateResults method with V2 plugins. Since the raw query is stripped, if the original query has a space at the end, the plugin is unable to update the results as the raw query the plugin has doesn't match the raw query that the user has. Only workaround I've found so far is changing the query then sending the updated results, but that can be inconsistent.

@Jack251970
Copy link
Member

I wonder if this can help. In #3502, I added Input property in Query so that developers can get raw user input without trimming whitespaces.

@Jack251970 Jack251970 changed the title Flow Launcher's Trimmed Query Enhancement: Support Untrimmed query for Flow Launcher's Query May 12, 2025
@Jack251970 Jack251970 added enhancement New feature or request and removed bug Something isn't working labels May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request keep-fresh
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants