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

Feature: Also allow filtering by URL not just by request name #2808

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

N-Ziermann
Copy link
Contributor

@N-Ziermann N-Ziermann commented Aug 11, 2024

Description

Closes #2806.
It enables users to not only filter their request by name, but also by URL.

Screenshot 2024-08-11 at 15 57 22

I also added unit tests for the function I edited and therefore needed to add a custom jest-config to the bruno-app package that uses the compilerOptions.paths property from the jsconfig.

This was necessary because jest doesn't automatically read that property from the jsconfig file and therefore couldn't understand the utils/common imports from the collections/index file used in search.js.

Contribution Checklist:

  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

@N-Ziermann N-Ziermann changed the title Feature/filter by url Feature: Also allow filtering by URL not just by request name Aug 11, 2024
Copy link

@Gadiffet Gadiffet left a comment

Choose a reason for hiding this comment

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

Sound Great

@helloanoop
Copy link
Contributor

Hey @N-Ziermann Thanks for working on this.

One issue with this approach is that the search results displayed do not indicate the context for why they were matched. This becomes problematic when there are many collections loaded with a variety of requests.

@N-Ziermann
Copy link
Contributor Author

Hey @helloanoop Thanks for your reply.

I understand your concern.
I'd suggest we highlight the matching part of the request name using <mark> tags if the name matches
and maybe turn the outline of the request path yellow (same yellow as when searching for something in the browser) if the path matches (to prevent issues with the syntax highlighting).

What do you think?

@tlaloc911
Copy link
Contributor

There is another unmerges PR related to filtering #1230 , to allow folder name search, and it added a button to alternate between regular and by folder search, you culd add something similar

@N-Ziermann
Copy link
Contributor Author

N-Ziermann commented Aug 19, 2024

Thanks for pointing that out @tlaloc911
I'm afraid a toggle between different filters might not scale well. Having more than 2 options (as 2 are already described in the PR you just linked) would need a lot of space and might make it even more confusing at some point.

What I could see as an option is a filter (kebab menu) to control which filters you want to have active combined with the indicator I described previously.
This would allow users to completely turn off filters they dont like whilst still seeing which attribute caused the filtered value to be visible

@N-Ziermann
Copy link
Contributor Author

bruno mockup

Here is a little illustration of what I mean. It's of course not to scale and the colors aren't ideal, but it should get the point across.
If this is something that would improve this feature for you @helloanoop then I would love to implement it (with proper scaling and better looking colors of course 😉 )

@helloanoop
Copy link
Contributor

@tlaloc911 @N-Ziermann I am thinking of a collection level search that not just filters by url, but much more like search inside body, scripts, tests etc

Let me know your thoughts.

Here is a draft PR I have on this - #3823

Demo

Screen.Recording.2025-01-17.at.3.28.38.AM.mov

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

Successfully merging this pull request may close these issues.

search api
5 participants