Insomnia: Sort request list in dropdown of "Response -> Body attribute" tag editor

Created on 19 Oct 2020  路  12Comments  路  Source: Kong/insomnia

When I want to insert a tag using "Response -> Body attribute", in the list of all requests in the dropdown, the requests are not sorted like in the sidebar.

I'd like the requests in the dropdown list to be sorted like in the sidebar.

I often sort the requests as to group them by functionality, and it's hard to navigate through 30+ requests to find the one I need.

Here's how the dropdown list looks like:
image

Here's the list from the sidebar. Notice that that the "/config" request appears in the first place, which is different from the list displayed in the dropdown.
image

feature request good first issue

All 12 comments

Hey guys. I'm looking at this but I got a little bit confused.
Are the sidebar items sorted?
I think the sidebar items sort is still under work #2594

The sidebar is sorted - and by sorted I mean ordered the way I rearranged the items - The way I want it to be ordered.

@antoine29 the sidebar _is_ sorted, but #2594 adds the ability to _automatically_ sort by a particular condition.

Regardless, manual sorting and automatic sorting will alter the metaSortKey property that exists on a request and a request-group. You should be able to use this metaSortKey to decide in which order to show the requests in the drop-down.

You shouldn't be blocked by #2594 in order to build this feature.

@antoine29, let me know if you're still looking into this issue. Since I'd worked on a similar one, I had a chance to investigate this one as well.

Hi, if this is still available I'd like to also give it a try. :)

@cobwebsonsale If you're up for it, I have a working code now implementing the default/automatic sorting based on the metaSortKey maybe you can add on to it with the manual sorting as well if we're pushing through with that. Let me know your thoughts on this!

@reginaalyssa I had a branch closing this issue as well lol. I was waiting on @antoine29 to know if it was okay for me to submit a PR for it. :D
For what it's worth, the automatic sorting being added in the other issue will not change things here as it uses the same metaSortKey field.

@cobwebsonsale Oh no sorry about that! I opened a PR here but I can close it if you already have another branch/PR open as well to prevent duplicates. I'm new to contributing to open source so I'm not entirely sure yet what I'm doing or if what I added was correct although it seemed to work on my local environment.

I'm afraid just a simple sort on metaSortKey would not be enough here. The requests within a request group have their own metaSortKey for their sorting within the group. You can checkout this commit on cobwebsonsale:feature/sort-requests-in-tag-editor for reference if you want.

Ohhh I think since it's already been built, I'll just close my PR. Thank you for the reference though, appreciate the guidance on this. :)

hey guys
Sorry for the delay, it's been a busy week for me
You're right @cobwebsonsale, a metaSort key sorting is not enough to get the same sort as is in the sideBar (due to the groupRequests case). But I think I got an approach to get it, I already opened a PR for your consideration :D

Thanks folks! @cobwebsonsale feel free to review @antoine29 PR and suggest any changes or ideas that you had in mind from your investigation. 馃

@reginaalyssa welcome! Feel free to browse issues with the label "Good First Issue", there are still lots of issues that don't have any conversation yet. Also, be sure to read the contribution guide!

Was this page helpful?
0 / 5 - 0 ratings