posit-dev / positron

Positron, a next-generation data science IDE
https://positron.posit.co
Other
2.79k stars 85 forks source link

Closed and duplicate Jupyter Notebooks persist in variables pane after no longer being active #3900

Open coatless opened 4 months ago

coatless commented 4 months ago

Positron Version:

Positron Version: 2024.07.0 (Universal) build 14 Code - OSS Version: 1.90.0 Commit: b750305d0e9079e1a6d4e0b1d78daa70964b0cb8 Date: 2024-07-04T04:17:07.822Z Electron: 29.4.0 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Darwin arm64 23.5.0

Steps to reproduce the issue:

Regression of #2658 (split off from #3867)

  1. Open new Jupyter Python notebook
  2. Start typing in commands
  3. Save the python notebook as test-toad.ipynb
  4. Look at the drop down menu in session and notice that untitled-1.ipynb persists.
  5. Execute commands in notebook.
  6. Re-save notebook under test-toad.ipynb name.
  7. Look at the drop down menu in session and notice that there are now two test-toad.ipynb items.

https://github.com/posit-dev/positron/assets/833642/ec6eddda-0c68-4187-b216-57817dfec306

What did you expect to happen?

Only 1 session to persist. Multiple sessions with the same name should only retain the latest session.

Were there any error messages in the output or Developer Tools console?

N/A

testlabauto commented 4 months ago

I would also like to add that when a notebook is closed without saving, the session should probably go away. For now, it stays open but the variables pane becomes non functional (cannot copy data or delete variables).

juliasilge commented 4 months ago

I want to point out that this is currently behaving as designed. Notice that:

I definitely agree that the experience around this can feel confusing. I particularly am not a fan of a given Variables pane persisting in the UI (although grayed out) after that session is gone; I think really confusing situations can arise and it would be better to clear out the Variables pane when any console or notebook session is closed.