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 terminal tabs inside the tab view #122023

Closed
Tyriar opened this issue Apr 23, 2021 · 5 comments · Fixed by #124533
Closed

Allow renaming terminal tabs inside the tab view #122023

Tyriar opened this issue Apr 23, 2021 · 5 comments · Fixed by #124533
Assignees
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders on-release-notes Issue/pull request mentioned in release notes on-testplan polish Cleanup and polish issue terminal Integrated terminal issues terminal-tabs
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Apr 23, 2021

Terminal now:

Screen Shot 2021-04-23 at 7 02 49 AM

What we want:

Screen Shot 2021-04-23 at 7 03 19 AM

@Tyriar Tyriar added polish Cleanup and polish issue terminal Integrated terminal issues terminal-tabs labels Apr 23, 2021
@Tyriar Tyriar added this to the May 2021 milestone Apr 23, 2021
@meganrogge meganrogge modified the milestones: May 2021, April 2021 Apr 23, 2021
@Tyriar Tyriar modified the milestones: April 2021, May 2021 Apr 26, 2021
@meganrogge
Copy link
Contributor

The label becomes editable to receive text input here for the explorer

protected render(node: IAsyncDataTreeNode<TInput, T>, viewStateContext?: IAsyncDataTreeViewStateContext<TInput, T>, options?: IAsyncDataTreeUpdateChildrenOptions<T>): void {
const children = node.children.map(node => this.asTreeElement(node, viewStateContext));
const objectTreeOptions: IObjectTreeSetChildrenOptions<IAsyncDataTreeNode<TInput, T>> | undefined = options && {
...options,
diffIdentityProvider: options!.diffIdentityProvider && {
getId(node: IAsyncDataTreeNode<TInput, T>): { toString(): string; } {
return options!.diffIdentityProvider!.getId(node.element as T);
}
}
};
this.tree.setChildren(node === this.root ? null : node, children, objectTreeOptions);
if (node !== this.root) {
this.tree.setCollapsible(node, node.hasChildren);
}
this._onDidRender.fire();
}

@meganrogge
Copy link
Contributor

Started work on branch merogge/edit-tab-item

@isidorn
Copy link
Contributor

isidorn commented May 3, 2021

I actually wanted to create this identical issue, but then I remembered how many issues I got in my life because I used in the inline input box and decided that using a quick pick is actually not the worst :)
The problems with the inline quick pick is auto closing it when it loses focus, that code tends to be funky as the blur event sometimes comes a bit late. Another corner case is if you scroll out if it in the list and so on. Another corner case if you click on the + and the input box is already shown...
The UX would be nicer if the input was inline, but just be aware that I am not happy with how the code looks in the explorer.

Without further ado, here are the code pointer in how the Explorer does it:
When the + action is clicked we create a fake NewExplorerItem here
It is inserted in the model / service making everybody aware that element is in the editable mode using this method

And once the viewer detects that a item is in edit mode it actually renders the input box here
You can notice how the input box listens on all the various events on how it could possibly be closed.

So when a + is clicked the refresh of the list is necessary due to a new element. Same as when the input box is closed.

@Tyriar
Copy link
Member Author

Tyriar commented May 3, 2021

Thanks for the tips/warning

meganrogge added a commit that referenced this issue May 24, 2021
@meganrogge meganrogge added the feature-request Request for new features or functionality label May 25, 2021
@meganrogge meganrogge added the on-release-notes Issue/pull request mentioned in release notes label Jun 2, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jul 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders on-release-notes Issue/pull request mentioned in release notes on-testplan polish Cleanup and polish issue terminal Integrated terminal issues terminal-tabs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@isidorn @Tyriar @meganrogge and others