Skip to content

fix(navigator): auto-select file/folder name when creating new items#2179

Open
Mohd-Nafish wants to merge 1 commit into
CodeEditApp:mainfrom
Mohd-Nafish:fix/issue-2029-auto-select-name-on-create
Open

fix(navigator): auto-select file/folder name when creating new items#2179
Mohd-Nafish wants to merge 1 commit into
CodeEditApp:mainfrom
Mohd-Nafish:fix/issue-2029-auto-select-name-on-create

Conversation

@Mohd-Nafish

Copy link
Copy Markdown

Description

When creating a new file or folder in the project navigator, the default name (e.g., "untitled") is now automatically selected for editing. Users can type immediately without needing to manually click on the text first.

Changes made:

  • Added renameFile() call after creating new files in the newFile() method
  • Added renameFile() call after creating new folders in the newFolder() method

The existing renameFile() method makes the text field the first responder, putting focus on it for immediate editing. This pattern was already being used in the newFileFromClipboard() method, so this change brings consistency to all file/folder creation paths.

Related Issues

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

Before Fix (Bug):

  • Create new file → text NOT selected, must click to edit

After Fix (Working):

  • Create new file → text IS selected, can type immediately
  • Create new folder → text IS selected, can type immediately

Testing Results:

✅ New files created with auto-selected names
✅ New folders created with auto-selected names
✅ Multiple sequential creations work consistently
✅ Can type immediately without clicking
✅ Escape key cancels rename operation
✅ No build warnings
✅ Code builds successfully

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.

🐞 Name Not Selected for Editing When Creating New Files or Folders in Project Navigator

1 participant