Skip to main content

Module context_offer

Module context_offer 

Source
Expand description

Selection-context applicability — kernel-owned show/no-show for the app’s selection context bar.

Each feature module exposes context_applicable(&SelectionProbe) -> bool next to its schema(): the ONE per-feature answer to “does the current selection make creating me meaningful?”. This module only AGGREGATES those functions (the schema.rs pattern) into FEATURE_APPLICABILITY, keyed by the catalogue type string, and the assembly-constraint equivalents live as applicable on each super::assembly::constraints::ConstraintTypeDef.

The probe is a KIND-LEVEL summary — per-kind counts plus a few app-derived roll-up booleans (all_component, all_sheet_metal) that answer ownership questions the raw names would; never the names themselves. Predicates decide eligibility; the app still derives WHICH reference fields to pre-fill from the schema selectionFilters. A feature whose references a selection can never satisfy (primitives, datum-driven splines) simply returns false.

Structs§

SelectionProbe
Kind-level summary of the user’s current selection, handed to each feature’s / constraint’s context_applicable test.

Statics§

FEATURE_APPLICABILITY
Every catalogue feature’s applicability predicate, catalogue order, keyed by the schema type string (super::schema::feature_schema_catalogue — sheet_metal_corner contributes two entries from one module). The paired test keeps this 1:1 with the catalogue.

Functions§

feature_context_applicable
Run feature type_id’s applicability predicate. Unknown type → false (nothing is offered for a feature the registry does not know).