fix: only give user vocab in their L2 and animation tweaks

This commit is contained in:
avashilling 2025-06-26 16:56:19 -04:00
parent bf29b28364
commit 7d92e81f56
2 changed files with 7 additions and 5 deletions

View file

@ -121,7 +121,8 @@ class MessageOverlayController extends State<MessageSelectionOverlay>
newTokens = pangeaMessageEvent?.messageDisplayRepresentation?.tokens
?.where((token) {
return token.lemma.saveVocab == true &&
token.vocabConstruct.uses.isEmpty;
token.vocabConstruct.uses.isEmpty &&
messageInUserL2;
}).toList() ??
[];
}
@ -611,7 +612,6 @@ class MessageOverlayController extends State<MessageSelectionOverlay>
t.text.offset == token.text.offset &&
t.text.length == token.text.length,
);
debugPrint("$token.text has been removed from newTokens list.");
});
}
});

View file

@ -43,10 +43,9 @@ class _NewWordOverlayState extends State<NewWordOverlay>
);
_fadeAnim = CurvedAnimation(
parent: _controller,
curve: const Interval(0.7, 1.0, curve: Curves.easeOut),
curve: const Interval(0.5, 1.0, curve: Curves.easeOut),
);
// Alignment animation: stays center until 0.5, then animates to topRight
_alignmentAnim = AlignmentTween(
begin: Alignment.center,
end: Alignment.topRight,
@ -105,7 +104,10 @@ class _NewWordOverlayState extends State<NewWordOverlay>
translation: _offsetAnim.value,
child: ScaleTransition(
scale: _xpScaleAnim,
child: xpSeedWidget,
child: Transform.scale(
scale: 2 * (1 - _fadeAnim.value),
child: xpSeedWidget,
),
),
),
);