Our current folder compare results is a flat list. Every item in the list has a full path of the item.
This is fine and efficient for lots of purposes, but when I'm thinking/planning about new filtering features and showing unique folder contents in recursive compare I have problems to figure out how to implement them. One problem I have is items don't know their parent's status. For example if a folder is filtered, then all items in the folder should be filtered too. With current flat list this is not easy to implement. We'd need to do parse all parent folders of the current item, from possibly huge list of items.
My initial idea is to create a structure for items in folder compare. Structure should be identical to how compared folders are structured. So we'd have items for folders, and these folder items contain (sub)folders and files.
This means some changes to our DIFFITEM:
- folder items link to subfolder and contained file's items
- items link to parent folder's item
- folder items have some addition
In first stage we'd have one list with this structure. Later I think it makes sense to have every folder as its own list. Then we can cache results also in non-recursive compare. And don't need re-compare every time user changes folder.