Skip to content

Commit

Permalink
Merge branch 'main' into ellipses-on-text-overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ggurdin committed May 27, 2024
2 parents a72197c + ad5275c commit de44317
Show file tree
Hide file tree
Showing 41 changed files with 1,885 additions and 572 deletions.
66 changes: 9 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Pangea Chat Client Setup:
# Overview

* Download VSCode if you do not already have it installed
[Pangea Chat](https://pangea.chat) is a web and mobile platform which lets students ‘learn a language while texting their friends.’ Addressing the gap in communicative language teaching, especially for beginners lacking skill and confidence, Pangea Chat provides a low-stress, high-support environment for language learning through authentic conversations. By integrating human and artificial intelligence, the app enhances communicative abilities and supports educators. Pangea Chat has been grant funded by the National Science Foundation and Virginia Innovation Partnership Corporation based on its technical innovation and potential for broad social impact. Our mission is to build a global, decentralized learning network supporting intercultural learning and exchange.

# Pangea Chat Client Setup

* Download VSCode if you do not already have it installed. This is the preferred IDE for development with Pangea Chat.
* Download flutter on your device using this guide: https://docs.flutter.dev/get-started/install
* Test to make sure that flutter is properly installed by running “flutter –version”
* You may need to add flutter to your path manually. Instructions can be found here: https://docs.flutter.dev/get-started/install/macos/mobile-ios?tab=download#add-flutter-to-your-path
Expand All @@ -14,7 +18,7 @@ Pangea Chat Client Setup:
* Run “brew install cocoapods” to install cocoapods
* Run “flutter doctor” and for any missing components, follow the instructions from the print out to install / setup
* Clone the client repo
* Copy the .env file (and the .env.prod file, if you want to run production builds), into the root folder of the client and the assets/ folder
* Copy the .env file (and the .env.prod file, if you want to run production builds), into the root folder of the client and the assets/ folder. Contact Gabby for a copy of this file.
* Uncomment the lines in the pubspec.yaml file in the assets section with paths to .env file
* To run on iOS:
* Run “flutter precache --ios”
Expand All @@ -25,62 +29,10 @@ Pangea Chat Client Setup:
* On web, run `flutter run -d chrome –hot`
* On mobile device or simulator, run `flutter run –hot -d <DEVICE_NAME>`

![Screenshot](https://github.com/krille-chan/fluffychat/blob/main/assets/banner_transparent.png?raw=true)

[FluffyChat](https://fluffychat.im) is an open source, nonprofit and cute [[matrix](https://matrix.org)] client written in [Flutter](https://flutter.dev). The goal of the app is to create an easy to use instant messenger which is open source and accessible for everyone.

### Links:

- 🌐 [[Weblate] Translate FluffyChat into your language](https://hosted.weblate.org/projects/fluffychat/)
- 🌍 [[m] Join the community](https://matrix.to/#/#fluffychat:matrix.org)
- 📰 [[Mastodon] Get updates on social media](https://mastodon.art/@krille)
- 🖥️ [[Famedly] Server hosting and professional support](https://famedly.com/kontakt)
- 💝 [[Liberapay] Support FluffyChat development](https://de.liberapay.com/KrilleChritzelius)

<a href='https://ko-fi.com/C1C86VN53' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://storage.ko-fi.com/cdn/kofi5.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>

### Screenshots:

![Screenshot](https://github.com/krille-chan/fluffychat/blob/main/docs/screenshots/product.jpeg?raw=true)

# Features

- 📩 Send all kinds of messages, images and files
- 🎙️ Voice messages
- 📍 Location sharing
- 🔔 Push notifications
- 💬 Unlimited private and public group chats
- 📣 Public channels with thousands of participants
- 🛠️ Feature rich group moderation including all matrix features
- 🔍 Discover and join public groups
- 🌙 Dark mode
- 🎨 Material You design
- 📟 Hides complexity of Matrix IDs behind simple QR codes
- 😄 Custom emotes and stickers
- 🌌 Spaces
- 🔄 Compatible with Element, Nheko, NeoChat and all other Matrix apps
- 🔐 End to end encryption
- 🔒 Encrypted chat backup
- 😀 Emoji verification & cross signing

... and much more.


# Installation

Please visit the website for installation instructions:

- https://fluffychat.im

# How to build

Please visit the [Wiki](https://github.com/krille-chan/fluffychat/wiki) for build instructions:

- https://github.com/krille-chan/fluffychat/wiki/How-To-Build


# Special thanks

* Pangea Chat is a fork of [FluffyChat](https://fluffychat.im), is an open source, nonprofit and cute [[matrix](https://matrix.org)] client written in [Flutter](https://flutter.dev). The goal of FluffyChat is to create an easy to use instant messenger which is open source and accessible for everyone. You can [support the primary maker of FluffyChat directly here.](https://ko-fi.com/C1C86VN53)

* <a href="https://github.com/fabiyamada">Fabiyamada</a> is a graphics designer and has made the fluffychat logo and the banner. Big thanks for her great designs.

* <a href="https://github.com/advocatux">Advocatux</a> has made the Spanish translation with great love and care. He always stands by my side and supports my work with great commitment.
Expand Down
15 changes: 15 additions & 0 deletions assets/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -3945,6 +3945,21 @@
"accuracy": "Accuracy",
"points": "Points",
"noPaymentInfo": "No payment info necessary!",
"conversationBotModeSelectDescription": "Bot mode",
"conversationBotModeSelectOption_discussion": "Discussion",
"conversationBotModeSelectOption_custom": "Custom",
"conversationBotModeSelectOption_conversation": "Conversation",
"conversationBotModeSelectOption_textAdventure": "Text Adventure",
"conversationBotDiscussionZone_title": "Discussion Settings",
"conversationBotDiscussionZone_discussionTopicLabel": "Discussion Topic",
"conversationBotDiscussionZone_discussionTopicPlaceholder": "Set Discussion Topic",
"conversationBotDiscussionZone_discussionKeywordsLabel": "Discussion Keywords",
"conversationBotDiscussionZone_discussionKeywordsPlaceholder": "Set Discussion Keywords",
"conversationBotDiscussionZone_discussionKeywordsHintText": "Comma separated list of keywords to guide the discussion",
"conversationBotDiscussionZone_discussionTriggerScheduleEnabledLabel": "Send discussion prompt on a schedule",
"conversationBotDiscussionZone_discussionTriggerScheduleHourIntervalLabel": "Hours between discussion prompts",
"conversationBotDiscussionZone_discussionTriggerReactionEnabledLabel": "Send discussion prompt when user reacts ⏩ to bot message",
"conversationBotDiscussionZone_discussionTriggerReactionKeyLabel": "Reaction to send discussion prompt",
"studentAnalyticsNotAvailable": "Student data not currently available",
"roomDataMissing": "Some data may be missing from rooms in which you are not a member.",
"updatePhoneOS": "You may need to update your device's OS version.",
Expand Down
19 changes: 18 additions & 1 deletion assets/l10n/intl_es.arb
Original file line number Diff line number Diff line change
Expand Up @@ -4634,5 +4634,22 @@
"points": "Puntos",
"noPaymentInfo": "No se necesitan datos de pago.",
"updatePhoneOS": "Puede que necesites actualizar la versión del sistema operativo de tu dispositivo.",
"wordsPerMinute": "Palabras por minuto"
"wordsPerMinute": "Palabras por minuto",
"conversationBotModeSelectDescription": "Modo bot",
"conversationBotModeSelectOption_discussion": "Debate",
"conversationBotModeSelectOption_custom": "A medida",
"conversationBotModeSelectOption_conversation": "Conversación",
"conversationBotModeSelectOption_textAdventure": "Aventura textual",
"conversationBotDiscussionZone_title": "Configuración del debate",
"conversationBotDiscussionZone_discussionTopicLabel": "Tema de debate",
"conversationBotDiscussionZone_discussionTopicPlaceholder": "Establecer tema de debate",
"conversationBotDiscussionZone_discussionKeywordsLabel": "Palabras clave del debate",
"conversationBotDiscussionZone_discussionKeywordsPlaceholder": "Establecer palabras clave de debate",
"conversationBotDiscussionZone_discussionKeywordsHintText": "Lista de palabras clave separadas por comas para orientar el debate",
"conversationBotDiscussionZone_discussionTriggerScheduleEnabledLabel": "Enviar mensajes de debate según un calendario",
"conversationBotDiscussionZone_discussionTriggerScheduleHourIntervalLabel": "Horas entre temas de debate",
"conversationBotDiscussionZone_discussionTriggerReactionEnabledLabel": "Enviar aviso de discusión cuando el usuario reacciona ⏩ al mensaje del bot.",
"conversationBotDiscussionZone_discussionTriggerReactionKeyLabel": "Reacción al envío del aviso de debate",
"studentAnalyticsNotAvailable": "Datos de los estudiantes no disponibles actualmente",
"roomDataMissing": "Es posible que falten algunos datos de las salas de las que no es miembro."
}
8 changes: 6 additions & 2 deletions lib/pages/chat/events/message_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class MessageContent extends StatelessWidget {
//further down in the chain is also using pangeaController so its not constant
final bool immersionMode;
final ToolbarDisplayController? toolbarController;
final bool isOverlay;
// Pangea#

const MessageContent(
Expand All @@ -50,6 +51,7 @@ class MessageContent extends StatelessWidget {
this.pangeaMessageEvent,
required this.immersionMode,
required this.toolbarController,
this.isOverlay = false,
// Pangea#
required this.borderRadius,
});
Expand Down Expand Up @@ -203,7 +205,8 @@ class MessageContent extends StatelessWidget {
&&
!(pangeaMessageEvent?.showRichText(
selected,
toolbarController?.highlighted ?? false,
isOverlay: isOverlay,
highlighted: toolbarController?.highlighted ?? false,
) ??
false)
// Pangea#
Expand Down Expand Up @@ -305,7 +308,8 @@ class MessageContent extends StatelessWidget {
);
if (pangeaMessageEvent?.showRichText(
selected,
toolbarController?.highlighted ?? false,
isOverlay: isOverlay,
highlighted: toolbarController?.highlighted ?? false,
) ??
false) {
return PangeaRichText(
Expand Down
5 changes: 5 additions & 0 deletions lib/pages/chat_list/chat_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,11 @@ class ChatListController extends State<ChatList>
while (selectedRoomIds.isNotEmpty) {
final roomId = selectedRoomIds.first;
try {
// #Pangea
if (client.getRoomById(roomId)!.isUnread) {
await client.getRoomById(roomId)!.markUnread(false);
}
// Pangea#
await client.getRoomById(roomId)!.leave();
} finally {
toggleSelection(roomId);
Expand Down
5 changes: 5 additions & 0 deletions lib/pages/chat_list/chat_list_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ class ChatListItem extends StatelessWidget {
message: L10n.of(context)!.archiveRoomDescription,
);
if (confirmed == OkCancelResult.cancel) return;
// #Pangea
if (room.isUnread) {
await room.markUnread(false);
}
// Pangea#
await showFutureLoadingDialog(
context: context,
future: () => room.leave(),
Expand Down
5 changes: 4 additions & 1 deletion lib/pages/chat_list/space_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,10 @@ class _SpaceViewState extends State<SpaceView> {
// #Pangea
// future: room!.leave,
future: () async {
await room!.leave();
if (room!.isUnread) {
await room.markUnread(false);
}
await room.leave();
if (Matrix.of(context).activeRoomId == room.id) {
context.go('/rooms');
}
Expand Down
15 changes: 9 additions & 6 deletions lib/pages/chat_list/utils/on_chat_tap.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import 'package:flutter/material.dart';

import 'package:adaptive_dialog/adaptive_dialog.dart';
import 'package:fluffychat/pages/chat/send_file_dialog.dart';
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
import 'package:fluffychat/widgets/matrix.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:future_loading_dialog/future_loading_dialog.dart';
import 'package:go_router/go_router.dart';
import 'package:matrix/matrix.dart';

import 'package:fluffychat/pages/chat/send_file_dialog.dart';
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
import 'package:fluffychat/widgets/matrix.dart';

void onChatTap(Room room, BuildContext context) async {
if (room.membership == Membership.invite) {
final inviterId =
Expand Down Expand Up @@ -47,6 +45,11 @@ void onChatTap(Room room, BuildContext context) async {
return;
}
if (inviteAction == InviteActions.decline) {
// #Pangea
if (room.isUnread) {
await room.markUnread(false);
}
// Pangea#
await showFutureLoadingDialog(
context: context,
future: room.leave,
Expand Down
24 changes: 0 additions & 24 deletions lib/pangea/choreographer/controllers/analytics_sender.dart

This file was deleted.

6 changes: 5 additions & 1 deletion lib/pangea/choreographer/controllers/igc_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ class IgcController {
),
);

igcTextData!.matches[matchIndex].match = response.span;
try {
igcTextData!.matches[matchIndex].match = response.span;
} catch (err, s) {
ErrorHandler.logError(e: err, s: s);
}

choreographer.setState();
}
Expand Down
27 changes: 13 additions & 14 deletions lib/pangea/choreographer/controllers/it_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import '../../models/it_response_model.dart';
import '../../models/it_step.dart';
import '../../models/system_choice_translation_model.dart';
import '../../repo/interactive_translation_repo.dart';
import '../../repo/message_service.repo.dart';
import 'choreographer.dart';

class ITController {
Expand Down Expand Up @@ -247,19 +246,19 @@ class ITController {
),
);

MessageServiceModel? messageServiceModelWithMessageId() =>
usedInteractiveTranslation
? MessageServiceModel(
classId: choreographer.classId,
roomId: choreographer.roomId,
message: choreographer.currentText,
messageId: null,
payloadIds: payLoadIds,
userId: choreographer.userId!,
l1Lang: sourceLangCode,
l2Lang: targetLangCode,
)
: null;
// MessageServiceModel? messageServiceModelWithMessageId() =>
// usedInteractiveTranslation
// ? MessageServiceModel(
// classId: choreographer.classId,
// roomId: choreographer.roomId,
// message: choreographer.currentText,
// messageId: null,
// payloadIds: payLoadIds,
// userId: choreographer.userId!,
// l1Lang: sourceLangCode,
// l2Lang: targetLangCode,
// )
// : null;

//maybe we store IT data in the same format? make a specific kind of match?
void selectTranslation(int chosenIndex) {
Expand Down
14 changes: 12 additions & 2 deletions lib/pangea/constants/model_keys.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,17 @@ class ModelKey {

// bot options
static const String languageLevel = "difficulty";
static const String conversationTopic = "conversation_topic";
static const String keywords = "keywords";
static const String safetyModeration = "safety_moderation";
static const String mode = "mode";
static const String custom = "custom";
static const String discussionTopic = "discussion_topic";
static const String discussionKeywords = "discussion_keywords";
static const String discussionTriggerScheduleEnabled =
"discussion_trigger_schedule_enabled";
static const String discussionTriggerScheduleHourInterval =
"discussion_trigger_schedule_hour_interval";
static const String discussionTriggerReactionEnabled =
"discussion_trigger_reaction_enabled";
static const String discussionTriggerReactionKey =
"discussion_trigger_reaction_key";
}
Loading

0 comments on commit de44317

Please sign in to comment.