def resolve_parent(previous, parent):
    """
    Figure out the parent to use based on the previous pane or given parent

    Breadth-based recursion means the previous pane should take precedence
    over the original parent if one is provided

    Parameters
    ----------
    previous
        The previous pane
    parent
        The current parent
    """
    resolved = None

    if previous:
        resolved = previous
    elif parent:
        resolved = parent

    return resolved