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

Handle opening of single trace files via dialog #1053

Closed
ngondalia opened this issue Mar 7, 2024 · 2 comments · Fixed by #1054
Closed

Handle opening of single trace files via dialog #1053

ngondalia opened this issue Mar 7, 2024 · 2 comments · Fixed by #1054

Comments

@ngondalia
Copy link
Contributor

For users that primarily need to analyze single file traces, the current implementation breaks the user flow. If the user wants to add another trace, they would have to switch to explorer view and open it from there. It would be ideal if they can open single traces files in the same manner as trace folders/groups.

There are few options that I can think of to solve this (open to any other suggestions):

  1. Have some sort of setting that can control the behaviour of "open trace" button at the extension level - At its core, it would control if the dialog opened will allow selecting files vs folders. I dont prefer this option as it doesnt address the issue for users that may have the need to analyze both trace folders and files.

  2. "Open Trace" button handler can invoke a quick pick before showing the dialog so that users can select if they want to open file vs folder. I also am not a fan of this as it just adds more buttons to click to open a trace.

  3. (My preference) We can render two buttons, "Open Trace Folder" and "Open Trace File". But additionally, ReactExplorerPlaceholderWidget can render one or both buttons based on its properties. The extension can control what button(s) get rendered based on a setting/api. I think this is a more complete solution as base extension and extending extensions can control the behaviour of what trace resource type will be handled. (Background: we only deal with single trace files and have no need for open trace folders, so i think it would be neat to not have a button for opening trace folder and only for opening trace file)

I would love get some feedback and/or suggestions!

@ngondalia
Copy link
Contributor Author

Demo for Option 3:

demo-open-trace-buttons.mp4

Note: this is hooked to vscode trace extension

For demo purposes, I have hooked it to a setting but I dont know if it needs to be a user facing configuration. There are multiple ways to control this behavior - external API / commands that set an internal state.

ngondalia added a commit to ngondalia/theia-trace-extension that referenced this issue Mar 8, 2024
This commit adds another button for opening trace files through a dialog.
Futhermore, the theia-trace-explorer-placeholder-widget can be configured
to render either one or both buttons (Open Trace folder, Open Trace File).

Fixes eclipse-cdt-cloud#1053

Signed-off-by: Neel Gondalia <ngondalia@blackberry.com>
ngondalia added a commit to ngondalia/theia-trace-extension that referenced this issue Mar 8, 2024
This commit adds another button for opening trace files through a dialog.
Futhermore, the theia-trace-explorer-placeholder-widget can be configured
to render either one or both buttons (Open Trace folder, Open Trace File).

Fixes eclipse-cdt-cloud#1053

Signed-off-by: Neel Gondalia <ngondalia@blackberry.com>
ngondalia added a commit to ngondalia/theia-trace-extension that referenced this issue Mar 12, 2024
This commit adds another button for opening trace files through a dialog.
Futhermore, the theia-trace-explorer-placeholder-widget can be configured
to render either one or both buttons (Open Trace folder, Open Trace File).

Fixes eclipse-cdt-cloud#1053

Signed-off-by: Neel Gondalia <ngondalia@blackberry.com>
@bhufmann
Copy link
Collaborator

Thanks for opening this issue. This has been a topic for this viewer as the Eclipse Trace Compass project. Both viewers support traces that are single files as well as traces that are directories, e.g. CTF (Common Trace Format).

In Eclipse Trace Compass, the approach was to support opening only a trace from the Open Trace menu option and never a trace collection. The implementation then used a File Dialog to select a file. The automatic trace type detection, then checked if that file is within a CTF directory and then opened that CTF trace, or just open the single trace file. The advantage was that both single trace files and CTF traces were supported out of the box and there was only one single button. The disadvantage was, that it was not possible to open multiple CTF trace from a parent directory, which is a common use case (see LTTng creates kernel and UST traces under the same root directory). To open both LTTng Traces a single trace set (aka. experiment), users had to create experiments manually.

When we migrated to the traceviewer in this project, we decided to open all CTF traces under a single directory to support the case above for LTTng traces. However, there is no native dialog that allows to select a directory and files. So, we had to pick the directory chooser.

Now, to allow users to open a single file trace using a dialog, there needs to be a separate button to support that since there is no existing dialog implementation that allows both. The disadvantage is that the buttons need be duplicated. Right now there is a Open Trace button in the placeholder view (which is shown when there are no traces on the server) and in view menu of the Opened Traces View.

Alternatively, we could have a single button to opens another dialog where the user has to select Open Trace File or Open Trace Directory.

ngondalia added a commit to ngondalia/theia-trace-extension that referenced this issue Mar 15, 2024
This commit adds another button for opening trace files through a dialog.
Futhermore, the theia-trace-explorer-placeholder-widget can be configured
to render either one or both buttons (Open Trace folder, Open Trace File).

Fixes eclipse-cdt-cloud#1053

Signed-off-by: Neel Gondalia <ngondalia@blackberry.com>
ngondalia added a commit to ngondalia/theia-trace-extension that referenced this issue Mar 15, 2024
This commit adds another button for opening trace files through a dialog.
Futhermore, the theia-trace-explorer-placeholder-widget can be configured
to render either one or both buttons (Open Trace folder, Open Trace File).

Fixes eclipse-cdt-cloud#1053

Signed-off-by: Neel Gondalia <ngondalia@blackberry.com>
hriday-panchasara pushed a commit that referenced this issue Mar 15, 2024
This commit adds another button for opening trace files through a dialog.
Futhermore, the theia-trace-explorer-placeholder-widget can be configured
to render either one or both buttons (Open Trace folder, Open Trace File).

Fixes #1053

Signed-off-by: Neel Gondalia <ngondalia@blackberry.com>
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 a pull request may close this issue.

2 participants