Hi,
I’ve noticed that the default sorting alphabetically by displayed string in some tables could be insufficient. For example:
![](pngHPoWeDLA8h.png)
As the usage time has been formatted to be more humanly readable than only displaying in nanoseconds, the sorting became nonsensical. I would like to add the capability to sort not using the displayed string, but
hidden value (for example, time in nanoseconds only).
[Bernd] Right now the TSP only defines string for each label. So, the back-end can provided pre-formatted label text. This is because the back-end has the domain specific knowledge on about
the data and can format it accordingly. However, this is an issue for sorting as you noticed. Sorting a column by string which, for example, represents a number gives unwanted sorting. What we have implemented in the front-end for sorting, is to convert common,
known formatted strings to a number and perform the sorting on the converted number. For example, formatted durations (e.g. 10 ns, 100 ys, 1 s) is supported.
Looking at your duration column, I noticed that the formatting is not supported (1 ms133 us). So, sorting uses string comparison. See method parseValue()
in https://github.com/eclipse-cdt-cloud/theia-trace-extension/blob/master/packages/react-components/src/components/utils/filter-tree/sort.tsx.
Maybe as first step update this method to support the new formatting.
Alternatively, the TSP could be augmented to add the possibility to describe the columns data type and pass the raw data and the front-end would have to
take care of the formatting. This would be a nice addition, but longer-term solution.
Also, I’ve noticed the need to communicate preferences/settings from the client to the server (for example, a Theia setting to switch between grouping by processes or by threads, and the server needs to be aware
of this setting to set up state provider accordingly).
[Bernd] The data provider would need to know about the different groupings and based either query parameters to fetchTree() or configuration/settings return
the tree model. Right now, there is such no API defined in the TSP. The data provider might need to advertise to the front-end what extra query parameters it supports. We started an ADR about a similar topic where a data provider advertises to the client additional
query paremters and actions. I think your use case could be covered as well in this ADR. Please have look and I invite you to participate in the design discussion/review. We are still in an early stage of the design:
https://github.com/eclipse-cdt-cloud/theia-trace-extension/pull/852.
The following PR is a proof-of-concept that apply this new API. This PR helps to understand what we'd like to achieve:
https://github.com/eclipse-cdt-cloud/theia-trace-extension/pull/882
Please let me know if you have any question, request, concern or advice about these features that I hope to contribute.
[Bernd] Try to modify the parseValue() of the sort.tsx file and see if you add support for your label format.
Regards,
Alex
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any
use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction
of this transmission by unintended recipients is not authorized and may be unlawful.