Skip to content

When navigating back to the parent, the parent is not selected #43

@sarensw

Description

@sarensw

What happened?
When navigating back to the parent, the parent is not selected

How to reproduce it

  • Open archive
  • Navigate to a folder
  • Navigate back to the parent by using ...
  • Check the previously selected folder

This folder should be selected to know where the user came from

System

  • macOS version: any
  • MacPacker version: any

Anything else?

The change probably has to happen in ArchiveTableViewRepresentable.swift here:

if isReloadNeeded {
    let tableView = (nsView.documentView as! NSTableView)
     DispatchQueue.main.async {
         tableView.reloadData()
         isReloadNeeded = false
    }
}

openParent in ArchiveState already sets the correct item

public func openParent() {
    if selectedItem?.type == .root {
        return
    }
    
    let previousItem = selectedItem
    
    selectedItem = selectedItem?.parent
    
    self.isReloadNeeded = true
    
    if let previousItem {
        self.selectedItems = [previousItem]
    } else {
        self.selectedItems = []
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions