From 631d751887e457957400e77680d406f768119816 Mon Sep 17 00:00:00 2001 From: William Jordan-Cooley Date: Wed, 19 Jun 2024 15:33:52 -0400 Subject: [PATCH 1/6] documentation in choreo record --- lib/pangea/models/choreo_record.dart | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/lib/pangea/models/choreo_record.dart b/lib/pangea/models/choreo_record.dart index 3422a76a2..413f00716 100644 --- a/lib/pangea/models/choreo_record.dart +++ b/lib/pangea/models/choreo_record.dart @@ -247,22 +247,27 @@ class ChoreoRecord { choreoSteps.isNotEmpty ? choreoSteps.last.text : ""; } -/// new step are saved +/// A new ChoreoRecordStep is saved in the following cases: /// 1) before every system-provided text is accepted, if final text is different /// from last step /// 2) on the acceptance of system-provided text /// 3) on message send, if final text is different from last step +/// 4) on the acceptance of an it step +/// 5) on the start of it /// -/// user edit -/// "hey ther" +/// Example 1: +/// the user types "hey ther" +/// IGC suggests "there" /// user accepts "there" correction -/// "hey there" -/// step made for user edits and step made for system suggestion -/// user goes through IT, chooses "hola" -/// "hola" -/// step saved -/// adds "amigo" -/// step saved +/// text is now "hey there" +/// A step is made for the original input 'hey there' and a step is made for system suggestion +/// +/// Example 2: +/// user write "hi friend" +/// a step is made for the original input 'hi friend' +/// the user selects IT and a step is made +/// the user chooses "hola" and a step is saved +/// adds "amigo" and a step saved class ChoreoRecordStep { /// text after changes have been made String text; From 17c95baacbfc550e26dc2eea11eb4327b5bf6c71 Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Thu, 20 Jun 2024 00:28:07 +0200 Subject: [PATCH 2/6] Sentry using dart --- .github/workflows/main_deploy.yaml | 43 +++++++----------------------- pubspec.yaml | 1 + scripts/upload-sentry.sh | 23 ---------------- sentry.properties | 6 +++++ 4 files changed, 17 insertions(+), 56 deletions(-) delete mode 100755 scripts/upload-sentry.sh create mode 100644 sentry.properties diff --git a/.github/workflows/main_deploy.yaml b/.github/workflows/main_deploy.yaml index bb3bdf93d..03f80fedf 100644 --- a/.github/workflows/main_deploy.yaml +++ b/.github/workflows/main_deploy.yaml @@ -28,55 +28,32 @@ jobs: run: ./scripts/prepare-web.sh - name: Build Release Web run: ./scripts/build-web.sh + - name: Upload files uses: actions/upload-artifact@v3 with: name: web path: build/web - deploy_web: - runs-on: ubuntu-latest - needs: build_web - environment: staging - steps: - - name: Download web - uses: actions/download-artifact@v3 - with: - name: web - path: build/web - - name: Update Website files - run: | - mv build/web public - touch public/.env - echo "$WEB_APP_ENV" >> public/.env - cp public/.env public/assets/.env - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - with: - personal_token: ${{ secrets.PAGES_DEPLOY_TOKEN }} - publish_dir: ./public - publish_branch: gh-pages - cname: app.staging.pangea.chat - update_sentry: runs-on: ubuntu-latest needs: build_web environment: staging env: SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - SENTRY_BASE_TOKEN: ${{ secrets.SENTRY_BASE_TOKEN }} - SENTRY_ORG: ${{ secrets.SENTRY_ORG }} - SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} - CI_COMMIT_SHA: ${{ github.sha }} + SENTRY_RELEASE: ${{ github.sha }} + SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT }} + SENTRY_ORG: ${{ vars.SENTRY_ORG }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + - run: cat .github/workflows/versions.env >> $GITHUB_ENV + - uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ env.FLUTTER_VERSION }} - name: Download web uses: actions/download-artifact@v3 with: name: web path: build/web - - name: Install sentry CLI - run: | - curl -sL https://sentry.io/get-cli/ | bash - name: Update sentry - run: ./scripts/upload-sentry.sh + run: flutter packages pub run sentry_dart_plugin diff --git a/pubspec.yaml b/pubspec.yaml index 0c3b2faac..da58c6ac8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -136,6 +136,7 @@ dev_dependencies: sdk: flutter license_checker: ^1.6.0 msix: ^3.6.2 + sentry_dart_plugin: ^1.0.0 translations_cleaner: ^0.0.5 flutter_native_splash: diff --git a/scripts/upload-sentry.sh b/scripts/upload-sentry.sh deleted file mode 100755 index 13f6f47d3..000000000 --- a/scripts/upload-sentry.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -ve - -# Build a release version of the app for a platform and upload symbols -export OUTPUT_FOLDER_WEB=./build/web/ -export SENTRY_RELEASE=$CI_COMMIT_SHA -export SENTRY_PROJECT="${SENTRY_PROJECT:-client}" -export SENTRY_ORG="${SENTRY_ORG:-pangea-chat}" - -echo "[run] Uploading sourcemaps for $SENTRY_RELEASE" -echo "[run] $SENTRY_PROJECT @ $SENTRY_ORG / $OUTPUT_FOLDER_WEB" -sentry-cli releases new $SENTRY_RELEASE --org $SENTRY_ORG -sentry-cli releases set-commits $CI_COMMIT_SHA --auto -sentry-cli releases files $SENTRY_RELEASE upload-sourcemaps . \ - --ext dart \ - --rewrite - -(cd $OUTPUT_FOLDER_WEB -sentry-cli releases files $SENTRY_RELEASE upload-sourcemaps . \ - --ext map \ - --ext js \ - --rewrite) - -sentry-cli releases finalize $SENTRY_RELEASE diff --git a/sentry.properties b/sentry.properties new file mode 100644 index 000000000..876598ba5 --- /dev/null +++ b/sentry.properties @@ -0,0 +1,6 @@ +upload_debug_symbols=true +upload_source_maps=true +upload_sources=true +wait_for_processing=false +log_level=info +commits=auto From 5b923ca0555d2ac9179f7764ffe70ff414facd2e Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Thu, 20 Jun 2024 00:28:59 +0200 Subject: [PATCH 3/6] added back deploy web --- .github/workflows/main_deploy.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/main_deploy.yaml b/.github/workflows/main_deploy.yaml index 03f80fedf..4dade8221 100644 --- a/.github/workflows/main_deploy.yaml +++ b/.github/workflows/main_deploy.yaml @@ -35,6 +35,30 @@ jobs: name: web path: build/web + deploy_web: + runs-on: ubuntu-latest + needs: build_web + environment: staging + steps: + - name: Download web + uses: actions/download-artifact@v3 + with: + name: web + path: build/web + - name: Update Website files + run: | + mv build/web public + touch public/.env + echo "$WEB_APP_ENV" >> public/.env + cp public/.env public/assets/.env + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + personal_token: ${{ secrets.PAGES_DEPLOY_TOKEN }} + publish_dir: ./public + publish_branch: gh-pages + cname: app.staging.pangea.chat + update_sentry: runs-on: ubuntu-latest needs: build_web From 3ffdd6f26476b725609043af203028a30af16b3c Mon Sep 17 00:00:00 2001 From: Kelrap Date: Fri, 21 Jun 2024 11:49:35 -0400 Subject: [PATCH 4/6] Use more readable text and selection color --- lib/pangea/pages/p_user_age/p_user_age_view.dart | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/pangea/pages/p_user_age/p_user_age_view.dart b/lib/pangea/pages/p_user_age/p_user_age_view.dart index e3eac4d12..1438cf0fe 100644 --- a/lib/pangea/pages/p_user_age/p_user_age_view.dart +++ b/lib/pangea/pages/p_user_age/p_user_age_view.dart @@ -1,3 +1,4 @@ +import 'package:fluffychat/config/app_config.dart'; import 'package:fluffychat/pangea/pages/p_user_age/p_user_age.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; @@ -18,11 +19,15 @@ class PUserAgeView extends StatelessWidget { children: [ Container( margin: const EdgeInsets.only(top: 10), - padding: const EdgeInsets.all(12), + padding: const EdgeInsets.all(15), child: Text( L10n.of(context)!.yourBirthdayPlease, textAlign: TextAlign.justify, - style: const TextStyle(color: Colors.white), + style: const TextStyle( + color: Colors.black, + fontSize: 14, + fontWeight: FontWeight.bold, + ), ), ), const SizedBox( @@ -41,23 +46,25 @@ class PUserAgeView extends StatelessWidget { ListTile( title: Text( L10n.of(context)!.certifyAge(13), - style: const TextStyle(color: Colors.white, fontSize: 14), + style: const TextStyle(color: Colors.black, fontSize: 14), ), leading: Radio( value: 13, groupValue: controller.selectedAge, onChanged: controller.setSelectedAge, + activeColor: AppConfig.primaryColor, ), ), ListTile( title: Text( L10n.of(context)!.certifyAge(18), - style: const TextStyle(color: Colors.white, fontSize: 14), + style: const TextStyle(color: Colors.black, fontSize: 14), ), leading: Radio( value: 18, groupValue: controller.selectedAge, onChanged: controller.setSelectedAge, + activeColor: AppConfig.primaryColor, ), ), ], From 2ed11d6d7483694c09386abd5d51a92e5f2cffba Mon Sep 17 00:00:00 2001 From: Kelrap Date: Fri, 21 Jun 2024 14:14:17 -0400 Subject: [PATCH 5/6] Doesn't treat subspaces like subchats --- .../events_extension.dart | 60 ++++++++++++++++--- .../pangea_room_extension.dart | 4 ++ 2 files changed, 57 insertions(+), 7 deletions(-) diff --git a/lib/pangea/extensions/pangea_room_extension/events_extension.dart b/lib/pangea/extensions/pangea_room_extension/events_extension.dart index f878bc3cb..2d67db5b2 100644 --- a/lib/pangea/extensions/pangea_room_extension/events_extension.dart +++ b/lib/pangea/extensions/pangea_room_extension/events_extension.dart @@ -60,11 +60,15 @@ extension EventsRoomExtension on Room { future: () async { final List children = await getChildRooms(); for (final Room child in children) { - if (!child.isAnalyticsRoom) { + if (!child.isAnalyticsRoom && !child.isArchived) { if (child.membership != Membership.join) { child.join; } - await child.archive(); + if (child.isSpace) { + await child.archiveSubspace(); + } else { + await child.archive(); + } } } await _archive(); @@ -77,6 +81,23 @@ extension EventsRoomExtension on Room { return success.error == null; } + Future _archiveSubspace() async { + final List children = await getChildRooms(); + for (final Room child in children) { + if (!child.isAnalyticsRoom && !child.isArchived) { + if (child.membership != Membership.join) { + child.join; + } + if (child.isSpace) { + await child.archiveSubspace(); + } else { + await child.archive(); + } + } + } + await _archive(); + } + Future _leaveSpace(BuildContext context, Client client) async { final confirmed = await showOkCancelAlertDialog( useRootNavigator: false, @@ -94,12 +115,18 @@ extension EventsRoomExtension on Room { try { final List children = await getChildRooms(); for (final Room child in children) { - if (!child.isSpace && - child.membership == Membership.join && - child.isUnread) { - await child.markUnread(false); + if (!child.isAnalyticsRoom && !child.isArchived) { + if (!child.isSpace && + child.membership == Membership.join && + child.isUnread) { + await child.markUnread(false); + } + if (child.isSpace) { + await child.leaveSubspace(); + } else { + await child.leave(); + } } - await child.leave(); } await leave(); } catch (err, stack) { @@ -116,6 +143,25 @@ extension EventsRoomExtension on Room { return success.error == null; } + Future _leaveSubspace() async { + final List children = await getChildRooms(); + for (final Room child in children) { + if (!child.isAnalyticsRoom && !child.isArchived) { + if (!child.isSpace && + child.membership == Membership.join && + child.isUnread) { + await child.markUnread(false); + } + if (child.isSpace) { + await child.leaveSubspace(); + } else { + await child.leave(); + } + } + } + await leave(); + } + Future _sendPangeaEvent({ required Map content, required String parentEventId, diff --git a/lib/pangea/extensions/pangea_room_extension/pangea_room_extension.dart b/lib/pangea/extensions/pangea_room_extension/pangea_room_extension.dart index 25694901c..570cbebba 100644 --- a/lib/pangea/extensions/pangea_room_extension/pangea_room_extension.dart +++ b/lib/pangea/extensions/pangea_room_extension/pangea_room_extension.dart @@ -152,9 +152,13 @@ extension PangeaRoom on Room { }) async => await _archiveSpace(context, client, onlyAdmin: onlyAdmin); + Future archiveSubspace() async => await _archiveSubspace(); + Future leaveSpace(BuildContext context, Client client) async => await _leaveSpace(context, client); + Future leaveSubspace() async => await _leaveSubspace(); + Future sendPangeaEvent({ required Map content, required String parentEventId, From e5ac6516da5ad4d5e2bc2386266808a014fb3294 Mon Sep 17 00:00:00 2001 From: ggurdin Date: Fri, 21 Jun 2024 14:37:39 -0400 Subject: [PATCH 6/6] show the user the click instruction card when they first see a message --- lib/pages/chat/chat_event_list.dart | 14 ++++++++++++++ lib/pangea/widgets/igc/pangea_rich_text.dart | 7 ------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/pages/chat/chat_event_list.dart b/lib/pages/chat/chat_event_list.dart index 3fc1aac9c..fed94554a 100644 --- a/lib/pages/chat/chat_event_list.dart +++ b/lib/pages/chat/chat_event_list.dart @@ -5,6 +5,7 @@ import 'package:fluffychat/pages/chat/seen_by_row.dart'; import 'package:fluffychat/pages/chat/typing_indicators.dart'; import 'package:fluffychat/pages/user_bottom_sheet/user_bottom_sheet.dart'; import 'package:fluffychat/pangea/extensions/pangea_room_extension/pangea_room_extension.dart'; +import 'package:fluffychat/pangea/utils/instructions.dart'; import 'package:fluffychat/pangea/widgets/chat/locked_chat_message.dart'; import 'package:fluffychat/utils/account_config.dart'; import 'package:fluffychat/utils/adaptive_bottom_sheet.dart'; @@ -40,6 +41,19 @@ class ChatEventList extends StatelessWidget { final hasWallpaper = controller.room.client.applicationAccountConfig.wallpaperUrl != null; + // #Pangea + // after the chat event list mounts, if the user hasn't yet seen this instruction + // card, attach it on top of the first shown message + WidgetsBinding.instance.addPostFrameCallback((_) { + controller.pangeaController.instructions.show( + context, + InstructionsEnum.clickMessage, + events[0].eventId, + true, + ); + }); + // Pangea# + return SelectionArea( child: ListView.custom( padding: EdgeInsets.only( diff --git a/lib/pangea/widgets/igc/pangea_rich_text.dart b/lib/pangea/widgets/igc/pangea_rich_text.dart index 5f8dc615e..cee67cafd 100644 --- a/lib/pangea/widgets/igc/pangea_rich_text.dart +++ b/lib/pangea/widgets/igc/pangea_rich_text.dart @@ -121,13 +121,6 @@ class PangeaRichTextState extends State { InstructionsEnum.blurMeansTranslate, widget.pangeaMessageEvent.eventId, ); - } else { - pangeaController.instructions.show( - context, - InstructionsEnum.clickMessage, - widget.pangeaMessageEvent.eventId, - true, - ); } //TODO - take out of build function of every message