-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Filter requests by folder, URI, method, query string #797
Filter requests by folder, URI, method, query string #797
Conversation
Previously only Request Name was searched for in Quick Switch window. This adds support for searching Request URL and Method as well. A fuzzyMatchAll function has been added to be able to search different fields in any order, space delimited.
💖 Thanks for opening this pull request! 💖 To help make this a smooth process, please be sure you have first read the |
Haven't forgot about this! Should be able to get to it next week 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @axs221! Only a few minor comments.
* Appends path of ancestor groups, delimited by forward slashes | ||
* E.g. Folder1/Folder2/Folder3 | ||
*/ | ||
_groupOf (request) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small thing. This variable would be more accurately described as child
or requestOrRequestGroup
. Can you rename to be more clear?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, I'll go with requestOrRequestGroup, verbose but clear as what can be expected
request.url, | ||
request.method, | ||
this._groupOf(request), | ||
...(request.parameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be more intuitive to join the parameters to the URL? Thoughts?
See https://github.com/getinsomnia/insomnia/blob/cd1ff32b4d098979cc61de6837475f648bda82e3/plugins/insomnia-plugin-request/index.js#L108-L109 for an example of URL building.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that makes sense, I will change it as suggested
Responding to your comments in the PR description:
I agree, it's probably best to show as much as possible. Perhaps we could hide most things by default and only show them if they were part of the match?
I agree that the fuzzy search right now is probably too loose, specifically for the sidebar filter. For the request switcher, the current solution would probably be fine if results were sorted by best match like in Atom/Sublime/etc.
Oh, that's interesting. Like GitHub does with issues. I think labels are a great idea either way because we could add things like status:200, auth:Basic, content-type:json, etc. Thanks @axs221! |
caa89fc
to
58e00cc
Compare
@gschier Okay I updated the branch with the minor feedback from the PR, minus the items mentioned in Is what is there so far worth merging, and then doing a second PR for the rest? Otherwise I should be able to get to the additional items in the next week or so. Thank you! |
Yep, it looks great! |
I was busy for the past couple weeks traveling but will now be more available and responsive to help out if needed 😄 |
@gschier Okay thanks! Hope you had a good time traveling; I've been busy too, no worries. I'll put some thought into the UI changes soon and we can discuss. |
It was amazing, thanks for asking 😃 Sounds good! Probably best to create a new issue for discussion of the next phase 👍 |
@axs221 just so you're aware, I'm disabling the new fuzzy matching for URL/parameters until we have some UI to make it more clear what's going on. |
* Quick Switch matching for Request URL and Method Previously only Request Name was searched for in Quick Switch window. This adds support for searching Request URL and Method as well. A fuzzyMatchAll function has been added to be able to search different fields in any order, space delimited. * Include request parameters in searchable fields * Allow searching requests by folder paths * More descriptive placeholder for Quick Switch modal search input * Update sidebar filter to match Quick Switch, allowing URL and Query String matching * More descriptive placeholder for sidebar search * Unit tests for fuzzyMatch and fuzzyMatchAll * More unit tests for fuzzyMatch and fuzzyMatchAll * minor refactorings
Relevant issues?
#739 - This fulfills at least some part of the issue. We may want to update the UI to display either what parts of text are matched, and/or show missing fields (e.g. add URL to the Quick Switch modal).
What does this PR do?
What is left to do or discuss on the relevant issues?
Example screenshots, gifs, or videos?
What code can others reuse?
Testing Steps