Skip to main content

Module actions

Module actions 

Source
Expand description

Portable action catalogue.

The shell’s command surfaces (command palette, context palette, radial palette) share a single enumerated vocabulary of actions (ActionId) grouped into logical families (ActionCategory). The pre-M4-slice-1 home for these types was render::action_registry in the graphshell crate, which also carried host-coupled helpers (input-binding lookup, action-registry-driven ActionContext filtering). This module splits off the portable leaves so that downstream portable state — CommandPaletteSession’s Tier 1 selection, the omnibar’s action-match types, future iced-host action-dispatch — can reference the vocabulary without pulling in the host-side registry machinery.

The render-side [render::action_registry] module re-exports the symbols here for zero-churn at call sites; host-coupled helpers (ActionId::shortcut_hints, the ActionContext / ActionEntry filtering surface, the list_actions_for_context resolver) stay alongside the re-exports.

Enums§

ActionCategory
Logical grouping of actions, used for separators and ordering in the command palette and as sector grouping in the radial palette.
ActionId
Stable identifier for a registered action.
InputMode
Preferred input mode, used as a layout hint by control surfaces.

Constants§

CATEGORY_PIN_ORDER_PERSIST_KEY
Persistent-storage key for user-pinned category ordering.
CATEGORY_RECENCY_PERSIST_KEY
Persistent-storage key for the recency ring used by palette ranking.

Functions§

action_id_has_namespace_format
true when id matches the namespace:name key format the registry enforces for cross-surface routing. Both namespace and name must be lowercase ASCII alphanumerics plus _; exactly one : separator; no empty parts.
all_action_ids
Every ActionId variant. Useful for generators (settings UI that lists every keybinding, doc exporters, consistency audits) and the render-side dispatch table that wires each variant’s enabled predicate into the palette context.
category_from_persisted_name
Inverse of category_persisted_name. Returns None for unknown names so callers can decide whether to fall back to a default or surface a diagnostic.
category_persisted_name
Stable machine-readable name for a category. Used when persisting user preferences (pin order, recency ring) across sessions.
default_category_order
Canonical base ordering for action categories in command surfaces. Callers may re-rank based on context, recency, and user pinning; this is the default when no other signal applies.