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

Implement plus button on TabBar #108

Merged
merged 11 commits into from May 10, 2021

Conversation

nmichaud
Copy link
Contributor

This PR implements a plus button on the TabBar (similar to google chrome) that will trigger an event when clicked. I've wired up this event for the TabPanel to emit a AddWidgetRequested event, which can be handled by the end user to create the appropriate widget and add it to the panel. A similar approach can also be implemented for the DockPanel if desired.

The CSS is a bit tricky - currently the plus button floats to the end of the TabBar instead of following the tabs.

@ellisonbg
Copy link
Contributor

Woah! I have been talking to folks about this recently. Would be spectacular to see this happen. I will dive into this and begin to review soon.

@ellisonbg
Copy link
Contributor

In the meantime, can you post a screenshot?

@nmichaud
Copy link
Contributor Author

Here's an example with the DockPanel (not yet part of this PR - I'll push the commits soon)

image

@nmichaud
Copy link
Contributor Author

@ellisonbg @jasongrout @afshin It should be ready to review now. I've also updated the dock panel example to expose an additional context menu item when you right-click on the dock panel to toggle the plus button.

@afshin
Copy link
Member

afshin commented Aug 21, 2020

I'm happy to look as well.

@nmichaud
Copy link
Contributor Author

@ellisonbg @afshin Any thoughts on this?

@nmichaud
Copy link
Contributor Author

Rebased onto master and force pushed

@nmichaud
Copy link
Contributor Author

nmichaud commented May 3, 2021

Pinging @ellisonbg @jasongrout @afshin again. Any interest in this?

@afshin
Copy link
Member

afshin commented May 3, 2021

Sorry for leaving you hanging with this PR @nmichaud! I'll commit to reviewing this PR this week! Sorry again for such a long wait!

@nmichaud
Copy link
Contributor Author

nmichaud commented May 4, 2021

@afshin Sure no problem, just wanted to make sure this was still of interest.

@afshin
Copy link
Member

afshin commented May 8, 2021

@nmichaud thank you so much for your patience!

I am 👍 on this broadly, I left some API surface area suggestions above.

Could you please push your example updates as well?

@nmichaud
Copy link
Contributor Author

nmichaud commented May 8, 2021

Thanks for the review @afshin. I've updated with the API changes you proposed.

The dockpanel example has already been updated - right click on the DockPanel to bring up the context menu, and then select the last menu option ('Toggle add button') to see it in action.
test

@afshin
Copy link
Member

afshin commented May 8, 2021

The dockpanel example has already been updated - right click on the DockPanel to bring up the context menu, and then select the last menu option ('Toggle add button') to see it in action.

Oops, I got confused by the screenshot 😂

@nmichaud
Copy link
Contributor Author

nmichaud commented May 8, 2021

The dockpanel example has already been updated - right click on the DockPanel to bring up the context menu, and then select the last menu option ('Toggle add button') to see it in action.

Oops, I got confused by the screenshot 😂

Yeah, apologies I didn't make it obvious in the beginning.

Copy link
Member

@afshin afshin 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 this feature and for the patience!

@afshin afshin added the enhancement New feature or request label May 8, 2021
@blink1073 blink1073 merged commit f8466b2 into jupyterlab:master May 10, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants