-
Notifications
You must be signed in to change notification settings - Fork 61
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
Allow editing trace set labels via Opened Traces widget #451
base: master
Are you sure you want to change the base?
Conversation
ab23a85
to
33d7ea8
Compare
Thanks for contributing this useful feature!
pr-451.mp4 |
Looking good! Below are some notes after screensharing with @thefinaljob : This feature is valuable because experienced trace visualization users say things like: "It's important I know which is the 'before trace' and which is the 'after [I make a change] trace'..." and: "When I share screenshots with others I hate scrawling all the details on the screenshots like 'Before...' and 'After I did xyz' because it's so hard to write letters with a mouse." Re: saving on enter or loss of focus: I've seen many users make edits in place then move on—never hitting enter—so saving when focus is lost is a good way to prevent errors. Nice nuance and thumbs up! The ability to revert is also good thinking, and I only wish we had a good visible affordance for "revert." Maybe the reload/revert icon? I'd title this commit "Enable user to to edit _trace set labels from within the Trace Viewer list of traces" Here's an edit-in-place sketch, showing various states in the process: Everyone reading this is invited to join a whiteboard I set up in Figjam. There you can zoom in on this sketch, comment, vote, augment, correct, educate. It's free, and you can join via this link: https://www.figma.com/file/5nxXdb198DkTwT24ZyqLkv/TraceViz-Figjam-Edit-in-place?node-id=0%3A1 Key points, in priority order: |
Requested changes:
Also look over the commit message guidelines in the new How to contribute code readme section. Some specific issues:
Honestly changing the labels is so satisfying! Thanks for the PR 🍰
I second this! Even though #384 was the motivation for these changes, the main action implemented in this PR is changing the trace set label (the tab changing names is a logical consequence of relabeling the trace set not the main action).
I think a context menu entry isn't critical at the moment since the action is already possible. However, if an entry is added it should be "Change trace label" or "Relabel trace" (for the same reason as above). Ideally, renaming tabs would eventually also be possible through the tab's context menu, but @ssmagula made the good point that this should be a Theia contribution not a trace-viewer-extension only thing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution! I think it is a much needed improvement in terms of usability because most traces do not have meaningful names.
- An open tab's name doesn't change until it's closed and then reopened. After that it does update while typing. See video below.
This issue is related to #364 and #450. I don't think this pull request makes the issue worse.
Also, if you reopen the trace directly from the files it will focus on the tab that did not change and stay on it when you select the menu item.
I agree with all the changes requested before, and added some comments that are mainly coding style changes.
@@ -43,6 +44,9 @@ export const Signals = { | |||
}; | |||
|
|||
export class SignalManager extends EventEmitter implements SignalManager { | |||
fireTabChangedSignal(tabName: string, expirementUUID: string): void { | |||
this.emit(Signals.TABNAME_CHANGED, {tabName, expirementUUID}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be { tabName, experimentUUID });
(typo + space separating the curly braces) and the typo should be corrected in the argument
} | ||
interface MenuItemState { | ||
editingTab: boolean; | ||
oldexpirementName: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect lower camel case + typo oldExperimentName
interface MenuItemState { | ||
editingTab: boolean; | ||
oldexpirementName: string; | ||
expirementNameState: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All expirement
should be changed in experiment
exp.name = tabEditingOpen; | ||
const experimentOpenNew = this.state.openedExperiments; | ||
experimentOpenNew[index] = exp; | ||
this.setState({openedExperiments: experimentOpenNew}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have spaces { openedExperiments: experimentOpenNew }
const selectedIndex = remoteExperiments.findIndex(experiment => this._selectedExperiment && | ||
experiment.UUID === this._selectedExperiment.UUID); | ||
this.setState({ openedExperiments: remoteExperiments, selectedExperimentIndex: selectedIndex !== -1 ? selectedIndex : 0 }); | ||
signalManager().fireOpenedTracesChangedSignal(new OpenedTracesUpdatedSignalPayload(remoteExperiments ? remoteExperiments.length : 0)); | ||
} | ||
|
||
protected handleTabNameUpdate(tabEditingOpen: string, index: number): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All functions or events related to experiment name change should not refer to the tab.
submitNewTab
-> submitNewExperimentName
handleTabNameUpdate
-> handleExperimentNameUpdate
fireTabChangedSignal
-> fireExperimentChangedSignal
TABNAME_CHANGED
-> EXPERIMENT_CHANGED
onTabNameChange
-> onExperimentNameChange
doHandleTabeNameChange
-> doHandleExperimentNameChange
tabEditingOpen
-> newExperimentName
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for the contribution. Will be a useful feature for the user.
I have some comments about the functionality.
Firstly, right now the change of the name is done purely on the front-end side. The back-end (trace-server) doesn't know about the changes. When disconnecting and re-connecting the front-end the old name is back.
To fix that, the name has to be propagated to the trace server so that the change is persisted for re-connection or connection using a different client. A fullstack update (front-end, TSP, and back-end) is needed to support that.
Secondly, we need to be clear that the renaming of experiment name doesn't change any file resources (i.e. the trace files)., and hence using this to keep a "before"-trace to be compared with an "after"-trace for trace comparison purposes won't work. This compare use case has to be addressed differently so that on the trace server each trace file of the experiment is kept. I think a deep copy of the experiment on the server would be needed instead of renaming the existing experiment.
True. I agree that the trace set label should be propagated to the server. Do these additional changes need to be prepared before this PR is merged? I'm divided, since I agree that merging just the front end changes is incomplete, but I think it still improves most use cases (re-connection or connection using a different client are less common).
I agree that it's not clear that changing the trace set label doesn't affect the filesystem and that this is confusing. But I don't think resolving this is within the scope of this PR. At the moment, trace set generation is all implicit and behind the scenes so the first step would be to to introduce the concept of "trace sets" that have no connection to the filesystem. If necessary, the changes proposed below could be made before merging this PR. In the short term (new issues?):
Good point that these changes don't make it easier to manage trace files when doing a before/after comparison (as in, users would still have to manually move/rename the "before" traces before generating the "after" traces). I don't think comparison is within the scope of this issue and I don't think renaming the trace set is the only indicator of "I want to keep this version of these trace files", but more thought definitely needs to go into comparison and whether/when to make copies of the actual trace files (especially since it's likely that a portion of users will trace using scripts that output trace files that always have the same name). Thank you for this relevant feedback! |
Hello! Just wanted to update everyone following this on the status of the updated PR. Here's where we stand now.
Extending the response mentioned by @ebugden , I do believe that @bhufmann's feedback could be implemented through opening new issues for tracecompass. |
I think that persistence is important. Closing the trace viewer while keeping a trace on the server is quite common. So, when opening the trace viewer again I personally would expect, that the renamed trace name is shown. I think the back-end support can be implemented outside of the scope of this PR. However, it needs to be done shortly after.
This could be the description and shown as tooltip. Using "Trace Set 0", "Trace Set 1" is not necessary better than using the directory name. The directory name right now works well, for example, when opening a trace set from the LTTng session root directory and the trace set name becomes the session name. Another use case is, when the root directory is a test case name and opening the trace set name become the unit test name. Changing the name to "Trace Set 0" as default, would break these use cases. I'm wondering if a dialog box should open with text box after selecting "Open with Trace Viewer". It opens with the default name. If the use wants to keep it, then he only needs to press ok. Otherwise the use can type a new name and then press enter.
Some indication is needed and a refresh needs to be done. Right now with the local trace server implementation, the trace server only has a symbolic link to the original trace file in the file system. If the original trace file is overridden, then the trace index, state systems etc (all trace analysis files) are out-dated as well and need to be re-built.
Yes, Trace comparison is not scope of this PR. But it's somehow related when it comes to managing trace files and I think it was important to mention it here.
No problem! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder, commit messages need to be in the present tense.
@arfio has been working on getting the re-render issue for the menu completed. If we can't get it fixed shortly, we might have to live with this and submit another issue stating that the menu needs to be re-tooled so that it works with react components as menu items. |
Exceptionally, I'm going to make edits to the title and description of this PR to correct some style issues. |
Storing label names in the trace server
I created an issue #474 so the required additional changes can be defined there. However, it's unlikely that they would be made soon. At the moment @arfio is working on finishing this PR when they have free time, but they don't have much free time these days. Clarify that re-labeling the trace doesn't change the trace files
I agree it's best clarify this before merging this PR. I moved this discussion into its own issue #475 |
685bdec
to
01eb485
Compare
01eb485
to
820176f
Compare
…clipse-cdt-cloud#384. Made each menu item into its own react component. Signed-off-by: Nikolai Peram <[email protected]>
Given that reworking the entire menu is taking a while I suggest we live with the current rendering issue present (currently the user needs to resize the menu in order to reflect the most recently selected trace). Other than that, all of the requested changes have been implemented
I also made a modification to the selected item colour. Having it as blue resulted in a very intense contrast with the black bar when it's selected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Storing label names in the trace server
bhufmann: I think the back-end support can be implemented outside of the scope of this PR. However, it needs to be done shortly after.
I created an issue #474 so the required additional changes can be defined there. However, it's unlikely that they would be made soon. At the moment @arfio is working on finishing this PR when they have free time, but they don't have much free time these days.
As I said above the back-end should be available soon after this PR is ready. Merging without having a proper back-end support I'd like to avoid.
BTW, this PR needs to be rebased to master. As well as it' seems to have some styling issue in light theme:
@@ -0,0 +1,148 @@ | |||
import * as React from 'react'; | |||
import { Trace } from 'tsp-typescript-client'; | |||
import { signalManager, Signals } from '@trace-viewer/base/lib/signals/signal-manager'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the package was renamed: use traceviewer-base
instead of @trace-viewer/base
@thefinaljob Thank you for the update! I agree with @bhufmann on not merging as it is now. I'm uncomfortable with merging a feature feels unfinished when the timeline of when it will be completed is unclear since currently no one is actively working on finalizing this feature. At this stage in the project we're working on making the tool feel more stable and polished and adding this feature as it is now would be a step backwards for polish. Allowing users to label traces is convenient, but doesn't add enough user value to justify making the tool feel less polished. |
Contributes towards fixing #384 (changing the trace set label also changes the tab label for that trace).
Known Issues:
Default Behaviour:
Signed-off-by: Nikolai Peram [email protected]