Resolve the panel grob a layer belongs to
Source:R/ggplot2_patchwork_utils.R
find_gtable_panel_grob.RdWithout a panel context this keeps the single-plot behaviour: the cell
literally named "panel". With one, the panel is addressed by
panel_ctx$panel_index into collect_gtable_panels(), whose order matches
find_patchwork_panels(). Name matching is only a fallback because
patchwork reuses panel names across nesting levels.