Skip to content

Fix Playground TypeScript file creation to respect selected folder#142

Open
MUFFANUJ wants to merge 5 commits intojupyterlab:mainfrom
MUFFANUJ:fixTSPluginFileCreation
Open

Fix Playground TypeScript file creation to respect selected folder#142
MUFFANUJ wants to merge 5 commits intojupyterlab:mainfrom
MUFFANUJ:fixTSPluginFileCreation

Conversation

@MUFFANUJ
Copy link
Copy Markdown
Member

@MUFFANUJ MUFFANUJ commented Apr 3, 2026

closes #138

This PR fixes the bug where creating a Playground TypeScript file would always place it in the workspace root. File creation now follows the currently selected folder in the UI.

@MUFFANUJ MUFFANUJ added the bug Something isn't working label Apr 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

Preview environments for this pull request:

Preview Lab Notebook v7
Binder Binder Binder Notebook v7
JupyterLite JupyterLite JupyterLite Notebook v7

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes the Playground “create TypeScript file” behavior so new files are created under the currently selected folder (instead of always using the workspace root), aligning with the file browser / notebook tree “current directory” concept.

Changes:

  • Add a cwd command argument and use it as the parent directory for contents.newUntitled() when creating new Playground TypeScript files.
  • Apply the same cwd-based behavior to the notebook tree “New” dropdown Playground entry.
  • Add an integration UI test that verifies file creation honors cwd when path is not provided.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
ui-tests/tests/plugin-playground.spec.ts Adds coverage for creating a plugin file using cwd when no explicit path is passed.
src/index.ts Extends create-file command args with cwd and uses it to create new untitled files in the selected directory (also applied to the notebook tree command).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Playground TypeScript file is created in root instead of current folder

2 participants