Skip to content

Conversation

kuugu
Copy link
Contributor

@kuugu kuugu commented Aug 1, 2025

A simple tool addition to rename notebooks

@kuugu
Copy link
Contributor Author

kuugu commented Aug 9, 2025

Hey @mbektas
do you think this would be useful to add?

new_name: New name for the notebook
"""
response = args["response"]
ui_cmd_response = await response.run_ui_command('notebook-intelligence:rename-notebook-from-py', {'newName': new_name})
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you remove -from-py suffix from the command names

src/index.ts Outdated
@@ -87,6 +87,8 @@ namespace CommandIDs {
export const createNewFile = 'notebook-intelligence:create-new-file';
export const createNewNotebookFromPython =
'notebook-intelligence:create-new-notebook-from-py';
export const renameNotebookFromPython =
Copy link
Collaborator

Choose a reason for hiding this comment

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

FromPython in name is not necessary

src/index.ts Outdated
const activeWidget = app.shell.currentWidget;
if (activeWidget instanceof NotebookPanel) {
const oldPath = activeWidget.context.path;
const newPath = args.newName as string;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the new name should be input as just file name and it shouldn't change the parent directory of a notebook. example:

  • oldPath: 'test/untitled.ipynb'
  • newName: 'hello-world'
  • newPath: 'test/hello-world.ipynb'

@kuugu
Copy link
Contributor Author

kuugu commented Aug 22, 2025

done with the changes, please have a look. @mbektas

Copy link
Collaborator

@mbektas mbektas left a comment

Choose a reason for hiding this comment

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

LGTM! thanks @kuugu .

@mbektas mbektas merged commit 10fdc6c into notebook-intelligence:main Aug 25, 2025
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants