chore: saved activity copy updates, go directly back to course settings on save activity (#4482)
This commit is contained in:
parent
48d06e1353
commit
a45c52add4
7 changed files with 26 additions and 106 deletions
|
|
@ -5306,5 +5306,9 @@
|
|||
"joinCourseWithCode": "Join course with code",
|
||||
"joinPublicCourse": "Join public course",
|
||||
"vocabLevelsDesc": "This is where vocab words will go once you’ve leveled them up!",
|
||||
"highlightVocabTooltip": "Highlight target vocab words below by sending them or practicing with them in the chat"
|
||||
"highlightVocabTooltip": "Highlight target vocab words below by sending them or practicing with them in the chat",
|
||||
"activityAnalyticsTooltipBody": "These are your saved activities for review and practice.",
|
||||
"numSavedActivities": "Number of saved activities",
|
||||
"saveActivityTitle": "Save activity",
|
||||
"saveActivityDesc": "Good job! Save this activity for later review and practice"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,11 +67,11 @@ class ChatListViewBody extends StatelessWidget {
|
|||
// final publicRooms = controller.roomSearchResult?.chunk
|
||||
// .where((room) => room.roomType != 'm.space')
|
||||
// .toList();
|
||||
// final publicSpaces = controller.roomSearchResult?.chunk
|
||||
// .where((room) => room.roomType == 'm.space')
|
||||
// .toList();
|
||||
// final userSearchResult = controller.userSearchResult;
|
||||
// Pangea#
|
||||
final publicSpaces = controller.roomSearchResult?.chunk
|
||||
.where((room) => room.roomType == 'm.space')
|
||||
.toList();
|
||||
final userSearchResult = controller.userSearchResult;
|
||||
const dummyChatCount = 4;
|
||||
final filter = controller.searchController.text.toLowerCase();
|
||||
return StreamBuilder(
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import 'package:fluffychat/config/themes.dart';
|
|||
import 'package:fluffychat/l10n/l10n.dart';
|
||||
import 'package:fluffychat/pages/chat/chat.dart';
|
||||
import 'package:fluffychat/pangea/activity_sessions/activity_room_extension.dart';
|
||||
import 'package:fluffychat/pangea/activity_sessions/activity_session_chat/saved_activity_analytics_dialog.dart';
|
||||
import 'package:fluffychat/pangea/activity_summary/activity_summary_model.dart';
|
||||
import 'package:fluffychat/pangea/common/widgets/error_indicator.dart';
|
||||
import 'package:fluffychat/widgets/future_loading_dialog.dart';
|
||||
|
|
@ -28,18 +27,9 @@ class ActivityFinishedStatusMessage extends StatelessWidget {
|
|||
);
|
||||
|
||||
if (!resp.isError) {
|
||||
final navigate = await showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const SavedActivityAnalyticsDialog();
|
||||
},
|
||||
context.push(
|
||||
"/rooms/spaces/${controller.room.courseParent!.id}/details?tab=course",
|
||||
);
|
||||
|
||||
if (navigate == true && controller.room.courseParent != null) {
|
||||
context.push(
|
||||
"/rooms/spaces/${controller.room.courseParent!.id}/details?tab=course",
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -130,7 +120,14 @@ class ActivityFinishedStatusMessage extends StatelessWidget {
|
|||
child: Text(L10n.of(context).requestSummaries),
|
||||
),
|
||||
],
|
||||
if (!controller.room.hasArchivedActivity)
|
||||
if (!controller.room.hasArchivedActivity) ...[
|
||||
Text(
|
||||
L10n.of(context).saveActivityDesc,
|
||||
style: const TextStyle(
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
|
|
@ -149,12 +146,13 @@ class ActivityFinishedStatusMessage extends StatelessWidget {
|
|||
children: [
|
||||
const Icon(Icons.radar, size: 20.0),
|
||||
Text(
|
||||
L10n.of(context).saveToCompletedActivities,
|
||||
L10n.of(context).saveActivityTitle,
|
||||
style: const TextStyle(fontSize: 12.0),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
]
|
||||
: [
|
||||
Text(
|
||||
|
|
|
|||
|
|
@ -1,84 +0,0 @@
|
|||
import 'dart:ui';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/l10n/l10n.dart';
|
||||
import 'package:fluffychat/pangea/analytics_page/analytics_page_constants.dart';
|
||||
|
||||
class SavedActivityAnalyticsDialog extends StatelessWidget {
|
||||
const SavedActivityAnalyticsDialog({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return BackdropFilter(
|
||||
filter: ImageFilter.blur(sigmaX: 2.5, sigmaY: 2.5),
|
||||
child: Dialog(
|
||||
backgroundColor: theme.colorScheme.surfaceContainerHigh,
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 450.0,
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
spacing: 16.0,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Column(
|
||||
spacing: 10.0,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
L10n.of(context).niceJob,
|
||||
style: theme.textTheme.headlineSmall,
|
||||
),
|
||||
Text(
|
||||
L10n.of(context).activityCompletedDesc,
|
||||
textAlign: TextAlign.center,
|
||||
style: theme.textTheme.bodyMedium,
|
||||
),
|
||||
],
|
||||
),
|
||||
CachedNetworkImage(
|
||||
imageUrl:
|
||||
"${AppConfig.assetsBaseURL}/${AnalyticsPageConstants.dinoBotFileName}",
|
||||
errorWidget: (context, e, s) => const SizedBox.shrink(),
|
||||
progressIndicatorBuilder: (context, _, __) =>
|
||||
const SizedBox.shrink(),
|
||||
width: 150.0,
|
||||
),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: theme.colorScheme.primaryContainer,
|
||||
foregroundColor: theme.colorScheme.onPrimaryContainer,
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
child: Row(
|
||||
spacing: 4.0,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(Icons.map_outlined, size: 12.0),
|
||||
Text(
|
||||
L10n.of(context).continueText,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -99,7 +99,7 @@ extension AnalyticsSummaryEnumExtension on SpaceAnalyticsSummaryEnum {
|
|||
case SpaceAnalyticsSummaryEnum.numChoicesIncorrect:
|
||||
return l10n.numIncorrectChoices;
|
||||
case SpaceAnalyticsSummaryEnum.numCompletedActivities:
|
||||
return l10n.numCompletedActivities;
|
||||
return l10n.numSavedActivities;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ extension InstructionsEnumExtension on InstructionsEnum {
|
|||
case InstructionsEnum.morphAnalyticsList:
|
||||
return l10n.morphAnalyticsListBody;
|
||||
case InstructionsEnum.activityAnalyticsList:
|
||||
return l10n.activityAnalyticsListBody;
|
||||
return l10n.activityAnalyticsTooltipBody;
|
||||
case InstructionsEnum.readingAssistanceOverview:
|
||||
return l10n.readingAssistanceOverviewBody;
|
||||
case InstructionsEnum.emptyChatWarning:
|
||||
|
|
|
|||
|
|
@ -162,7 +162,9 @@ class PracticeSelection {
|
|||
|
||||
//remove duplicates
|
||||
final seenTexts = <String>{};
|
||||
tokens.retainWhere((token) => seenTexts.add(token.text.content.toLowerCase()));
|
||||
tokens.retainWhere(
|
||||
(token) => seenTexts.add(token.text.content.toLowerCase()),
|
||||
);
|
||||
|
||||
if (tokens.length > 8) {
|
||||
// Remove the last third (floored) of tokens, only greater than 8 items so at least 5 remain
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue