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

Allow renaming trace viewer tabs #384

Open
ebugden opened this issue Jun 7, 2021 · 4 comments · May be fixed by #451
Open

Allow renaming trace viewer tabs #384

ebugden opened this issue Jun 7, 2021 · 4 comments · May be fixed by #451

Comments

@ebugden
Copy link
Contributor

ebugden commented Jun 7, 2021

Allowing users to rename tabs lets them give concise and meaningful labels. This makes it easier to distinguish between tabs because, unlike the trace file names (which tend to be long), user written labels are more likely to fit inside narrow tabs without being cut off.

Examples of useful tab names:

  • Crash A (Server 1), Crash A (Server 2)
  • Before update, After update
  • Baseline, Change A, Change B

Requirements:

  • Changes made to the tab name shouldn't change the trace file name (or the trace group name).
  • If the user clicks away while editing, the tab is renamed to what they typed.
  • If the user hasn't typed anything, the tab keeps the previous name.

CC: @ssmagula

@thefinaljob
Copy link
Contributor

thefinaljob commented Jul 22, 2021

Revised approach to solving the issue:

  • Decouple code related to menu items in trace-explorer-opened-traces-widget.tsx by making it into its own component
    • pass in functions from the traces widget to the menu item component to avoid code duplication
    • move functions from trace widget to menu item component whenever possible
  • Tie state of the tab to the state of the menu-item so that changes are reflected when the menu item is changed
    • Approach to this is TBD, could use a state store like Redux or callback functions

See below for a screenshot for the user story.

image

CC: @arfio

@ebugden
Copy link
Contributor Author

ebugden commented Jul 22, 2021

@thefinaljob @ssmagula You plan to have the edit trace button appear in the opened traces section (A) rather than in the trace tab label (B)?

Couldn't we edit directly in the tab and either:

  • When the pencil fades in, it obscures a portion of the title that was previously visible (instead of always leaving an empty space after the title), or
  • On hover of the tab label text, the cursor changes to the "editable text" cursor: Ꮖ

My reflex would be to put it in the trace tab first:

  • I think that's where people would look first. I don't think people would necessarily make the link that editing the name in the list of traces would affect the tab name.
  • One main goal of renaming trace groups is to have a label that is readable within the space of a tab. Editing the tab label directly allows users to use the tab size as a reference for whether it will be readable or not.
  • I don't think space would be a big issue. My guess is that tracers would have 1-2 (4 max) trace groups open. Although if you're also developing within the context of tracing you could have source files open as well...

rename-tab-placement

@ebugden
Copy link
Contributor Author

ebugden commented Jul 23, 2021

RE: Space for editing button - This shouldn't be an issue since the tab size doesn't shrink in Theia when there are too many tabs to display in the tab bar. In Theia, tab size is a function of label length. When there are too many tabs to display in the tab bar, a scroll wheel appears.

Example with a ton of tabs open:

TraceCompassTutorialTraces.Theia-Trace.Example.Application.-.Google.Chrome.2021-07-23.13-43-56.mp4

@ebugden
Copy link
Contributor Author

ebugden commented Jul 23, 2021

After some discussion with @ssmagula and @thefinaljob:

  • Renaming tabs via the tab is intuitive, but should be a contribution to theia rather than a trace extension contribution. A feature request should be created in that repo.
  • Renaming trace groups with first be implemented via the "Opened Traces" menu (as thefinaljob proposed).

thefinaljob added a commit to thefinaljob/theia-trace-extension that referenced this issue Aug 18, 2021
@ebugden ebugden linked a pull request Aug 25, 2021 that will close this issue
thefinaljob added a commit to thefinaljob/theia-trace-extension that referenced this issue Sep 18, 2021
…cdt-cloud#384. Made each menu item into its own react component.

Signed-off-by: Nikolai Peram <[email protected]>
thefinaljob added a commit to thefinaljob/theia-trace-extension that referenced this issue Sep 18, 2021
thefinaljob added a commit to thefinaljob/theia-trace-extension that referenced this issue Sep 18, 2021
…clipse-cdt-cloud#384. Made each menu item into its own react component.

Signed-off-by: Nikolai Peram <[email protected]>
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