Summary
FortalAvatar cannot safely render its default icon path because the recipe multiplies an unresolved Mix numeric token reference by 0.5.
Found while validating #80 at b16636b017f3c8832d8f27f316cc24c0ad92ce8a.
Evidence
fortal_avatar_styles.dart computes:
.icon(.size(_fortalAvatarDimension(size) * 0.5))
Every _fortalAvatarDimension branch returns a numeric Fortal token reference. Mix represents unresolved double references with registered negative sentinels; arithmetic produces a new unregistered value instead of a derived token.
A focused widget test captures -5e-7 for size 2 rather than the intended 16:
testWidgets('FortalAvatar resolves a valid icon size', (tester) async {
double? resolvedSize;
await tester.pumpRemixApp(
FortalAvatar(
size: FortalAvatarSize.size2,
icon: Icons.person,
iconBuilder: (context, spec, icon) {
resolvedSize = spec.size;
return const SizedBox.shrink();
},
),
);
expect(resolvedSize, greaterThanOrEqualTo(0)); // actual: -5e-7
});
Without iconBuilder, Icon(size: -5e-7) reaches Flutter and throws because the generated BoxConstraints has a negative minimum width/height.
This reproduces with:
- consumer Mix
2.2.0-beta.1;
- the Remix workspace override at Mix revision
07dafe904e56a9b60a172f4ef1863cf45564603a.
The same PR head contains no other Fortal recipe expression that performs arithmetic on a numeric token reference.
Expected
All Fortal avatar sizes resolve a finite, nonnegative icon size that preserves FortalThemeConfig.scaling.
Suggested direction
- Add explicit scaled avatar-icon-size tokens, or another token-preserving derived-value mechanism.
- Avoid ordinary arithmetic on unresolved sentinel-backed token references.
- Add default-icon widget coverage for every Fortal avatar size.
- Add a source/parity check that rejects numeric token arithmetic in Fortal recipes.
Acceptance criteria
Ownership
This is a Remix/Fortal recipe defect, not a Mix interpolation defect. Mix correctly resolves registered token references; the recipe discards that identity before resolution.
Summary
FortalAvatarcannot safely render its default icon path because the recipe multiplies an unresolved Mix numeric token reference by0.5.Found while validating #80 at
b16636b017f3c8832d8f27f316cc24c0ad92ce8a.Evidence
fortal_avatar_styles.dartcomputes:Every
_fortalAvatarDimensionbranch returns a numeric Fortal token reference. Mix represents unresolved double references with registered negative sentinels; arithmetic produces a new unregistered value instead of a derived token.A focused widget test captures
-5e-7for size 2 rather than the intended 16:Without
iconBuilder,Icon(size: -5e-7)reaches Flutter and throws because the generatedBoxConstraintshas a negative minimum width/height.This reproduces with:
2.2.0-beta.1;07dafe904e56a9b60a172f4ef1863cf45564603a.The same PR head contains no other Fortal recipe expression that performs arithmetic on a numeric token reference.
Expected
All Fortal avatar sizes resolve a finite, nonnegative icon size that preserves
FortalThemeConfig.scaling.Suggested direction
Acceptance criteria
FortalAvatar(icon: ...)builds without an exception for sizes 1–9.iconBuilderreceive the same valid geometry.Ownership
This is a Remix/Fortal recipe defect, not a Mix interpolation defect. Mix correctly resolves registered token references; the recipe discards that identity before resolution.