CnActionsMenu
CnActionsMenu is the shared … overflow Actions menu that renders the canonical built-in action trio used across every Conduction surface:
- Refresh
- Documentation (only when a
documentationUrlis supplied) - Request a feature
It also auto-mounts the CnSuggestFeatureModal for the Request-a-feature default. It's used internally by CnWidgetWrapper (per-widget menu) and by the page-level headers of CnDetailPage and CnDashboardPage, so widgets and pages stay in lockstep. CnActionsBar (list pages) mirrors the same items inline.
Most apps never instantiate CnActionsMenu directly — they configure it through the host component's props (documentation-url, show-refresh, show-request-feature, …). Reach for it directly only when building a new surface that needs the same trio.
Behaviour
- Refresh — emits
@refreshwith{ widgetId, title }. Unless a host listener callsevent.preventDefault()on the second handler argument, it then emits on the@nextcloud/event-buschannel named byrefreshChannel(cn:widget:refreshfor widgets,cn:page:refreshfor pages). - Documentation — rendered as an
NcActionLinkonly whendocumentationUrlis non-empty. Opens the link in a new tab (target="_blank"+rel="noopener noreferrer"); there is no JS handler. - Request a feature — emits
@request-featurewith{ widgetId, title }, then (unless suppressed) opensCnSuggestFeatureModalwithapp + page + surfacecontext auto-filled from thecnAppId/cnFeatureRequestRepoinjects provided byCnAppRoot. Without a resolvable repo it logs a one-lineconsole.warnand skips opening.
The overflow trigger hides itself entirely when no built-in item is visible and no #action-items slot content is supplied.
The data-testids are derived from testidBase: <base>-actions (container), <base>-action-refresh, <base>-action-documentation, <base>-action-request-feature. Each host passes its own base (e.g. cn-widget-wrapper, cn-detail-page).
Usage
<CnActionsMenu
:widget-id="resolvedId"
:title="title"
:surface="`detail:${resolvedId}`"
:documentation-url="documentationUrl"
refresh-channel="cn:page:refresh"
testid-base="cn-detail-page"
@refresh="onRefresh"
@request-feature="onRequestFeature">
<template #action-items>
<NcActionButton @click="…">Custom action</NcActionButton>
</template>
</CnActionsMenu>
Slots
| Slot | Description |
|---|---|
action-items | Additional NcActionButton-family items appended inside the overflow menu, after the built-in Refresh / Documentation / Request-a-feature group. |
Labels & state props
| Prop | Default | Description |
|---|---|---|
documentationLabel | t('Documentation') | Pre-translated label for the Documentation item. |
refreshLabel | t('Refresh') | Pre-translated label for the Refresh item. |
requestFeatureLabel | t('Request a feature') | Pre-translated label for the Request-a-feature item. |
actionsMenuLabel | t('Actions') | Pre-translated aria-label / tooltip for the overflow trigger. |
refreshing | false | When bound, the Refresh icon spins while true. |
optimisticSpinMs | 800 | Optimistic Refresh-icon spin duration when refreshing is unbound. |
specRef | '' | Forwarded to the auto-mounted CnSuggestFeatureModal. |