Skip to content

Add autoExpandLevel flag to EntryModel #130

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

Merged

Conversation

williamsyang-work
Copy link
Contributor

@williamsyang-work williamsyang-work commented Jun 11, 2025

What it does

Adds autoExpandLevel flag to EntryModel.

Relates to:
eclipse-tracecompass/org.eclipse.tracecompass#277
eclipse-tracecompass-incubator/org.eclipse.tracecompass.incubator#196

How to test

Make sure this works with latest tracecompass-server.

Follow-ups

The functionality for the flag, the ability for the front-end to correctly expand / collapse tree nodes based on the value of autoExpandLevel, needs to be implemented.

Review checklist

  • [ x] As an author, I have thoroughly tested my changes and carefully followed the instructions in this template


/**
* Indicates till which level the tree should be expanded. If expandLevel is
* missing or has value of -1 it would meanthat all the levels are expanded (default behaviour).
Copy link
Contributor

Choose a reason for hiding this comment

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

missing space: "meanthat"

@@ -68,6 +69,7 @@ export interface EntryHeader {
export function EntryModel<T extends Entry>(normalizer: Normalizer<T>): Normalizer<EntryModel<T>> {
return createNormalizer<EntryModel<any>>({
entries: array(normalizer),
expandLevel: assertNumber, // TODO - does this work correctly?
Copy link
Contributor

Choose a reason for hiding this comment

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

the name of the field is now autoExpandLevel. See the referenced Trace Compass/Incubator PR. See also the TSP update for that: eclipse-cdt-cloud/trace-server-protocol#120

@@ -84,4 +86,12 @@ export interface EntryModel<T extends Entry> {
* Array of entry
*/
entries: T[];

Copy link
Contributor

Choose a reason for hiding this comment

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

The TSP update has the exact meaning of the field and you can change the description accordingly.

* missing or has value of -1 it would meanthat all the levels are expanded (default behaviour).
* If the expandLevel is set to 1 for example, it will expand till the first nodes under the root
*/
expandLevel: number;
Copy link
Contributor

Choose a reason for hiding this comment

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

autoExpandLevel

@williamsyang-work williamsyang-work changed the title Add 'Expand Level' flag to EntryModel Add autoExpandLevel flag to EntryModel Jun 12, 2025
Copy link
Contributor

@bhufmann bhufmann left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution. I put a couple comments.

@@ -84,4 +86,16 @@ export interface EntryModel<T extends Entry> {
* Array of entry
*/
entries: T[];

/**
* Sets the auto-expand level to be used for the input of the tree.
Copy link
Contributor

Choose a reason for hiding this comment

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

Change to:
Optional auto-expand level to be used for the input of the tree. If omitted value -1 is assumed.

* - 1 → Top-level elements are expanded, but not their children
* - 2 → Top-level elements and their children are expanded, but not grand-children
*/
autoExpandLevel: number;
Copy link
Contributor

Choose a reason for hiding this comment

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

the autoExpandLevel is optional. Change to

   autoExpandLevel?: number;

I'll update the description in the TSP to make it more obvious.

@@ -84,4 +86,10 @@ export interface EntryModel<T extends Entry> {
* Array of entry
*/
entries: T[];

/**
* Optional auto-expand level to be used for the input of the tree. If omitted value -1 is assumed.
Copy link
Contributor

Choose a reason for hiding this comment

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

In the previous version of the PR you described the values and meaning. Please bring them back below this line.

Sets the auto-expand level to be used for the input of the tree.

Signed-off-by: Will Yang <william.yang@ericsson.com>
Copy link
Contributor

@bhufmann bhufmann left a comment

Choose a reason for hiding this comment

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

It looks good to me. Thanks for the contribution.

Copy link
Contributor

@marcdumais-work marcdumais-work left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @williamsyang-work !

@marcdumais-work
Copy link
Contributor

The CI failures seem related to current internet outages, that include the npm registry.

williamsyang-work added a commit to williamsyang-work/theia-trace-extension that referenced this pull request Jun 12, 2025
Add support for the autoExpandLevel flag to automatically collapse tree
nodes beyond the specified depth level. When autoExpandLevel is set, nodes
at depths greater than the specified level are automatically collapsed in
the tree view.

Related to eclipse-cdt-cloud/tsp-typescript-client#130

Signed-off-by: Will Yang <william.yang@ericsson.com>
williamsyang-work added a commit to williamsyang-work/theia-trace-extension that referenced this pull request Jun 12, 2025
Add support for the autoExpandLevel flag to automatically collapse tree
nodes beyond the specified depth level. When autoExpandLevel is set, nodes
at depths greater than the specified level are automatically collapsed in
the tree view.

Related to eclipse-cdt-cloud/tsp-typescript-client#130

Signed-off-by: Will Yang <william.yang@ericsson.com>
williamsyang-work added a commit to williamsyang-work/theia-trace-extension that referenced this pull request Jun 13, 2025
Add support for the autoExpandLevel flag to automatically collapse tree
nodes beyond the specified depth level. When autoExpandLevel is set, nodes
at depths greater than the specified level are automatically collapsed in
the tree view.

Related to eclipse-cdt-cloud/tsp-typescript-client#130

Signed-off-by: Will Yang <william.yang@ericsson.com>
@marcdumais-work marcdumais-work merged commit 31e7056 into eclipse-cdt-cloud:master Jun 13, 2025
14 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants