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

Add optional initial_query to suggester #1139

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mnaoumov
Copy link

@mnaoumov mnaoumov commented Jul 8, 2023

Fixes #555

@Zachatoo Zachatoo self-requested a review September 29, 2023 01:07
@Zachatoo
Copy link
Collaborator

Could you also update the docs as part of this PR?

@AB1908
Copy link
Collaborator

AB1908 commented Sep 29, 2023

Can someone remind me how this is different from placeholder? Also, for conformity, should we rename it to default_value?

@tektrip-biggles
Copy link

tektrip-biggles commented May 29, 2024

Can someone remind me how this is different from placeholder? Also, for conformity, should we rename it to default_value?

My understanding is that placeholder simply appears in the prompt box as an aide memoire, whereas default_value would be a valid option from the list presented to the user. E.g. I want to be prompted for task priority so I might use:

<% tp.system.suggester(
  (item) => item, 
  ["1: Highest", "2: High", "3: Medium", "4: Low", "6: Lowest"], 
  false, 
  "Priority",
   5, 
  "3: Medium") 
%>

This way if I press enter as soon as the prompt appears, I'll select "3: Medium" as priority instead of "1: Highest" as currently. This saves two keypresses in the average case and four keypresses in the worst case, which can add up quickly when, say, adding a ton of task notes.

Don't suppose there's any chance this will make its way into main any time soon btw?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default value for suggester
4 participants