You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Modes don’t trigger for collections reached through variable aliases #770
The Modes section detects collections bound directly to a component, but not multi-mode collections reached through variable aliases.
For example, a component is bound to a variable in a single-mode semantic collection. That variable aliases a Density collection with Regular and Compact modes and different values. Figma resolves both modes, but the generated spec omits Density.
Solution
Modes detection should follow variable aliases and include any referenced collection with two or more modes that affect the component’s resolved values.
Acceptance criteria
Aliased multi-mode collections appear in the Modes section.
Each mode receives its own exhibit.
Existing detection for directly bound collections continues to work unchanged.
@ncorbohudak-png Thanks for submitting! Yes, this is a gap in the plugin output, and I've grappled with this before. As in, before AI, when the complicatedness inhibited my capacity to solve it. It's worth another look now.
I'll take at least an analysis look at this next week.
Analysis complete; the report is confirmed and planned for a fix. The Modes generator records only each bound variable's own collection and never inspects the variable's valuesByMode, so an alias into a multi-mode collection is invisible to detection.
Planned fix (plugin-side only):
Alias traversal. From every variable the component references, follow VARIABLE_ALIAS values across all modes, breadth-first, with visited sets so no variable or collection is evaluated twice. Every reachable collection with 2+ modes joins the Modes section; the existing filter, ordering, and per-mode exhibits are unchanged, so directly bound collections behave exactly as before.
Variant-aware exhibits. Exhibits currently always render the default variant. The fix tracks which variants reference each detected collection's variables and renders a variant that actually uses one — the default variant when it qualifies, otherwise the simplest variant that does — so each mode exhibit visibly changes.
Tests. The traversal and variant selection are pure, unit-tested functions; mode behavior is verified in Figma with a single-mode semantic collection aliasing a multi-mode collection, including the case where only a non-default variant carries the alias.
Performance expectation: traversal adds one variable lookup per unique variable in the alias graph (memoized), which should be negligible; any noticeable slowdown would come from the additional exhibits the newly detected collections legitimately add.
Activity
nathanacurtis commentedon Oct 16, 2026
@ncorbohudak-png Thanks for submitting! Yes, this is a gap in the plugin output, and I've grappled with this before. As in, before AI, when the complicatedness inhibited my capacity to solve it. It's worth another look now.
I'll take at least an analysis look at this next week.
nathanacurtis commentedon Oct 16, 2026
Analysis complete; the report is confirmed and planned for a fix. The Modes generator records only each bound variable's own collection and never inspects the variable's
valuesByMode, so an alias into a multi-mode collection is invisible to detection.Planned fix (plugin-side only):
VARIABLE_ALIASvalues across all modes, breadth-first, with visited sets so no variable or collection is evaluated twice. Every reachable collection with 2+ modes joins the Modes section; the existing filter, ordering, and per-mode exhibits are unchanged, so directly bound collections behave exactly as before.Performance expectation: traversal adds one variable lookup per unique variable in the alias graph (memoized), which should be negligible; any noticeable slowdown would come from the additional exhibits the newly detected collections legitimately add.
The full implementation plan is saved internally.