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

Up Arrow key cycles through Query history #852

Closed
wants to merge 30 commits into from

Conversation

Garulf
Copy link
Member

@Garulf Garulf commented Dec 1, 2021

Similar to how arrow keys work in most shells this PR allows the user to press Up to cycle through their last used queries.

Todo:

  • Cycle through entire history if user hasn't moved selection
  • Fix not being able to move selection in History view
  • Add custom hotkey support
2021-12-01.13-12-27.mp4

@Garulf Garulf added the enhancement New feature or request label Dec 1, 2021
@Garulf Garulf self-assigned this Dec 1, 2021
@onesounds onesounds added this to Work In Progress in WIP Dec 1, 2021
@onesounds
Copy link
Contributor

onesounds commented Dec 2, 2021

  • The same problem exists in the context menu.
  • I think there should be a shortcut to erasing it. (ctrl+u?)

And do we really need this function? In my experience, the command line selects a re-input item by looking at the screen entered by itself. in this function, we have to guess and turn the record around. So there is a history list. From a modern command point of view, Using the command-like method is more of a modern commander, backstep to the past. If were me, I would simply add hotley (alt+up?) in history menu. or add setting history in first screen.

@jjw24
Copy link
Member

jjw24 commented Dec 4, 2021

i cant seem to cycle past the first history that showed, basically if i keep pressing up after the first history it just cycle through the results from it.

also need to check and not trigger when in context menu

is this pr still draft?

@Garulf Garulf marked this pull request as draft December 4, 2021 18:56
@Garulf
Copy link
Member Author

Garulf commented Dec 4, 2021

i cant seem to cycle past the first history that showed, basically if i keep pressing up after the first history it just cycle through the results from it.

also need to check and not trigger when in context menu

is this pr still draft?

Yeah it's still just a proof-of-concept...

@Garulf Garulf moved this from Work In Progress to Planning & Research in WIP Dec 4, 2021
@Garulf Garulf marked this pull request as ready for review December 11, 2021 20:33
@Garulf Garulf moved this from Planning & Research to Ready for merge/review in WIP Dec 11, 2021
@Garulf Garulf added this to the 1.9.1 milestone Dec 11, 2021
@Garulf
Copy link
Member Author

Garulf commented Dec 11, 2021

output.mp4

Working

@onesounds onesounds moved this from Ready for merge/review to Work In Progress in WIP Dec 12, 2021
@Garulf Garulf marked this pull request as draft December 12, 2021 08:51
@Garulf
Copy link
Member Author

Garulf commented Dec 22, 2021

Currently Alt+Up & Alt+Down Only trigger if defined in MainWindow.xaml and will not trigger from MainWindow.xaml.cs. Custom modifiers "work" but it's not the ideal solution to define them in both. Currently looking for a solution.

@Garulf
Copy link
Member Author

Garulf commented Dec 22, 2021

i am getting this error. repro:

  1. only one history result present
  2. up arrow to insert the query
  3. alt + down arrow to forward search

image

Fixed: c6d5525

@Garulf Garulf modified the milestones: 1.9.1, 1.10.0 Dec 22, 2021
@jjw24
Copy link
Member

jjw24 commented Jan 14, 2022

@Garulf this is ready for review again? (Merge Dev if so)

@Garulf
Copy link
Member Author

Garulf commented Jan 14, 2022

Currently Alt+Up & Alt+Down Only trigger if defined in MainWindow.xaml and will not trigger from MainWindow.xaml.cs. Custom modifiers "work" but it's not the ideal solution to define them in both. Currently looking for a solution.

Could not find a good method to set Alt & Ctrl modifiers. Should I hard code it to Alt or keep as is?

Thoughts @Flow-Launcher/team ?

@jjw24
Copy link
Member

jjw24 commented Jan 18, 2022

The modifier hotkey can set Alt, does that part of the code offer any help?

image

@Garulf
Copy link
Member Author

Garulf commented Jan 18, 2022

The modifier hotkey can set Alt, does that part of the code offer any help?

image

The problem is the current implementation requires the hotkey be coded in two separate files. Doesn't feel like a great fix.

@Garulf
Copy link
Member Author

Garulf commented Jan 25, 2022

Removed from GUI for now

@Garulf Garulf marked this pull request as ready for review January 25, 2022 07:03
@Garulf Garulf enabled auto-merge January 25, 2022 07:03
@Garulf Garulf requested a review from jjw24 January 25, 2022 07:04
@Garulf Garulf moved this from Work In Progress to Ready for merge/review in WIP Jan 25, 2022
@jjw24 jjw24 added the review in progress Indicates that a review is in progress for this PR label Jan 31, 2022
@jjw24 jjw24 removed the review in progress Indicates that a review is in progress for this PR label Jul 17, 2022
@jjw24 jjw24 modified the milestones: 1.10.0, Future Dec 12, 2022
@taooceros
Copy link
Member

close in favor of #2696

@taooceros taooceros closed this May 17, 2024
auto-merge was automatically disabled May 17, 2024 01:21

Pull request was closed

@Garulf Garulf deleted the Up-arrow-cycles-history branch May 17, 2024 01:30
@jjw24 jjw24 removed this from the Future milestone May 17, 2024
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
WIP
  
Ready for merge/review
Status: Ready for merge/review
Development

Successfully merging this pull request may close these issues.

None yet

4 participants