Nextcloud Recent Files: Android, IOS Implementation

by Admin 52 views
Nextcloud Recent Files Feature: Android and iOS Implementation Details

Hey guys! Let's dive into the exciting discussion around the implementation of a recent files feature in Nextcloud, specifically focusing on its integration within the Android and iOS clients. This is a feature that many users will find incredibly helpful, allowing for quick access to files and folders they've been working on recently. We'll explore the challenges, potential solutions, and design considerations for making this a seamless experience across platforms.

Understanding the Recent Files Feature

The core idea behind the recent files feature is to provide users with a readily accessible list of files and folders they've interacted with most recently. This eliminates the need to navigate through the entire file structure, saving time and improving overall productivity. Think about how often you need to quickly grab that document you were editing yesterday or jump back into the folder where you're organizing your project files. A recent files section addresses this directly, making your workflow smoother and more efficient. The initial proposal highlights the following key aspects:

  • New Entry: "Recent Files" This will be a new section or entry within the Nextcloud mobile apps, providing a dedicated space for accessing recent items.
  • Android: Sidebar On the Android app, the recent files section will be located in the sidebar, a familiar and easily accessible location for Android users.
  • iOS: Location to be Determined The discussion is open regarding the ideal placement of the recent files section within the iOS app. This is a crucial aspect as it impacts the user experience and discoverability of the feature.
  • Show Recently Visited Files/Folders The feature will display a list of recently accessed files and folders, giving users a comprehensive view of their recent activity.
  • Metric Discussion Determining the metric for what constitutes "recent" is a key consideration. Should it be based on the last accessed time, the last modified time, or a combination of factors? This needs careful thought to ensure the feature behaves intuitively.
  • Local Implementation Initially Currently, the implementation focuses on local device storage. This means that the list of recent files is stored on the device itself and not synced across devices or the server. This simplifies the initial implementation but also presents opportunities for future enhancements, such as cross-device syncing.
  • Files: Easy Implementation Tracking recently opened or edited files is relatively straightforward. The system can easily remember the last accessed files and add them to the recent list.
  • Folders: Implementation Challenge Tracking recently accessed folders presents a greater challenge. How do you define a recently accessed folder? Is it when a file within that folder is accessed? Or when the folder itself is explicitly opened? This is a crucial design question that needs to be addressed.

Implementation Details and Challenges

Let's break down some of the implementation details and challenges involved in building this recent files feature. We'll look at both the technical aspects and the user experience considerations.

Files: Straightforward Tracking

As mentioned earlier, tracking recently accessed files is relatively simple. The operating system provides APIs for monitoring file access and modification times. Nextcloud can leverage these APIs to maintain a list of recently opened or edited files. When a file is opened, its details (path, name, last accessed time, etc.) are added to a local database or a simple list. This list can then be sorted by the last accessed time to display the most recent files at the top.

However, even with files, there are some nuances to consider:

  • Number of Files to Display: How many recent files should be displayed in the list? Too few, and users might not find what they're looking for. Too many, and the list becomes overwhelming and difficult to navigate. A reasonable default number, perhaps 10-20, with an option to view more, could be a good approach.
  • File Type Filtering: Should the list include all file types, or should there be filtering options? For example, a user might want to see only recent documents or recent images. This adds complexity but can also improve usability.
  • Handling Deleted Files: What happens when a file in the recent list is deleted? The entry should be removed from the list to avoid broken links and a frustrating user experience.

Folders: The Tricky Part

Tracking recently accessed folders is where things get interesting. Unlike files, there's no direct event or API call that signifies a folder being "accessed." A folder is essentially a container, and its contents are accessed rather than the folder itself. Therefore, we need to define a metric for determining when a folder should be considered "recent."

Here are a few approaches to consider:

  • File Activity within a Folder: One approach is to consider a folder "recent" if a file within that folder has been recently accessed. This seems like a logical starting point. When a file is opened or edited, the parent folder is added to the recent folders list (if it's not already there). This approach captures the context of file access and makes it likely that the user will want to return to that folder.
  • Explicit Folder Opening: Another approach is to track when a user explicitly opens a folder within the Nextcloud app. This could involve monitoring navigation events within the file browser. However, this might not be as reliable as the file activity approach, as users might access files directly without explicitly opening the folder in the file browser.
  • Combination Approach: A combination of both approaches might be the most effective. A folder could be considered recent if either a file within it is accessed or the folder itself is explicitly opened. This ensures that both file-centric and folder-centric workflows are captured.

Specific questions regarding folder tracking:

  • What constitutes