Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Added support for bulk rename #16228

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Feature: Added support for bulk rename #16228

wants to merge 6 commits into from

Conversation

yaira2
Copy link
Member

@yaira2 yaira2 commented Sep 19, 2024

Resolved / Related Issues

To prevent extra work, all changes to the Files codebase must link to an approved issue marked as Ready to build. Please insert the issue number following the hashtag with the issue number that this Pull Request resolves.

Steps used to test these changes

Stability is a top priority for Files and all changes are required to go through testing before being merged into the repo. Please include a list of steps that you used to test this PR.

  1. Opened Files ...
  2. ...

@yaira2 yaira2 marked this pull request as draft September 19, 2024 16:34
@yaira2 yaira2 changed the title Ya/bulk rename Feature: Added support for bulk rename Sep 19, 2024
Copy link
Member

@0x5bfa 0x5bfa left a comment

Choose a reason for hiding this comment

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

Code quality issues

src/Files.App/Dialogs/BulkRenameDialog.xaml Show resolved Hide resolved
!string.IsNullOrEmpty(fileName) && !IsNameValid;


private string fileName = string.Empty;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
private string fileName = string.Empty;
private string _FileName = string.Empty;

Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't the '_' prefix against the code style rules for C#? I think it's IDE1006
https://learn.microsoft.com/en-gb/dotnet/fundamentals/code-analysis/style-rules/naming-rules

Copy link
Member

@0x5bfa 0x5bfa Sep 19, 2024

Choose a reason for hiding this comment

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

This is a private field. Using PascalCase is guided by our coding guideline, Section 2, Number 2.

Use PascalCase prefixed with _ for properties’ backing fields

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh yeah, I forgot why that seemed so familiar...

}

// Commands
public IAsyncRelayCommand CommitRenameCommand { get; private set; }
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public IAsyncRelayCommand CommitRenameCommand { get; private set; }
public IAsyncRelayCommand CommitRenameCommand { get; private set; }

false
);
}));

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

private FrameworkElement RootAppElement
=> (FrameworkElement)MainWindow.Instance.Content;

public BulkRenameDialogViewModel ViewModel
Copy link
Member

Choose a reason for hiding this comment

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

This has been a bad practice and I was going to delete.
Can you use binding instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think that works for IDialog.

Copy link
Contributor

@Lamparter Lamparter left a comment

Choose a reason for hiding this comment

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

Some suggestions, probably all wrong...

InitializeComponent();
}

public new async Task<DialogResult> ShowAsync()
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be public override async? Or is this intended?


<StackPanel Width="440" Spacing="4">

<!-- Name -->
Copy link
Contributor

Choose a reason for hiding this comment

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

<!-- Name -->

What does this mean?

Copy link
Member

Choose a reason for hiding this comment

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

A comment for the block named "Name" in the Bulk Rename dialog

Copy link
Contributor

Choose a reason for hiding this comment

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

Will you add error handling? Or is it automatic?

Copy link
Member Author

Choose a reason for hiding this comment

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

It should be handled by RenameAsync.

Copy link
Contributor

@Lamparter Lamparter left a comment

Choose a reason for hiding this comment

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

Considering code style in other files, here are some more advisories.

mc:Ignorable="d">

<StackPanel Width="440" Spacing="4">

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

Copy link
Member

Choose a reason for hiding this comment

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

I already suggested changes for all of them here.

Copy link
Contributor

Choose a reason for hiding this comment

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

These are different changes.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a preference to have spaces between xaml blocks.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes I know, this is just not the same as in other files.

Copy link
Member Author

Choose a reason for hiding this comment

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

The style has evolved over the years

Copy link
Member

Choose a reason for hiding this comment

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

These are different changes.

I misunderstood, sorry.

</TextBox>

</Grid>

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

}
}

// Commands
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Commands
// Commands

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

Successfully merging this pull request may close these issues.

Feature: Support renaming multiple files at the same time
3 participants