pub fn collect_context_items(
include_defaults: bool,
caps: ContextMenuCaps,
hook_rows: Vec<Vec<ContextMenuItem>>,
) -> Vec<ContextMenuItem>Expand description
Merges defaults with hook-contributed rows.
- When
include_defaultsis false, only hook rows are used. - Hook rows append in order after the defaults.
- A hook row whose
idmatches a default (or an earlier hook row) replaces it in place, keeping the original position. - The trailing divider on the defaults block is dropped when no hook rows follow, so a defaults-only menu has no stray separator.