Skip to content

feat: add ability to rename files#257

Merged
cguedes merged 49 commits into
mainfrom
213-add-ability-to-rename-files
Jul 7, 2023
Merged

feat: add ability to rename files#257
cguedes merged 49 commits into
mainfrom
213-add-ability-to-rename-files

Conversation

@sehyod

@sehyod sehyod commented Jul 6, 2023

Copy link
Copy Markdown
Collaborator

This adds an item to the context menu to rename files.
Renaming a file updates the file name on the disk, updates the file name in the file explorer and updates the open editors corresponding to the file.
When editing, pressing Escape cancels the action. Pressing Enter submit the new name, if the name is valid. The operation is also canceled when the focus on the input element is lost.

A valid name is a name that respects the following conditions:

  • No other file with the same name already exists
  • The name does not start with a . character
  • The name does not contain any / character
Screen.Recording.2023-07-06.at.14.36.52.mov

Closes #213

sehyod added 30 commits June 29, 2023 16:40
@codecov

codecov Bot commented Jul 6, 2023

Copy link
Copy Markdown

Codecov Report

Merging #257 (5736c59) into main (ed6880d) will increase coverage by 0.76%.
The diff coverage is 84.76%.

@@            Coverage Diff             @@
##             main     #257      +/-   ##
==========================================
+ Coverage   76.40%   77.17%   +0.76%     
==========================================
  Files         109      110       +1     
  Lines        5816     6133     +317     
  Branches      521      571      +50     
==========================================
+ Hits         4444     4733     +289     
- Misses       1356     1384      +28     
  Partials       16       16              
Impacted Files Coverage Δ
...xplorerContextMenu/FileExplorerFileContextMenu.tsx 25.00% <0.00%> (-8.34%) ⬇️
src/io/filesystem.ts 26.23% <12.76%> (-1.91%) ⬇️
...eExplorerContextMenu/useFileExplorerContextMenu.ts 79.16% <42.85%> (-10.31%) ⬇️
src/components/FileNameInput.tsx 96.66% <96.66%> (ø)
src/application/sidebar/FileExplorer.tsx 100.00% <100.00%> (+9.67%) ⬆️
src/atoms/core/createEditorContentAtoms.ts 100.00% <100.00%> (+3.07%) ⬆️
src/atoms/core/editorContent.ts 100.00% <100.00%> (ø)
src/atoms/core/editorData.ts 100.00% <100.00%> (+6.81%) ⬆️
src/atoms/core/fileExplorerEntry.ts 100.00% <100.00%> (ø)
src/atoms/core/paneGroup.ts 100.00% <100.00%> (+1.72%) ⬆️
... and 6 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@sehyod sehyod requested a review from cguedes July 7, 2023 10:04
@sehyod sehyod marked this pull request as ready for review July 7, 2023 10:04
@cguedes cguedes merged commit 1f68787 into main Jul 7, 2023
@cguedes cguedes deleted the 213-add-ability-to-rename-files branch July 7, 2023 16:27
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.

Add ability to rename a file

2 participants