Skip to content

Now opens editor and viewer #83

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Yahiewi
Copy link
Contributor

@Yahiewi Yahiewi commented Apr 23, 2025

Made the urdf view open with the editor when:
-Creating a new urdf file.
-Opening an existing urdf file (by double-clicking on one from the file browser for example). Also improved the readability of the function that handles this by making it asynchronous.

Copy link
Contributor

Binder 👈 Launch a Binder on branch Yahiewi/jupyterlab-urdf/editor-double-click

@IsabelParedes IsabelParedes added the enhancement New feature or request label Apr 23, 2025
@Yahiewi Yahiewi force-pushed the editor-double-click branch from ddaec59 to bc0aa13 Compare April 23, 2025 15:16
@IsabelParedes
Copy link
Member

Resolves #64

Copy link
Member

@IsabelParedes IsabelParedes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Let's make this better and open them in a split view, the editor on the left and the viewer on the right side. You can pass a options argument. For reference:

@Yahiewi
Copy link
Contributor Author

Yahiewi commented Apr 30, 2025

I added the split panel feature using the "options" mode "split-left" when creating the widgets and the mode "tab-after" when creating new widgets after the split has already been made.
Also added a splitDone flag to track whether a split has been made which uses the local storage of the user's browser to persist the layout through refreshes.
If the user doesn't wish to use this feature, they can always right click on the file and select "Open With" to open with either the editor or the viewer.

@Yahiewi Yahiewi requested a review from IsabelParedes April 30, 2025 10:09
Copy link
Member

@IsabelParedes IsabelParedes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there!

The splitting seems to be working well. There is only one case (scenario 1) where it does not behave as expected.

Scenario 1

  • User opens a file and closes the Editor tab
  • User opens a second URDF file
  • Issue: the split does not happen anymore and all the tabs open together

image
image

Scenario 2

  • User opens a file and closes the Viewer tab
  • User opens a second URDF file
  • No issues: editor and viewer are split as expected

image
image

@Yahiewi Yahiewi requested a review from IsabelParedes May 12, 2025 08:26
@Yahiewi
Copy link
Contributor Author

Yahiewi commented May 12, 2025

Made the split panel feature work in both scenarios by adding a few more functions to check for special cases and try to improve the tracking of the tabs (which still isn't perfect). A major shortcoming of this version is that sometimes (after certain scenarios like opening multiple tabs and keeping only the editors for some open and the viewers for others open) on refresh you get a third split panel.
I still couldn't find a way to make Jupyter properly track the tab groups even if I explicitly declared them.
In my opinion, I think the previous version, even though it doesn't work perfectly in the scenarios you suggested is still more stable and in my tests never produced the third split panel issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants