Skip to content

[Help Wanted] dev/lubl/file-enum #12601

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

Closed

Conversation

lukeblevins
Copy link
Contributor

@lukeblevins lukeblevins commented Jun 13, 2023

Resolved / Related Issues

  • Were these changes approved in an issue or discussion with the project maintainers? In order to prevent extra work, feature requests and changes to the codebase must be approved before the pull request will be reviewed. This prevents extra work for the contributors and maintainers.
    Closes #issue...

Validation
How did you test these changes?

  • Did you build the app and test your changes?
  • Did you check for accessibility? You can use Accessibility Insights for this.
  • Did you remove any strings from the en-us resource file?
    • Did you search the solution to see if the string is still being used?
  • Did you implement any design changes to an existing feature?
    • Was this change approved?
  • Are there any other steps that were used to validate these changes?
    1. Open app ...
    2. Click settings button ...

Screenshots (optional)
Add screenshots here.

@lukeblevins lukeblevins changed the title Dev/lubl/file enum [Help Wanted] dev/lubl/file-enum Jun 13, 2023
@d2dyno1 d2dyno1 self-requested a review June 13, 2023 21:43
@QuaintMako QuaintMako self-requested a review June 14, 2023 07:29
@0x5bfa 0x5bfa self-requested a review June 14, 2023 13:17
@yaira2 yaira2 added the help wanted Extra attention is needed label Jun 15, 2023
Copy link
Member

@d2dyno1 d2dyno1 left a comment

Choose a reason for hiding this comment

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

Some nits from initial glance

/// <summary>
/// Represents a watcher for the trash bin
/// </summary>
public interface ITrashWatcher : IWatcher
Copy link
Member

Choose a reason for hiding this comment

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

How about we use or inherit from IFolderWatcher?


namespace Files.Sdk.Storage.MutableStorage
{
/// <summary>
/// A disposable object which can notify of changes to the folder.
/// </summary>
public interface IFolderWatcher : INotifyCollectionChanged, IDisposable, IAsyncDisposable
public interface IFolderWatcher : INotifyCollectionChanged, IDisposable, IAsyncDisposable, IWatcher
Copy link
Member

Choose a reason for hiding this comment

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

Change tracking events are already supplemented by INotifyCollectionChanged

/// <summary>
/// Starts the watcher
/// </summary>
void Start();
Copy link
Member

Choose a reason for hiding this comment

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

Retrieving IFolderWatcher assumes that it's already tracking for changes.

/// <summary>
/// Stops the watcher
/// </summary>
void Stop();
Copy link
Member

Choose a reason for hiding this comment

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

Stopping the IFolderWatcher is done through either IDisposable.Dispose() or IAsyncDisposable.DisposeAsync()

@@ -197,5 +199,43 @@ public async Task<IFolder> CreateFolderAsync(string desiredName, CreationCollisi

return new FtpStorageFolder(newPath, desiredName);
}

public async IAsyncEnumerable<IStorable> SearchAsync(string userQuery, SearchDepth depth = SearchDepth.Shallow)
Copy link
Member

Choose a reason for hiding this comment

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

Could this be an extension method?

/// </summary>
/// <param name="userQuery">A string containing specific terms which influence search results</param>
/// <returns>The search results produced by the query</returns>
IAsyncEnumerable<IStorable> SearchAsync(string userQuery, SearchDepth depth = SearchDepth.Shallow);
Copy link
Member

Choose a reason for hiding this comment

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

If it's a necessity, add another interface that'd provide the search function (e.g.: ISearchableFolder)

@d2dyno1
Copy link
Member

d2dyno1 commented Jun 28, 2023

Hi! Why was this pull request closed? 🤔
The changes looked pretty solid 🙂

@0x5bfa 0x5bfa mentioned this pull request Feb 5, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants