Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 16, 2025

Adds support for navigating up the folder hierarchy in iOS/macOS photo albums. Users can now retrieve parent folders for any album or folder to enable breadcrumb navigation and upward traversal in nested album structures.

Changes

Public API

  • Added AssetPathEntity.getParentPathList() method that returns parent folders containing the current album/folder
  • Returns empty list for Android/OpenHarmony (not supported) and system albums (Recent, All Photos)

iOS/macOS Implementation

  • Implemented using PHCollectionList.fetchCollectionListsContainingCollection:options:
  • Handles both PHAssetCollection (albums) and PHCollectionList (folders) as input
  • Mirrors existing getSubPathList() implementation pattern

Usage

// Get parent folders for an album
final album = await PhotoManager.getAssetPathList();
final parents = await album.first.getParentPathList();

// Build breadcrumb navigation
List<AssetPathEntity> breadcrumb = [currentFolder];
var current = currentFolder;
while (true) {
  final parents = await current.getParentPathList();
  if (parents.isEmpty) break;
  current = parents.first;
  breadcrumb.insert(0, current);
}
print('Path: ${breadcrumb.map((p) => p.name).join(' > ')}');
// Output: "Root Folder > Sub Folder > My Album"

Resolves user-created album parent folder navigation requirements for iOS/macOS.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature request] iOS Parent folder collections for user created albums</issue_title>
<issue_description>### Platforms

iOS, macOS

Description

In case of iOS, an AssetEntityPath for a user created album can be part of a folder.
It will be nice to have an option to get list of parent folders for that AssetEntityPath

https://developer.apple.com/documentation/photos/phcollectionlist/fetchcollectionlists(withlocalidentifiers:options:)?changes=_6

Why

We want to show nested folders and allow to user to go back to parent folder.</issue_description>

Comments on the Issue (you are @copilot in this section)

@fluttercandies-dev **AI Summary:** The user requests a feature to retrieve a list of parent folders for user-created albums in iOS, enabling navigation of nested album structures.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Nov 16, 2025
- Added AssetPathEntity.getParentPathList() public API method
- Implemented getParentPathWithId in PMManager (Objective-C)
- Added method handler in PMPlugin
- Added plugin method getParentPathEntities
- Updated CHANGELOG.md with new feature

Co-authored-by: AlexV525 <[email protected]>
Copilot AI changed the title [WIP] Add option to retrieve parent folders for user albums Add iOS/macOS parent folder navigation for AssetPathEntity Nov 16, 2025
Copilot AI requested a review from AlexV525 November 16, 2025 04:24
Copilot finished work on behalf of AlexV525 November 16, 2025 04:24
@github-actions
Copy link

Download apk from here for 47c4f0b

@AlexV525
Copy link
Member

@ua741 Could you help to verify if this is working as intended?

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.

[Feature request] iOS Parent folder collections for user created albums

2 participants