zui icon indicating copy to clipboard operation
zui copied to clipboard

Bad clickable sorts with nested fields

Open philrz opened this issue 2 years ago • 1 comments

Repro is with Brim commit 124d658.

As shown in the attached video, while clicking column headers on a top-level field still has the expected effect of appending sort or sort -r on the active query, if I attempt the same on a nested field like id.orig_h it seems like nothing happens. Also, if I right-click and select one of the sort options, the appended field name lacks the leading id and hence the data does not get sorted. These might be two different bugs but I'm starting them both in the same issue in the event they share a root cause or can otherwise be attacked together.

https://user-images.githubusercontent.com/5934157/190688070-85ebad51-9ebf-4aa2-978e-48ed7dad9c72.mp4

philrz avatar Sep 16 '22 16:09 philrz

Makes sense. I'll take this to account in my table rewrite.

jameskerr avatar Sep 21 '22 17:09 jameskerr

This one is on track to be addressed by the changes in #2626.

The attached video shows how things are looking now at commit 4014451 of the branch from #2626. Now after invoking the new Expand Headers option, clicking the sort options in the header appends the correct Zed in the editor and the contents are sorted ascending/descending as expected.

https://user-images.githubusercontent.com/5934157/210013049-25905ea5-5d85-43a9-804d-47827b504b20.mp4

Other ways to invoke sort may be added as the PR progresses so I'll do a final verification when the changes merge, but looks 👍 right now.

philrz avatar Dec 29 '22 21:12 philrz

Verified in Brim commit 499a2c9.

The attached video shows the multiple ways of now invoking sort by clicking directly on the value of a nested field in its expanded/collapsed state as well as by clicking in the column header. In all cases the syntactically correct Zed was appended and the sort was successful.

https://user-images.githubusercontent.com/5934157/214929070-b409d334-4ace-43cf-8656-0e480772d4b8.mp4

Thanks @jameskerr!

philrz avatar Jan 26 '23 19:01 philrz