Repository navigation
Add file rename button to project explorer - #11664
Open
Dmitriy Antipov (THEb0nny) wants to merge 4 commits into
Open
Dmitriy Antipov (THEb0nny) wants to merge 4 commits into
Dmitriy Antipov (THEb0nny) wants to merge 4 commits into
Conversation
Add a visible "Custom" label to the custom blocks namespace and capitalize the empty-filename validation message.
Capitalize the validation message shown when a filename is empty.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the ability to rename user-created files directly from the file explorer (MakeCode project view), located right next to the delete button.
#11299
Problem / Motivation
Previously, users could create and delete custom files, but could not rename them. To rename a file, users were forced to create a new file with the desired name, copy-paste the code over, and delete the old file.
Changes
Explorer UI (
webapp/src/filelist.tsx):FileTreeItemfor editable top-level user files (excluding system/entry files likemain.ts,pxt.json,main.blocks, etc.).renameFile) with full validation: checks for empty names, special characters (/,\,:), system/reserved names, language restrictions, and collision with existing files..tsblock files (likecustom.ts), automatically re-extracts/updates the custom blocks display name header.Core Renaming Logic (
webapp/src/package.ts&webapp/src/app.tsx):EditorPackage.renameFileAsync: updates file mappings in memory and updatesfiles/testFilesinpxt.json.ProjectView.renameFile: updatesfileHistory, disposes the old Monaco editor model, saves files to workspace, reloads the project header, and switches focus to the newly renamed file.IProjectViewtypings inlocaltypings/pxteditor.d.ts.Styling (
theme/common.less):margin-leftfor buttons within.file-list-itemso action buttons (rename and delete) sit neatly side-by-side with appropriate spacing.Testing
custom.ts, other.tsand data files).pxt.jsonis updated and saved.main.ts,pxt.json, etc.) do not show the rename button.Screenshots
Video
BrickCode.for.EV3.-.Google.Chrome.2026-10-21.01-35-02.mp4