2233 usability test todos (#2261)

* chore: always get span details on press why button

* chore: increase construct XP needs to show notification

* chore: don't give mouse feedback in IGC button does nothing
This commit is contained in:
ggurdin 2025-03-28 15:46:07 -04:00 committed by GitHub
parent 5a97d4a2b9
commit 162a264cf5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 30 additions and 19 deletions

View file

@ -144,9 +144,7 @@ class MorphFeatureBox extends StatelessWidget {
morphFeature: morphFeature,
morphTag: morphTag,
constructAnalytics: analytics,
onTap: analytics.points > 10
? () => onConstructZoom(id)
: null,
onTap: () => onConstructZoom(id),
);
},
)
@ -185,7 +183,7 @@ class MorphTagChip extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final unlocked = constructAnalytics.points > 10;
final unlocked = constructAnalytics.points > 0;
return InkWell(
borderRadius: BorderRadius.circular(AppConfig.borderRadius),

View file

@ -45,7 +45,7 @@ class ConstructListModel {
0,
(total, match) => total + match.points,
);
if (totalPoints > 10) {
if (totalPoints > 25) {
unlocked.add(matches.first.id);
}
}

View file

@ -85,7 +85,7 @@ class LearningProgressIndicatorsState
int uniqueLemmas(ProgressIndicatorEnum indicator) {
switch (indicator) {
case ProgressIndicatorEnum.morphsUsed:
return _constructsModel.unlockedGrammarLemmas.length;
return _constructsModel.grammarLemmas;
case ProgressIndicatorEnum.wordsUsed:
return _constructsModel.vocabLemmas;
default:

View file

@ -166,7 +166,7 @@ class ITController {
} else {
nextITStep = Completer<CurrentITStep?>();
final nextStep = await getNextTranslationData();
nextITStep!.complete(nextStep);
nextITStep?.complete(nextStep);
}
} catch (e, s) {
debugger(when: kDebugMode);

View file

@ -73,9 +73,12 @@ class SpanDataController {
normalizeString(correctChoice) == normalizeString(errorSpan);
}
Future<void> getSpanDetails(int matchIndex) async {
Future<void> getSpanDetails(
int matchIndex, {
bool force = false,
}) async {
final SpanData? span = _getSpan(matchIndex);
if (span == null || isNormalizationError(matchIndex)) return;
if (span == null || (isNormalizationError(matchIndex) && !force)) return;
final req = SpanDetailsRepoReqAndRes(
userL1: choreographer.l1LangCode!,

View file

@ -115,7 +115,7 @@ class SpanCardState extends State<SpanCard> {
}
}
Future<void> getSpanDetails() async {
Future<void> getSpanDetails({bool force = false}) async {
try {
if (widget.scm.pangeaMatch?.isITStart ?? false) return;
@ -124,8 +124,10 @@ class SpanCardState extends State<SpanCard> {
fetchingData = true;
});
await widget.scm.choreographer.igc.spanDataController
.getSpanDetails(widget.scm.matchIndex);
await widget.scm.choreographer.igc.spanDataController.getSpanDetails(
widget.scm.matchIndex,
force: force,
);
if (mounted) {
setState(() => fetchingData = false);
@ -450,7 +452,7 @@ class PromptAndFeedback extends StatelessWidget {
WhyButton(
onPress: () {
if (!controller.fetchingData) {
controller.getSpanDetails();
controller.getSpanDetails(force: true);
}
},
loading: controller.fetchingData,

View file

@ -67,6 +67,11 @@ class StartIGCButtonState extends State<StartIGCButton>
}
}
bool get _enableFeedback {
return assistanceState != AssistanceState.fetching &&
assistanceState != AssistanceState.complete;
}
Future<void> _onTap() async {
switch (assistanceState) {
case AssistanceState.noSub:
@ -108,13 +113,16 @@ class StartIGCButtonState extends State<StartIGCButton>
Widget build(BuildContext context) {
return SizedBox(
child: InkWell(
onTap: _onTap,
enableFeedback: _enableFeedback,
onTap: _enableFeedback ? _onTap : null,
customBorder: const CircleBorder(),
onLongPress: () => showDialog(
context: context,
builder: (c) => const SettingsLearning(),
barrierDismissible: false,
),
onLongPress: _enableFeedback
? () => showDialog(
context: context,
builder: (c) => const SettingsLearning(),
barrierDismissible: false,
)
: null,
child: Stack(
alignment: Alignment.center,
children: [