-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Feature: Improved performance when creating new files #11114
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
Merged
yaira2
merged 6 commits into
files-community:main
from
ferrariofilippo:Add_Item_Dialog_Service
Jan 30, 2023
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a241b9b
Code quality: Introduced a service to cache NewItem menu types
ferrariofilippo 753a230
Merge branch 'main' into Add_Item_Dialog_Service
ferrariofilippo 9ff0196
Renamed service
ferrariofilippo b09c428
Leftovers
ferrariofilippo 687c955
Merge branch 'main' into Add_Item_Dialog_Service
ferrariofilippo 9125a43
NewItem caching
ferrariofilippo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Files.App.Extensions; | ||
using Files.Backend.Services; | ||
using Files.Shared; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
|
||
namespace Files.App.ServicesImplementation | ||
{ | ||
/// <inheritdoc cref="IAddItemService"/> | ||
internal sealed class AddItemService : IAddItemService | ||
{ | ||
private List<ShellNewEntry> _cached; | ||
|
||
public async Task<List<ShellNewEntry>> GetNewEntriesAsync() | ||
{ | ||
if (_cached is null || _cached.Count == 0) | ||
_cached = await ShellNewEntryExtensions.GetNewContextMenuEntries(); | ||
|
||
return _cached; | ||
} | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Files.Shared; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
|
||
namespace Files.Backend.Services | ||
{ | ||
/// <summary> | ||
/// A service to retrieve available item types | ||
/// </summary> | ||
public interface IAddItemService | ||
{ | ||
/// <summary> | ||
/// Gets a list of the available item types | ||
/// </summary> | ||
/// <returns>List of the available item types</returns> | ||
Task<List<ShellNewEntry>> GetNewEntriesAsync(); | ||
} | ||
} |
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.
Uh oh!
There was an error while loading. Please reload this page.