From 969f1deb486b53463d52af58b28135ee3055a828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ku=C3=9Fowski?= Date: Wed, 1 Oct 2025 07:59:20 +0200 Subject: [PATCH 1/8] feat: Display progress for downloading content --- lib/pages/chat/events/audio_player.dart | 17 +++++++++++++- lib/pages/image_viewer/video_player.dart | 23 +++++++++++++++++-- .../event_extension.dart | 10 +++++++- 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/lib/pages/chat/events/audio_player.dart b/lib/pages/chat/events/audio_player.dart index 5609c62d0..b4730649f 100644 --- a/lib/pages/chat/events/audio_player.dart +++ b/lib/pages/chat/events/audio_player.dart @@ -47,6 +47,7 @@ class AudioPlayerState extends State { static const double buttonSize = 36; AudioPlayerStatus status = AudioPlayerStatus.notDownloaded; + double? _downloadProgress; late final MatrixState matrix; List? _waveform; @@ -149,7 +150,20 @@ class AudioPlayerState extends State { setState(() => status = AudioPlayerStatus.downloading); try { - matrixFile = await widget.event.downloadAndDecryptAttachment(); + final fileSize = widget.event.content + .tryGetMap('info') + ?.tryGet('size'); + matrixFile = await widget.event.downloadAndDecryptAttachment( + onDownloadProgress: fileSize != null && fileSize > 0 + ? (progress) { + final progressPercentage = progress / fileSize; + setState(() { + _downloadProgress = + progressPercentage < 1 ? progressPercentage : null; + }); + } + : null, + ); if (!kIsWeb) { final tempDir = await getTemporaryDirectory(); @@ -320,6 +334,7 @@ class AudioPlayerState extends State { ? CircularProgressIndicator( strokeWidth: 2, color: widget.color, + value: _downloadProgress, ) : InkWell( borderRadius: BorderRadius.circular(64), diff --git a/lib/pages/image_viewer/video_player.dart b/lib/pages/image_viewer/video_player.dart index a362b94c3..3f3ac9e19 100644 --- a/lib/pages/image_viewer/video_player.dart +++ b/lib/pages/image_viewer/video_player.dart @@ -32,6 +32,8 @@ class EventVideoPlayerState extends State { ChewieController? _chewieController; VideoPlayerController? _videoPlayerController; + double? _downloadProgress; + // The video_player package only doesn't support Windows and Linux. final _supportsVideoPlayer = !PlatformInfos.isWindows && !PlatformInfos.isLinux; @@ -43,7 +45,20 @@ class EventVideoPlayerState extends State { } try { - final videoFile = await widget.event.downloadAndDecryptAttachment(); + final fileSize = widget.event.content + .tryGetMap('info') + ?.tryGet('size'); + final videoFile = await widget.event.downloadAndDecryptAttachment( + onDownloadProgress: fileSize == null + ? null + : (progress) { + final progressPercentage = progress / fileSize; + setState(() { + _downloadProgress = + progressPercentage < 1 ? progressPercentage : null; + }); + }, + ); // Dispose the controllers if we already have them. _disposeControllers(); @@ -165,7 +180,11 @@ class EventVideoPlayerState extends State { ), ), ), - const Center(child: CircularProgressIndicator.adaptive()), + Center( + child: CircularProgressIndicator.adaptive( + value: _downloadProgress, + ), + ), ], ); } diff --git a/lib/utils/matrix_sdk_extensions/event_extension.dart b/lib/utils/matrix_sdk_extensions/event_extension.dart index b28ea258e..046df2598 100644 --- a/lib/utils/matrix_sdk_extensions/event_extension.dart +++ b/lib/utils/matrix_sdk_extensions/event_extension.dart @@ -14,7 +14,15 @@ extension LocalizedBody on Event { Future> _getFile(BuildContext context) => showFutureLoadingDialog( context: context, - future: downloadAndDecryptAttachment, + futureWithProgress: (onProgress) { + final fileSize = + infoMap['size'] is int ? infoMap['size'] as int : null; + return downloadAndDecryptAttachment( + onDownloadProgress: fileSize == null + ? null + : (bytes) => onProgress(bytes / fileSize), + ); + }, ); void saveFile(BuildContext context) async { From 495efef5919826fe85768d9439c79ece13626c07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ku=C3=9Fowski?= Date: Wed, 1 Oct 2025 09:02:38 +0200 Subject: [PATCH 2/8] chore: Make progress indicators rounder --- lib/config/themes.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/config/themes.dart b/lib/config/themes.dart index 8b6fb38cf..e7e516008 100644 --- a/lib/config/themes.dart +++ b/lib/config/themes.dart @@ -116,6 +116,11 @@ abstract class FluffyThemes { ), ), ), + progressIndicatorTheme: ProgressIndicatorThemeData( + strokeCap: StrokeCap.round, + color: colorScheme.primary, + refreshBackgroundColor: colorScheme.primaryContainer, + ), snackBarTheme: isColumnMode ? const SnackBarThemeData( showCloseIcon: true, From 847662a9bb9db3b2227b53c446571ce8c5e67d6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ku=C3=9Fowski?= Date: Wed, 1 Oct 2025 09:03:27 +0200 Subject: [PATCH 3/8] chore: Update matrix dart sdk --- pubspec.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.lock b/pubspec.lock index 8684a9c3a..bdff4193a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1123,7 +1123,7 @@ packages: description: path: "." ref: HEAD - resolved-ref: "47329df6affd0ccc928e1cd40279bb67cf55ceaf" + resolved-ref: "99745b0e210b30409c9931a35683c8e6b5105f9c" url: "https://github.com/famedly/matrix-dart-sdk.git" source: git version: "2.0.1" From 4d7abb15f1c7c8bf016d74d9c67bec72704ed7b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ku=C3=9Fowski?= Date: Wed, 1 Oct 2025 12:45:22 +0200 Subject: [PATCH 4/8] chore: Add contributing guidelines --- CONTRIBUTING.md | 15 +++++++++++++++ pubspec.lock | 2 +- pubspec.yaml | 4 ++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..a39035a56 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,15 @@ +# Contributing to FluffyChat +Contributions are always welcome. Yet we might lack manpower to review all of them in time. + +To improve the process please make sure that you read the following guidelines carefully: + +## Contributing Guidelines + +1. Always create a Pull Request for any changes. +2. Whenever possible please make sure that your Pull Request only contains **one** commit. Cases where multiple commits make sense are very rare. +3. Every Pull Request should change only one thing. For bigger changes it is often better to split them up in multiple Pull Requests. +4. [Sign your commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits). +5. Format the commit message as [Conventional Commits](https://www.conventionalcommits.org). +6. Format (`flutter format lib`) and sort impots (`dart run import_sorter:main --no-comments`) in all code files. +7. For bigger or complex changes (more than a couple of code lines) write an issue or refer to an existing issue and ask for approval from the maintainers (@krille-chan) **before** starting to implement it. This way you reduce the risk that your Pull Request get's declined. +8. Prefer simple and easy to maintain solutions over complexity and fancy ones. \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index bdff4193a..6d30252a9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1123,7 +1123,7 @@ packages: description: path: "." ref: HEAD - resolved-ref: "99745b0e210b30409c9931a35683c8e6b5105f9c" + resolved-ref: "59cc954fc8a66684de0a22353e0981f062e2d60b" url: "https://github.com/famedly/matrix-dart-sdk.git" source: git version: "2.0.1" diff --git a/pubspec.yaml b/pubspec.yaml index d9279268f..6fa5c4b72 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -127,6 +127,10 @@ msix_config: sign_msix: false install_certificate: false +# Guidelines for adding a dependency override: +# 1. Don't do it if you can avoid it or fix it upstream in a manageable time +# 2. Always link an (upstream?) issue +# 3. Explain how and when this can be removed (overrides must be temporarily) dependency_overrides: # https://github.com/juliansteenbakker/flutter_secure_storage/issues/920 flutter_secure_storage_linux: From 93c3b26909b8900f6f0c9659ceb269d15810e630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ku=C3=9Fowski?= Date: Wed, 1 Oct 2025 12:47:28 +0200 Subject: [PATCH 5/8] chore: Mention rebases --- CONTRIBUTING.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a39035a56..f54a0fb85 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,9 +7,10 @@ To improve the process please make sure that you read the following guidelines c 1. Always create a Pull Request for any changes. 2. Whenever possible please make sure that your Pull Request only contains **one** commit. Cases where multiple commits make sense are very rare. -3. Every Pull Request should change only one thing. For bigger changes it is often better to split them up in multiple Pull Requests. -4. [Sign your commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits). -5. Format the commit message as [Conventional Commits](https://www.conventionalcommits.org). -6. Format (`flutter format lib`) and sort impots (`dart run import_sorter:main --no-comments`) in all code files. -7. For bigger or complex changes (more than a couple of code lines) write an issue or refer to an existing issue and ask for approval from the maintainers (@krille-chan) **before** starting to implement it. This way you reduce the risk that your Pull Request get's declined. -8. Prefer simple and easy to maintain solutions over complexity and fancy ones. \ No newline at end of file +3. Do not add merge commits. Use rebases. +4. Every Pull Request should change only one thing. For bigger changes it is often better to split them up in multiple Pull Requests. +5. [Sign your commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits). +6. Format the commit message as [Conventional Commits](https://www.conventionalcommits.org). +7. Format (`flutter format lib`) and sort impots (`dart run import_sorter:main --no-comments`) in all code files. +8. For bigger or complex changes (more than a couple of code lines) write an issue or refer to an existing issue and ask for approval from the maintainers (@krille-chan) **before** starting to implement it. This way you reduce the risk that your Pull Request get's declined. +9. Prefer simple and easy to maintain solutions over complexity and fancy ones. \ No newline at end of file From 59b08f401fac939dc1fb77835a00a62d6ed6b427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ku=C3=9Fowski?= Date: Wed, 1 Oct 2025 12:49:16 +0200 Subject: [PATCH 6/8] chore: Update pull request template --- .github/pull_request_template.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index c92536427..7f4e66ec9 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,13 +1,6 @@ *Thank you so much for your contribution to FluffyChat ❤️❤️❤️* -Please make sure that your Pull Request meet the following **acceptance criteria**: - -- [ ] Code formatting and import sorting has been done with `dart format lib/ test/` and `dart run import_sorter:main --no-comments` -- [ ] The commit message uses the format of [Conventional Commits](https://www.conventionalcommits.org) -- [ ] The commit message describes what has been changed, why it has been changed and how it has been changed -- [ ] Every new feature or change of the design/GUI is linked to an approved design proposal in an issue -- [ ] Every new feature in the app or the build system has a strategy how this will be tested and maintained from now on for every release, e.g. a volunteer who takes over maintainership - +- [ ] I have read and understood the [contributing guidelines](https://github.com/krille-chan/fluffychat/blob/main/CONTRIBUTING.md). ### Pull Request has been tested on: From eb0204f53201237ff03782abba719a3186b101d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ku=C3=9Fowski?= Date: Wed, 1 Oct 2025 13:46:50 +0200 Subject: [PATCH 7/8] chore: Update matrix sdk --- pubspec.lock | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 6d30252a9..30737cba7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -974,14 +974,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.7" - js_interop: - dependency: transitive - description: - name: js_interop - sha256: "7ec859c296958ccea34dc770504bd3ff4ae52fdd9e7eeb2bacc7081ad476a1f5" - url: "https://pub.dev" - source: hosted - version: "0.0.1" json_annotation: dependency: transitive description: @@ -1123,7 +1115,7 @@ packages: description: path: "." ref: HEAD - resolved-ref: "59cc954fc8a66684de0a22353e0981f062e2d60b" + resolved-ref: "102d04304e1af33c4c71f502f487d5d31f9eaefb" url: "https://github.com/famedly/matrix-dart-sdk.git" source: git version: "2.0.1" From 72d27e8ca2cccb47d3ae45fa7285129d8cdbb213 Mon Sep 17 00:00:00 2001 From: Frank Paul Silye Date: Tue, 30 Sep 2025 08:20:57 +0200 Subject: [PATCH 8/8] =?UTF-8?q?chore(translations):=20Translated=20using?= =?UTF-8?q?=20Weblate=20(Norwegian=20Bokm=C3=A5l)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 73.2% (573 of 782 strings) Translation: FluffyChat/Translations Translate-URL: https://hosted.weblate.org/projects/fluffychat/translations/nb_NO/ --- lib/l10n/intl_nb.arb | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/lib/l10n/intl_nb.arb b/lib/l10n/intl_nb.arb index cc4d5201e..03da788ba 100644 --- a/lib/l10n/intl_nb.arb +++ b/lib/l10n/intl_nb.arb @@ -2669,5 +2669,44 @@ } }, "noMessagesYet": "Ingen meldinger enda", - "@noMessagesYet": {} + "@noMessagesYet": {}, + "notificationRuleMasterDescription": "Overstyrer alle andre regler og deaktiverer alle varsler.", + "@notificationRuleMasterDescription": {}, + "notificationRuleSuppressNotices": "Undertrykk automatiserte meldinger", + "@notificationRuleSuppressNotices": {}, + "startedKeyVerification": "{sender} startet nøkkelverifisering", + "@startedKeyVerification": { + "type": "String", + "placeholders": { + "sender": { + "type": "String" + } + } + }, + "transparent": "Gjennomsiktig", + "@transparent": {}, + "stickers": "Stickers", + "@stickers": {}, + "commandHint_ignore": "Ignorer den oppgitte matrix IDen", + "@commandHint_ignore": {}, + "commandHint_unignore": "Opphev ignorering av den gitte matrix IDen", + "@commandHint_unignore": {}, + "unreadChatsInApp": "{appname}: {unread} uleste chatter", + "@unreadChatsInApp": { + "type": "String", + "placeholders": { + "appname": { + "type": "String" + }, + "unread": { + "type": "String" + } + } + }, + "changeTheVisibilityOfChatHistory": "Endre synligheten til chatloggen", + "@changeTheVisibilityOfChatHistory": {}, + "changeTheCanonicalRoomAlias": "Endre hovedadressen til den offentlige chatten", + "@changeTheCanonicalRoomAlias": {}, + "sendRoomNotifications": "Send en @room varsling", + "@sendRoomNotifications": {} }