From a51458ad7a3a2f661169f54e2fbfd484868d215d Mon Sep 17 00:00:00 2001 From: 4sterisk <4sterisk@ymail.ne.jp> Date: Sun, 3 Nov 2024 14:13:33 +0900 Subject: [PATCH 01/28] =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E5=90=8D=E3=81=AE=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/{snap_deploy.yml => linux_deploy.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{snap_deploy.yml => linux_deploy.yml} (100%) diff --git a/.github/workflows/snap_deploy.yml b/.github/workflows/linux_deploy.yml similarity index 100% rename from .github/workflows/snap_deploy.yml rename to .github/workflows/linux_deploy.yml From 0ca47a5fcd59382b658d78b38bdb673c76e563b7 Mon Sep 17 00:00:00 2001 From: 4sterisk <4sterisk@ymail.ne.jp> Date: Sun, 3 Nov 2024 14:14:54 +0900 Subject: [PATCH 02/28] =?UTF-8?q?deb=E3=83=91=E3=83=83=E3=82=B1=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=82=92=E4=BD=9C=E6=88=90=E3=81=A7=E3=81=8D=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/linux_deploy.yml | 90 +++++++++++++++++++++++++++++- 1 file changed, 88 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux_deploy.yml b/.github/workflows/linux_deploy.yml index f956e9571..f70b119eb 100644 --- a/.github/workflows/linux_deploy.yml +++ b/.github/workflows/linux_deploy.yml @@ -1,15 +1,19 @@ -name: デプロイ(snap) +name: デプロイ(linux) on: workflow_dispatch: release: types: [published] +env: + APP_NAME: 'miria' + MAINTAINER: 'sorairo ' + permissions: contents: write jobs: - build: + build-snap: name: ビルド(Snap) runs-on: ubuntu-latest strategy: @@ -52,3 +56,85 @@ jobs: # snap: ${{ steps.snapcraft.outputs.snap }} # release: stable + + build-debs: + name: ビルド(Deb) + runs-on: ubuntu-latest + strategy: + matrix: + platform: [amd64] + steps: + - name: Clone repository + uses: actions/checkout@v4 + + - name: Get Flutter version from .fvmrc + run: echo "FLUTTER_FVM_VERSION=$(jq -r .flutter .fvmrc)" >> $GITHUB_ENV + + - name: Install Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ env.FLUTTER_FVM_VERSION }} + cache: true + + - name: Patch for linux build + run: | + sudo apt-get update -y + sudo apt-get install -y ninja-build libgtk-3-dev libsecret-1-dev libstdc++-12-dev nasm + sudo pip3 install meson + + - name: Build libmpv + run: | + git clone https://github.com/mpv-player/mpv-build.git + cd mpv-build + sed -i 's|checkout_ffmpeg=master|checkout_ffmpeg=@dcdfd7fb62464beeeb03c24f21713bf3914b9ea4|g' update + sed -i 's|checkout_libplacebo=master|checkout_libplacebo=@ed29e541a55acf28022738440b2a925386292551|g' update + sed -i 's|checkout_mpv=master|checkout_mpv=@140ec21c89d671d392877a7f3b91d67e7d7b9239|g' update + sed -i 's|OPTIONS="--enable-static --disable-shared"|OPTIONS="--enable-shared"|g' scripts/libass-config + sed -i 's|--prefix="$BUILD/build_libs" --libdir="$BUILD/build_libs/lib"||g' scripts/libass-config + sed -i 's|^meson setup build.*||g' scripts/mpv-config + echo -e "\npython3 ./bootstrap.py\n./waf configure --disable-alsa --enable-libmpv-shared\n./waf build" >> scripts/mpv-config + ./update + ./scripts/libplacebo-config + ./scripts/libplacebo-build -j$(nproc) + ./scripts/libass-config + sudo make -C libass install -j$(nproc) + ./scripts/ffmpeg-config + ./scripts/ffmpeg-build -j$(nproc) + ./scripts/mpv-config + cd mpv + sudo ./waf install + + - run: flutter pub get +# - run: flutter test + - run: flutter build linux + - name: Get Build Version + run: | + echo "VERSION=$(yq -r '.version' pubspec.yaml)" >> $GITHUB_ENV + + - name: Prepare to build DEB + run: | + echo "DESC=$(awk -F '=' '/^Comment=/{print $2}' ./snap/gui/miria.desktop)" >> $GITHUB_ENV + sed -i -E 's|^Version=.*|Version=${{ env.VERSION }}|g' ./snap/gui/miria.desktop + sed -i -E 's|^Icon=.*|Icon=/usr/share/pixmaps/miria.png|g' ./snap/gui/miria.desktop + sed -i -E 's|^Exec=.*|Exec=/opt/miria/miria|g' ./snap/gui/miria.desktop + mkdir -p .debpkg/opt/miria .debpkg/usr/share/applications .debpkg/usr/share/pixmaps + cp -rp ./build/linux/x64/release/bundle/* .debpkg/opt/miria/ + cp ./snap/gui/miria.desktop .debpkg/usr/share/applications/ + cp ./assets/images/icon.png .debpkg/usr/share/pixmaps/miria.png + + - name: Build DEB + uses: jiro4989/build-deb-action@v3 + with: + desc: '${{ env.DESC }}' + package: ${{ env.APP_NAME }} + maintainer: ${{ env.MAINTAINER }} + version: ${{ env.VERSION }} + arch: "amd64" + package_root: ".debpkg" + depends: "libgtk-3-0, libstdc++6, libx11-6, libmpv2, libsecret-1-0" + + - name: Upload DEB + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release upload v$VERSION ./miria_${{ env.VERSION }}_amd64.deb \ No newline at end of file From 39efd140cd5a5848e970e232d604836bb03d3c75 Mon Sep 17 00:00:00 2001 From: 4sterisk <4sterisk@ymail.ne.jp> Date: Wed, 6 Nov 2024 17:49:03 +0900 Subject: [PATCH 03/28] =?UTF-8?q?snap(arm64)=E3=81=AE=E3=83=93=E3=83=AB?= =?UTF-8?q?=E3=83=89=E6=99=82=E9=96=93=E7=9F=AD=E7=B8=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- snap/snapcraft.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index d36acbed0..d04debc64 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -100,7 +100,12 @@ parts: override-prime: | set -eux for snap in "gnome-42-2204" "gtk-common-themes" "core22"; do # List all content-snaps you're using here - cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$SNAPCRAFT_PRIME/{}" "$SNAPCRAFT_PRIME/usr/{}" \; + cd "/snap/${snap}/current" + find . -type f,l ! -xtype d -print0 > "/tmp/${snap}.log" + cd "${SNAPCRAFT_PRIME}" + cat "/tmp/${snap}.log" | xargs -0 rm -f + cd "${SNAPCRAFT_PRIME}/usr" + cat "/tmp/${snap}.log" | xargs -0 rm -f done layout: From 2cfbace23636d39b4bf234f1f92e45574b34eafa Mon Sep 17 00:00:00 2001 From: Npepperlinux Date: Thu, 7 Nov 2024 15:20:12 +0900 Subject: [PATCH 04/28] =?UTF-8?q?=E3=83=95=E3=82=A9=E3=83=AD=E3=83=AF?= =?UTF-8?q?=E3=83=BC=E3=81=B8=E3=81=AE=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=81=AB=E3=81=8A=E3=81=84=E3=81=A6=E3=82=AB=E3=82=B9?= =?UTF-8?q?=E3=82=BF=E3=83=A0=E7=B5=B5=E6=96=87=E5=AD=97=E3=81=8C=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Misskeyサーバー側で2024.10.1より後のバージョンであるのが条件 Fix shiosyakeyakini-info#650 Related to https://github.com/misskey-dev/misskey/pull/14904 --- lib/view/user_page/user_detail.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/view/user_page/user_detail.dart b/lib/view/user_page/user_detail.dart index cb18c02a6..8ead69bb1 100644 --- a/lib/view/user_page/user_detail.dart +++ b/lib/view/user_page/user_detail.dart @@ -234,6 +234,7 @@ class UserDetail extends ConsumerWidget { S .of(context) .messageForFollower(response.followedMessage ?? ""), + emojis: response.emojis, ), ), const Padding(padding: EdgeInsets.only(top: 5)), From b4bbb826f5cc45f98c6c28f51f05f7d667d3a1ce Mon Sep 17 00:00:00 2001 From: Npepperlinux Date: Thu, 7 Nov 2024 17:35:27 +0900 Subject: [PATCH 05/28] =?UTF-8?q?=E3=83=AA=E3=83=A2=E3=83=BC=E3=83=88?= =?UTF-8?q?=E3=81=AE=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=E3=83=9A=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=82=92=E3=83=96=E3=83=A9=E3=82=A6=E3=82=B6=E3=81=A7?= =?UTF-8?q?=E9=96=8B=E3=81=8F=E3=81=A8=E3=81=8D=E3=81=AB`uri`=E3=81=A7?= =?UTF-8?q?=E3=81=AF=E3=81=AA=E3=81=8F`url`=E3=82=92=E5=84=AA=E5=85=88?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/view/user_page/user_control_dialog.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/view/user_page/user_control_dialog.dart b/lib/view/user_page/user_control_dialog.dart index 9c6b6f4f5..48ec542ff 100644 --- a/lib/view/user_page/user_control_dialog.dart +++ b/lib/view/user_page/user_control_dialog.dart @@ -96,7 +96,7 @@ class UserControlDialog extends HookConsumerWidget implements AutoRouteWrapper { Navigator.of(context).pop(); }); final openBrowserAsRemote = useAsync(() async { - final uri = response.uri ?? response.url; + final uri = response.url ?? response.uri; if (uri == null) return; await launchUrl(uri, mode: LaunchMode.externalApplication); if (!context.mounted) return; From 7f6027780a9394c72493b43ad982414d03be78bc Mon Sep 17 00:00:00 2001 From: Npepperlinux Date: Thu, 7 Nov 2024 18:45:42 +0900 Subject: [PATCH 06/28] =?UTF-8?q?=E4=B8=8D=E8=B6=B3=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=82=8B=E3=81=8A=E5=AC=A2=E6=A7=98=E8=AA=9E=E7=BF=BB?= =?UTF-8?q?=E8=A8=B3=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/l10n/app_ja-oj.arb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/l10n/app_ja-oj.arb b/lib/l10n/app_ja-oj.arb index bac68a8d4..4636ccbf1 100644 --- a/lib/l10n/app_ja-oj.arb +++ b/lib/l10n/app_ja-oj.arb @@ -8,7 +8,6 @@ "noneAction": "なにもいたしませんわ", "pleaseInput": "お入れなさって", "pleaseSelect": "お選びになさって", - "clipDescription": "説明(なくてもよろしくてよ)", "serverRules": "サーバーの定め", "antennaSourceUserHintText": "ユーザーネームを改行で区切って指定いたしますわ", @@ -22,9 +21,6 @@ "confirmDeletingAntenna": "アンテナを削除いたしますこと?", "channelJoinningCounts": "{usersCount}人が参加なされてますわ", - "willFavorite": "お気に入りに入れますわ", - "willFollow": "フォローいたしますわ", - "confirmDeleteClip": "クリップを削除いたしますこと?", "clipDescription": "説明(省略されてもよろしくてよ)", "alreadyAddedClip": "こちらのノートすでにクリップに追加されていますわ", @@ -58,6 +54,8 @@ "openAsOtherAccount": "開くアカウントを選びなさって", "pickColor": "色を選びなさって", "decideColor": "これにいたしますわ", + "replyNotePlaceholder": "何と送りますの?", + "defaultNotePlaceholder": "ごきげんよう", "followedNotification": "{userName}からフォローされましてよ", "followRequestAcceptedNotification": "{userName}がフォローしてもよくってよとお聞きいたしましたわ", @@ -106,6 +104,9 @@ "cannotMentionToRemoteInLocalOnlyNote": "連合切られているのに他のサーバーの人がメンションに含まれているようですわ", "cannotPublicReplyToPrivateNote": "リプライが{visibility}のようでして……パブリックにはできませんこと", + "memoDescription": "メモしたいことをお書きくださいまし", + "confirmCreateBlock": "ブロックなさりますの?", + "unsupportedFile": "対応してないファイルのようですわ", "failedFileSave": "ファイルの保存に失敗したようですわね…" From e035a0c3c7a0e865929a38c36704645177adebd1 Mon Sep 17 00:00:00 2001 From: Npepperlinux Date: Thu, 7 Nov 2024 19:07:51 +0900 Subject: [PATCH 07/28] =?UTF-8?q?=E7=BF=BB=E8=A8=B3=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/l10n/app_ja-oj.arb | 4 ++-- lib/l10n/app_ja.arb | 8 +++++++- lib/view/common/account_select_dialog.dart | 2 +- lib/view/common/pushable_listview.dart | 7 ++++--- .../general_settings_page/general_settings_page.dart | 4 ++-- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/lib/l10n/app_ja-oj.arb b/lib/l10n/app_ja-oj.arb index 4636ccbf1..11b89c486 100644 --- a/lib/l10n/app_ja-oj.arb +++ b/lib/l10n/app_ja-oj.arb @@ -108,9 +108,9 @@ "confirmCreateBlock": "ブロックなさりますの?", "unsupportedFile": "対応してないファイルのようですわ", - "failedFileSave": "ファイルの保存に失敗したようですわね…" - + "failedFileSave": "ファイルの保存に失敗したようですわね…", + "nothingHere": "ここには何もありませんわ" diff --git a/lib/l10n/app_ja.arb b/lib/l10n/app_ja.arb index 55369c6e0..506952a72 100644 --- a/lib/l10n/app_ja.arb +++ b/lib/l10n/app_ja.arb @@ -1005,6 +1005,12 @@ } } }, - "nonInvitedReversi": "招待はされとらへんみたいや" + "nonInvitedReversi": "招待はされとらへんみたいや", + + "remoteServerWithoutLogin": "相手先のサーバー(ログインなし)", + "nothingHere": "なんもないで", + + "deckMode": "デッキモード", + "enableDeckMode": "デッキモードにする" } diff --git a/lib/view/common/account_select_dialog.dart b/lib/view/common/account_select_dialog.dart index 35bf2f9eb..9690447fa 100644 --- a/lib/view/common/account_select_dialog.dart +++ b/lib/view/common/account_select_dialog.dart @@ -48,7 +48,7 @@ class AccountSelectDialog extends HookConsumerWidget { ), _ => ListTile( leading: const Icon(Icons.language), - title: const Text("相手先のサーバー(ログインなし)"), + title: Text(S.of(context).remoteServerWithoutLogin), onTap: navigateAsRemote.executeOrNull, ), }, diff --git a/lib/view/common/pushable_listview.dart b/lib/view/common/pushable_listview.dart index 8ca154c84..e4c04a71d 100644 --- a/lib/view/common/pushable_listview.dart +++ b/lib/view/common/pushable_listview.dart @@ -2,6 +2,7 @@ import "dart:async"; import "package:flutter/foundation.dart"; import "package:flutter/material.dart"; +import "package:flutter_gen/gen_l10n/app_localizations.dart"; import "package:flutter_hooks/flutter_hooks.dart"; import "package:hooks_riverpod/hooks_riverpod.dart"; import "package:miria/model/general_settings.dart"; @@ -119,10 +120,10 @@ class PushableListView extends HookConsumerWidget { } if (items.value.isEmpty && !hideIsEmpty) { - return const Center( + return Center( child: Padding( - padding: EdgeInsets.all(10), - child: Text("なんもないで"), + padding: const EdgeInsets.all(10), + child: Text(S.of(context).nothingHere), ), ); } diff --git a/lib/view/settings_page/general_settings_page/general_settings_page.dart b/lib/view/settings_page/general_settings_page/general_settings_page.dart index b71a61677..a0dd4b9c1 100644 --- a/lib/view/settings_page/general_settings_page/general_settings_page.dart +++ b/lib/view/settings_page/general_settings_page/general_settings_page.dart @@ -178,9 +178,9 @@ class GeneralSettingsPage extends HookConsumerWidget { onChanged: (value) async => automaticPush.value = value ?? AutomaticPush.none, ), - const Text("デッキモード"), //TODO: localize + Text(S.of(context).deckMode), CheckboxListTile( - title: const Text("デッキモードにします。"), + title: Text(S.of(context).enableDeckMode), value: isDeckMode.value, onChanged: (value) => isDeckMode.value = value ?? false, ), From 625fc344781ff5ba407adabf22961ef76ed3dd46 Mon Sep 17 00:00:00 2001 From: 4sterisk <4sterisk@ymail.ne.jp> Date: Fri, 8 Nov 2024 03:27:33 +0900 Subject: [PATCH 08/28] =?UTF-8?q?Revert=20"=E6=B7=BB=E4=BB=98=E7=94=BB?= =?UTF-8?q?=E5=83=8F=E3=81=AE=E5=90=91=E3=81=8D=E3=81=8C=E3=81=8A=E3=81=8B?= =?UTF-8?q?=E3=81=97=E3=81=8F=E3=81=AA=E3=82=8B=E3=81=93=E3=81=A8=E3=81=8C?= =?UTF-8?q?=E3=81=82=E3=82=8B=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bc164c9bcbf167974eed138caea21fc5ca8dba01. --- .../note_create_page/note_create_state_notifier.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/state_notifier/note_create_page/note_create_state_notifier.dart b/lib/state_notifier/note_create_page/note_create_state_notifier.dart index 32da9539d..fbfe5a935 100644 --- a/lib/state_notifier/note_create_page/note_create_state_notifier.dart +++ b/lib/state_notifier/note_create_page/note_create_state_notifier.dart @@ -592,8 +592,6 @@ class NoteCreateNotifier extends _$NoteCreateNotifier { final result = await FilePicker.platform.pickFiles( type: FileType.image, allowMultiple: true, - allowCompression: false, - compressionQuality: 0, ); if (result == null || result.files.isEmpty) return; From 37563f44dfb4a6a366f78cbd096ce42c0f5a255f Mon Sep 17 00:00:00 2001 From: 4sterisk <4sterisk@ymail.ne.jp> Date: Thu, 7 Nov 2024 16:47:36 +0900 Subject: [PATCH 09/28] =?UTF-8?q?=E8=AA=AD=E3=81=BF=E8=BE=BC=E3=81=BF?= =?UTF-8?q?=E6=99=82=E3=81=AB=E7=94=BB=E5=83=8F=E3=81=AE=E5=90=91=E3=81=8D?= =?UTF-8?q?=E4=BB=A5=E5=A4=96=E3=81=AEEXIF=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../note_create_state_notifier.dart | 34 ++++++++++++++++--- pubspec.lock | 2 +- pubspec.yaml | 1 + 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/lib/state_notifier/note_create_page/note_create_state_notifier.dart b/lib/state_notifier/note_create_page/note_create_state_notifier.dart index fbfe5a935..0365edf79 100644 --- a/lib/state_notifier/note_create_page/note_create_state_notifier.dart +++ b/lib/state_notifier/note_create_page/note_create_state_notifier.dart @@ -1,3 +1,4 @@ +import "dart:io"; import "dart:typed_data"; import "package:dio/dio.dart"; @@ -6,7 +7,9 @@ import "package:flutter/material.dart"; import "package:flutter_gen/gen_l10n/app_localizations.dart"; import "package:flutter_image_compress/flutter_image_compress.dart"; import "package:freezed_annotation/freezed_annotation.dart"; +import "package:image/image.dart"; import "package:mfm_parser/mfm_parser.dart"; +import "package:mime/mime.dart"; import "package:miria/extensions/note_visibility_extension.dart"; import "package:miria/log.dart"; import "package:miria/model/image_file.dart"; @@ -158,17 +161,16 @@ class NoteCreateNotifier extends _$NoteCreateNotifier { files: await Future.wait( initialMediaFiles.map((media) async { final file = _fileSystem.file(media); - final contents = await file.readAsBytes(); final fileName = file.basename; final extension = fileName.split(".").last.toLowerCase(); if (["jpg", "png", "gif", "webp"].contains(extension)) { return ImageFile( - data: contents, + data: await loadImage(file), fileName: fileName, ); } else { return UnknownFile( - data: contents, + data: await file.readAsBytes(), fileName: fileName, ); } @@ -605,7 +607,7 @@ class NoteCreateNotifier extends _$NoteCreateNotifier { final files = await Future.wait( fsFiles.map( (file) async => ImageFile( - data: await file.readAsBytes(), + data: await loadImage(file), fileName: file.basename, ), ), @@ -615,6 +617,30 @@ class NoteCreateNotifier extends _$NoteCreateNotifier { } } + Future loadImage(File file) async { + final imageBytes = await file.readAsBytes(); + final mime = lookupMimeType(file.path, headerBytes: imageBytes); + if (mime == "image/jpeg") { + final origExif = decodeJpgExif(imageBytes); + final exif = ExifData(); + + if (origExif != null) { + final orientation = origExif.imageIfd["Orientation"]; + if (orientation != null) { + exif.imageIfd["Orientation"] = orientation; + } + } + + final img = injectJpgExif(imageBytes, exif); + if (img == null) { + return Uint8List(0); + } + + return img; + } + return imageBytes; + } + /// メディアの内容を変更する void setFileContent(MisskeyPostFile file, Uint8List? content) { if (content == null) return; diff --git a/pubspec.lock b/pubspec.lock index 3af88c6bb..9eb5d5842 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1033,7 +1033,7 @@ packages: source: hosted version: "1.0.5" mime: - dependency: transitive + dependency: "direct main" description: name: mime sha256: "801fd0b26f14a4a58ccb09d5892c3fbdeff209594300a542492cf13fba9d247a" diff --git a/pubspec.yaml b/pubspec.yaml index c1ae7d786..451895194 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -77,6 +77,7 @@ dependencies: flutter_hooks: ^0.20.5 punycode: ^1.0.0 image: ^4.3.0 + mime: ^1.0.6 dependency_overrides: image_editor: From ea1abd88323622f8f419630a6c192cdb00bb1311 Mon Sep 17 00:00:00 2001 From: 4sterisk <4sterisk@ymail.ne.jp> Date: Fri, 8 Nov 2024 03:46:26 +0900 Subject: [PATCH 10/28] =?UTF-8?q?iOS=E3=81=A7=E3=81=AE=E3=81=BFallowCompre?= =?UTF-8?q?ssion=E3=82=92true=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../note_create_page/note_create_state_notifier.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/state_notifier/note_create_page/note_create_state_notifier.dart b/lib/state_notifier/note_create_page/note_create_state_notifier.dart index 0365edf79..8ac2fdc23 100644 --- a/lib/state_notifier/note_create_page/note_create_state_notifier.dart +++ b/lib/state_notifier/note_create_page/note_create_state_notifier.dart @@ -594,6 +594,8 @@ class NoteCreateNotifier extends _$NoteCreateNotifier { final result = await FilePicker.platform.pickFiles( type: FileType.image, allowMultiple: true, + allowCompression: Platform.isIOS, // v8.1.3ではiOS以外でこの値を使用していない + compressionQuality: 0, // Androidでは0にすることで圧縮パススルー ); if (result == null || result.files.isEmpty) return; From f9fb2e10b05d385d326754e51ee12c90cc29bb6a Mon Sep 17 00:00:00 2001 From: 4sterisk <4sterisk@ymail.ne.jp> Date: Fri, 8 Nov 2024 03:56:36 +0900 Subject: [PATCH 11/28] =?UTF-8?q?HEIC=E3=81=AE=E6=B7=BB=E4=BB=98=E3=81=AF?= =?UTF-8?q?=E7=84=A1=E8=A6=96=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../note_create_page/note_create_state_notifier.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/state_notifier/note_create_page/note_create_state_notifier.dart b/lib/state_notifier/note_create_page/note_create_state_notifier.dart index 8ac2fdc23..efe30ea3a 100644 --- a/lib/state_notifier/note_create_page/note_create_state_notifier.dart +++ b/lib/state_notifier/note_create_page/note_create_state_notifier.dart @@ -163,7 +163,7 @@ class NoteCreateNotifier extends _$NoteCreateNotifier { final file = _fileSystem.file(media); final fileName = file.basename; final extension = fileName.split(".").last.toLowerCase(); - if (["jpg", "png", "gif", "webp"].contains(extension)) { + if (["jpg", "png", "gif", "webp", "heic"].contains(extension)) { return ImageFile( data: await loadImage(file), fileName: fileName, @@ -615,7 +615,10 @@ class NoteCreateNotifier extends _$NoteCreateNotifier { ), ); - state = state.copyWith(files: [...state.files, ...files]); + state = state.copyWith(files: [ + ...state.files, + ...files.where((file) => file.data.isNotEmpty) + ]); } } @@ -639,6 +642,8 @@ class NoteCreateNotifier extends _$NoteCreateNotifier { } return img; + } else if (mime == "image/heic") { + return Uint8List(0); } return imageBytes; } From 560e829d1a16651a1d4d749474a053aed91f6be0 Mon Sep 17 00:00:00 2001 From: Npepperlinux Date: Fri, 8 Nov 2024 19:04:10 +0900 Subject: [PATCH 12/28] =?UTF-8?q?fix(windows):=20=E5=89=8A=E9=99=A4?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84=E3=81=9FDLL=E3=83=95?= =?UTF-8?q?=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92=E4=B8=80=E9=83=A8=E5=89=8A?= =?UTF-8?q?=E9=99=A4=E3=81=97=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/windows_deploy.yml | 4 ---- windows/innosetup.iss | 4 ---- 2 files changed, 8 deletions(-) diff --git a/.github/workflows/windows_deploy.yml b/.github/workflows/windows_deploy.yml index cf75e9a65..740ed8bbb 100644 --- a/.github/workflows/windows_deploy.yml +++ b/.github/workflows/windows_deploy.yml @@ -41,10 +41,6 @@ jobs: - name: Delete unnecessary DLL run: | rm build\windows\x64\runner\Release\api-ms-*.dll - rm build\windows\x64\runner\Release\concrt140.dll - rm build\windows\x64\runner\Release\msvcp*.dll - rm build\windows\x64\runner\Release\ucrtbas*.dll - rm build\windows\x64\runner\Release\vc*.dll - name: Get translation files for Inno Setup run: | diff --git a/windows/innosetup.iss b/windows/innosetup.iss index cf5a95cc5..5810ec51d 100644 --- a/windows/innosetup.iss +++ b/windows/innosetup.iss @@ -59,7 +59,3 @@ Type: files; Name: {userappdata}\info.shiosyakeyakini\miria\* [InstallDelete] Type: files; Name: {app}/api-ms-*.dll -Type: files; Name: {app}/concrt140.dll -Type: files; Name: {app}/msvcp*.dll -Type: files; Name: {app}/ucrtbas*.dll -Type: files; Name: {app}/vc*.dll From 932c80dcc85a87a9b1e2356d86cd22b42ba6f8cc Mon Sep 17 00:00:00 2001 From: Npepperlinux Date: Fri, 8 Nov 2024 23:45:58 +0900 Subject: [PATCH 13/28] =?UTF-8?q?README=E3=81=AE=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README-ja.md | 5 +++-- README.md | 13 +++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README-ja.md b/README-ja.md index 3fc5e32a2..1ca27146b 100644 --- a/README-ja.md +++ b/README-ja.md @@ -10,7 +10,8 @@ MiriaはiOS, Android向けMisskeyクライアントです。Windowsでも動作 - [Play Store](https://play.google.com/store/apps/details?id=info.shiosyakeyakini.miria) - [App Store](https://apps.apple.com/jp/app/miria/id6449201469) - 最新版をGitHubからインストール - - [GitHub最新版のリリース(Windows版もあります)](https://github.com/shiosyakeyakini-info/miria/releases/latest) + - [GitHub最新版のリリース(Windows版とSnapパッケージもあります)](https://github.com/shiosyakeyakini-info/miria/releases/latest) + - [Obtainium(APKマネージャー)](https://apps.obtainium.imranr.dev/redirect?r=obtainium://app/%7B%22id%22%3A%22info.shiosyakeyakini.miria%22%2C%22url%22%3A%22https%3A%2F%2Fgithub.com%2Fshiosyakeyakini-info%2Fmiria%22%2C%22author%22%3A%22shiosyakeyakini-info%22%2C%22name%22%3A%22miria%22%2C%22additionalSettings%22%3A%22%7B%5C%22includePrereleases%5C%22%3Atrue%2C%5C%22fallbackToOlderReleases%5C%22%3Atrue%2C%5C%22verifyLatestTag%5C%22%3Afalse%2C%5C%22dontSortReleasesList%5C%22%3Afalse%2C%5C%22releaseTitleAsVersion%5C%22%3Afalse%2C%5C%22trackOnly%5C%22%3Afalse%2C%5C%22versionDetection%5C%22%3Atrue%7D%22%2C%22overrideSource%22%3Anull%7D) - 最新版をTestFlightからインストール - [TestFlight](https://testflight.apple.com/join/X6Q7pE98) @@ -37,7 +38,7 @@ MiriaはiOS, Android向けMisskeyクライアントです。Windowsでも動作 - ただし、一部の機能を独自に取り込んだり、特定のサーバー向けの実装を行っている場合があります。 - MiriaはMisskey v13以上とそれらのフォークされたサーバーでのみ動作します。 - [Sharkey](https://joinsharkey.org/)、[CherryPick](https://github.com/kokonect-link/cherrypick)、[もこきー](https://mkkey.net/)では動作するかもしれませんが、テストは行われていません。 - - [Firefish](https://joinfirefish.org/ja/)、[Catodon](https://catodon.social/)およびMastodonへは今後もサポートする予定はありません。 + - [Iceshrimp](https://iceshrimp.dev/)、[Catodon](https://catodon.social/)およびMastodonへは今後もサポートする予定はありません。 - MiriaはAiScript関連の機能(プラグイン、Play)は実装されていません。難しすぎるためです。 - Miriaはブラウザの機能に依存していません。 - MFMの見た目がブラウザと異なる場合があります。 diff --git a/README.md b/README.md index b810356e0..839b4bb5d 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,11 @@ Miria is Misskey Client App for iOS, Android and many targets which made by Flut ## Install -- [Play Store](https://play.google.com/store/apps/details?id=info.shiosyakeyakini.miria) - [App Store](https://apps.apple.com/jp/app/miria/id6449201469) -- [Download latest release from GitHub(Include Windows Version)](https://github.com/shiosyakeyakini-info/miria/releases/latest) +- [Play Store](https://play.google.com/store/apps/details?id=info.shiosyakeyakini.miria) - [TestFlight](https://testflight.apple.com/join/X6Q7pE98) +- [Obtainium](https://apps.obtainium.imranr.dev/redirect?r=obtainium://app/%7B%22id%22%3A%22info.shiosyakeyakini.miria%22%2C%22url%22%3A%22https%3A%2F%2Fgithub.com%2Fshiosyakeyakini-info%2Fmiria%22%2C%22author%22%3A%22shiosyakeyakini-info%22%2C%22name%22%3A%22miria%22%2C%22additionalSettings%22%3A%22%7B%5C%22includePrereleases%5C%22%3Atrue%2C%5C%22fallbackToOlderReleases%5C%22%3Atrue%2C%5C%22verifyLatestTag%5C%22%3Afalse%2C%5C%22dontSortReleasesList%5C%22%3Afalse%2C%5C%22releaseTitleAsVersion%5C%22%3Afalse%2C%5C%22trackOnly%5C%22%3Afalse%2C%5C%22versionDetection%5C%22%3Atrue%7D%22%2C%22overrideSource%22%3Anull%7D) +- [Download latest release from GitHub(Include Windows Version & Snap packages)](https://github.com/shiosyakeyakini-info/miria/releases/latest) I'm planning to deploy from F-Droid. @@ -33,12 +34,12 @@ I'm planning to deploy from F-Droid. - Miria does not support forked server's unique features. - Miria supports only over Misskey v13 and forked servers. - - [Sharkey](https://joinsharkey.org/), [CherryPick](https://github.com/kokonect-link/cherrypick) and [mkkey.net](https://mkkey.net/) may be available but did not test. - - [Firefish](https://joinfirefish.org/ja/), [Catodon](https://catodon.social/), Mastodon will not support in the future too. + - Available in [Sharkey](https://joinsharkey.org/), [CherryPick](https://github.com/kokonect-link/cherrypick) and [mkkey.net](https://mkkey.net/), but not tested. + - [Iceshrimp](https://iceshrimp.dev/), [Catodon](https://catodon.social/), Mastodon will not be supported in the future. - Miria does not support AiScript related features. (Plugin, Play) -- Miria does not depend browser features. ¥ +- Miria does not depend on browser features. - There are cases in which Miria's MFM appearance is different from browsers. - - Custom CSS didn't support. + - Custom CSS not supported. ## Contribute From e62ce4bebe738015f0ca53959c7e745c97d59d06 Mon Sep 17 00:00:00 2001 From: 4sterisk <4sterisk@ymail.ne.jp> Date: Fri, 8 Nov 2024 17:31:16 +0900 Subject: [PATCH 14/28] =?UTF-8?q?window=5Fmanager=E3=82=920.4.3=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- linux/flutter/generated_plugin_registrant.cc | 8 ++-- linux/flutter/generated_plugins.cmake | 2 +- macos/Flutter/GeneratedPluginRegistrant.swift | 4 +- pubspec.lock | 40 +++++++++++++++++-- pubspec.yaml | 2 +- .../flutter/generated_plugin_registrant.cc | 6 +-- windows/flutter/generated_plugins.cmake | 2 +- 7 files changed, 48 insertions(+), 16 deletions(-) diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index dd37f1256..276b93631 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include @@ -23,9 +23,9 @@ void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) media_kit_video_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "MediaKitVideoPlugin"); media_kit_video_plugin_register_with_registrar(media_kit_video_registrar); - g_autoptr(FlPluginRegistrar) screen_retriever_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverPlugin"); - screen_retriever_plugin_register_with_registrar(screen_retriever_registrar); + g_autoptr(FlPluginRegistrar) screen_retriever_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverLinuxPlugin"); + screen_retriever_linux_plugin_register_with_registrar(screen_retriever_linux_registrar); g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 1a4e0cd6b..d06ff596e 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -6,7 +6,7 @@ list(APPEND FLUTTER_PLUGIN_LIST flutter_secure_storage_linux media_kit_libs_linux media_kit_video - screen_retriever + screen_retriever_linux url_launcher_linux window_manager ) diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 83e14241c..9bf4f69c0 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -13,7 +13,7 @@ import media_kit_libs_macos_video import media_kit_video import package_info_plus import path_provider_foundation -import screen_retriever +import screen_retriever_macos import share_plus import shared_preferences_foundation import sqflite_darwin @@ -31,7 +31,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { MediaKitVideoPlugin.register(with: registry.registrar(forPlugin: "MediaKitVideoPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) - ScreenRetrieverPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverPlugin")) + ScreenRetrieverMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverMacosPlugin")) SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) diff --git a/pubspec.lock b/pubspec.lock index 3af88c6bb..46e1120d8 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1357,10 +1357,42 @@ packages: dependency: transitive description: name: screen_retriever - sha256: "6ee02c8a1158e6dae7ca430da79436e3b1c9563c8cf02f524af997c201ac2b90" + sha256: "570dbc8e4f70bac451e0efc9c9bb19fa2d6799a11e6ef04f946d7886d2e23d0c" url: "https://pub.dev" source: hosted - version: "0.1.9" + version: "0.2.0" + screen_retriever_linux: + dependency: transitive + description: + name: screen_retriever_linux + sha256: f7f8120c92ef0784e58491ab664d01efda79a922b025ff286e29aa123ea3dd18 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + screen_retriever_macos: + dependency: transitive + description: + name: screen_retriever_macos + sha256: "71f956e65c97315dd661d71f828708bd97b6d358e776f1a30d5aa7d22d78a149" + url: "https://pub.dev" + source: hosted + version: "0.2.0" + screen_retriever_platform_interface: + dependency: transitive + description: + name: screen_retriever_platform_interface + sha256: ee197f4581ff0d5608587819af40490748e1e39e648d7680ecf95c05197240c0 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + screen_retriever_windows: + dependency: transitive + description: + name: screen_retriever_windows + sha256: "449ee257f03ca98a57288ee526a301a430a344a161f9202b4fcc38576716fe13" + url: "https://pub.dev" + source: hosted + version: "0.2.0" scrollable_positioned_list: dependency: "direct main" description: @@ -1890,10 +1922,10 @@ packages: dependency: "direct main" description: name: window_manager - sha256: "8699323b30da4cdbe2aa2e7c9de567a6abd8a97d9a5c850a3c86dcd0b34bbfbf" + sha256: "732896e1416297c63c9e3fb95aea72d0355f61390263982a47fd519169dc5059" url: "https://pub.dev" source: hosted - version: "0.3.9" + version: "0.4.3" xdg_directories: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index c1ae7d786..7c60e885b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -67,7 +67,7 @@ dependencies: media_kit_libs_video: ^1.0.5 flutter_colorpicker: ^1.1.0 volume_controller: ^2.0.7 - window_manager: ^0.3.8 + window_manager: ^0.4.3 shared_preference_app_group: ^1.0.0+1 stack_trace: ^1.11.1 flutter_cache_manager: ^3.3.2 diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 3cf1d3a9a..5b11de801 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include @@ -24,8 +24,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { registry->GetRegistrarForPlugin("MediaKitVideoPluginCApi")); PermissionHandlerWindowsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin")); - ScreenRetrieverPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("ScreenRetrieverPlugin")); + ScreenRetrieverWindowsPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("ScreenRetrieverWindowsPluginCApi")); SharePlusWindowsPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi")); UrlLauncherWindowsRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 9035bebbc..b32875e97 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -7,7 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST media_kit_libs_windows_video media_kit_video permission_handler_windows - screen_retriever + screen_retriever_windows share_plus url_launcher_windows window_manager From 8bcbcd0f11401f75db1bd6ccc98bd7eeeb8c13d2 Mon Sep 17 00:00:00 2001 From: 4sterisk <4sterisk@ymail.ne.jp> Date: Sat, 9 Nov 2024 16:25:55 +0900 Subject: [PATCH 15/28] =?UTF-8?q?[Windows]=E3=82=A6=E3=82=A3=E3=83=B3?= =?UTF-8?q?=E3=83=89=E3=82=A6=E3=81=8C=E9=96=89=E3=81=98=E3=82=8B=E3=81=BE?= =?UTF-8?q?=E3=81=A7=E3=81=AB=E6=99=82=E9=96=93=E3=81=8C=E3=81=8B=E3=81=8B?= =?UTF-8?q?=E3=82=8B=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/main.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index e6aeb47cd..5e0049eeb 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -187,7 +187,8 @@ class MiriaWindowListener with WindowListener { } catch (e) { if (kDebugMode) print(e); } finally { - await windowManager.destroy(); + await windowManager.setPreventClose(false); + await windowManager.close(); } } } From baaf1a7cb9a3ea19b670c167b895ef5439a8686e Mon Sep 17 00:00:00 2001 From: 4sterisk <4sterisk@ymail.ne.jp> Date: Mon, 4 Nov 2024 01:09:13 +0900 Subject: [PATCH 16/28] =?UTF-8?q?=E3=83=87=E3=82=B9=E3=82=AF=E3=83=88?= =?UTF-8?q?=E3=83=83=E3=83=97=E4=BB=A5=E5=A4=96=E3=81=A7=E3=81=AF=5FinitWi?= =?UTF-8?q?ndow=E5=86=85=E3=81=A7=E5=87=A6=E7=90=86=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/main.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/main.dart b/lib/main.dart index 5e0049eeb..cdce35502 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -56,6 +56,7 @@ class Miria extends HookConsumerWidget with WidgetsBindingObserver { } Future _initWindow(WidgetRef ref) async { + if (!isDesktop) return; await windowManager.setPreventClose(true); final config = ref.read(desktopSettingsRepositoryProvider).settings; From cc1d3d618edce03a84a93a19705a7b911e7af976 Mon Sep 17 00:00:00 2001 From: 4sterisk <4sterisk@ymail.ne.jp> Date: Sun, 3 Nov 2024 01:53:29 +0900 Subject: [PATCH 17/28] =?UTF-8?q?=E3=82=A2=E3=83=B3=E3=83=86=E3=83=8A?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=81=AE=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC?= =?UTF-8?q?=E3=81=8C=E7=A9=BA=E3=81=AA=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/view/antenna_page/antenna_settings_dialog.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/view/antenna_page/antenna_settings_dialog.dart b/lib/view/antenna_page/antenna_settings_dialog.dart index 612ae5d24..5d1a1713d 100644 --- a/lib/view/antenna_page/antenna_settings_dialog.dart +++ b/lib/view/antenna_page/antenna_settings_dialog.dart @@ -152,9 +152,12 @@ class AntennaSettingsForm extends HookConsumerWidget { final settings = ref.watch(_antennaSettingsNotifierProvider); final list = ref.watch(_usersListListProvider); final controller = useTextEditingController(); - ref.listen( - _initialSettingsProvider.select((settings) => settings.users.join("\n")), - (_, next) => controller.text = next, + useEffect( + () { + controller.text = settings.users.join("\n"); + return null; + }, + const [], ); return Form( From f6269fe9c35b7f9d0bb1cc798ba0bffb11871f95 Mon Sep 17 00:00:00 2001 From: 4sterisk <4sterisk@ymail.ne.jp> Date: Sun, 10 Nov 2024 01:45:20 +0900 Subject: [PATCH 18/28] =?UTF-8?q?=E3=83=AA=E3=83=8E=E3=83=BC=E3=83=88?= =?UTF-8?q?=E8=A7=A3=E9=99=A4=E6=99=82=E3=82=82=E3=81=A8=E3=81=AE=E3=83=8E?= =?UTF-8?q?=E3=83=BC=E3=83=88=E3=82=92=E5=89=8A=E9=99=A4=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../note_modal_sheet/note_modal_sheet.dart | 53 ++++++++++++------- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/lib/view/note_modal_sheet/note_modal_sheet.dart b/lib/view/note_modal_sheet/note_modal_sheet.dart index 2550b9f53..09bdffa5f 100644 --- a/lib/view/note_modal_sheet/note_modal_sheet.dart +++ b/lib/view/note_modal_sheet/note_modal_sheet.dart @@ -140,14 +140,18 @@ class NoteModalSheetNotifier extends _$NoteModalSheetNotifier { } Future unRenote() async { + if (note.renoteId == null) return; state = state.copyWith(delete: const AsyncLoading()); state = state.copyWith( delete: await ref.read(dialogStateNotifierProvider.notifier).guard( - () async => await ref - .read(misskeyPostContextProvider) - .notes - .delete(NotesDeleteRequest(noteId: note.id)), - ), + () async { + await ref + .read(misskeyPostContextProvider) + .notes + .delete(NotesDeleteRequest(noteId: note.id)); + ref.read(notesWithProvider).delete(note.id); + }, + ), ); } @@ -224,9 +228,12 @@ class NoteModalSheet extends ConsumerWidget implements AutoRouteWrapper { @override Widget build(BuildContext context, WidgetRef ref) { final accounts = ref.watch(accountRepositoryProvider); - final notifierProvider = noteModalSheetNotifierProvider(targetNote); + final targetNoteNotifierProvider = + noteModalSheetNotifierProvider(targetNote); + final baseNoteNotiferProvider = noteModalSheetNotifierProvider(baseNote); - ref.listen(notifierProvider.select((value) => value.user), (_, next) async { + ref.listen(targetNoteNotifierProvider.select((value) => value.user), + (_, next) async { switch (next) { case AsyncData(:final value): await context.pushRoute( @@ -240,10 +247,11 @@ class NoteModalSheet extends ConsumerWidget implements AutoRouteWrapper { case AsyncError(): } }); - final noteStatus = - ref.watch(notifierProvider.select((value) => value.noteState)); + final noteStatus = ref + .watch(targetNoteNotifierProvider.select((value) => value.noteState)); - if (ref.read(notifierProvider).isLoading) { + if (ref.watch(targetNoteNotifierProvider).isLoading || + ref.watch(baseNoteNotiferProvider).isLoading) { return const Center( child: SizedBox( width: 100, @@ -317,7 +325,8 @@ class NoteModalSheet extends ConsumerWidget implements AutoRouteWrapper { leading: const Icon(Icons.person), title: Text(S.of(context).user), trailing: const Icon(Icons.keyboard_arrow_right), - onTap: () async => ref.read(notifierProvider.notifier).user(), + onTap: () async => + ref.read(targetNoteNotifierProvider.notifier).user(), ), ListTile( leading: const Icon(Icons.open_in_browser), @@ -339,7 +348,7 @@ class NoteModalSheet extends ConsumerWidget implements AutoRouteWrapper { onTap: () async { final uri = targetNote.url ?? targetNote.uri; if (uri == null) return; - launchUrl(uri, mode: LaunchMode.externalApplication); + await launchUrl(uri, mode: LaunchMode.externalApplication); if (!context.mounted) return; Navigator.of(context).pop(); }, @@ -363,11 +372,12 @@ class NoteModalSheet extends ConsumerWidget implements AutoRouteWrapper { onTap: () { WidgetsBinding.instance.addPostFrameCallback((timeStamp) { Future(() async { + if (!context.mounted) return; final box = context.findRenderObject() as RenderBox?; if (box == null) return; final boundary = noteBoundaryKey.currentContext! .findRenderObject()! as RenderRepaintBoundary; - await ref.read(notifierProvider.notifier).copyAsImage( + await ref.read(targetNoteNotifierProvider.notifier).copyAsImage( box, boundary, View.of(context).devicePixelRatio, @@ -386,7 +396,9 @@ class NoteModalSheet extends ConsumerWidget implements AutoRouteWrapper { AsyncData(:final value) => ListTile( leading: const Icon(Icons.star_rounded), onTap: () async { - await ref.read(notifierProvider.notifier).favorite(); + await ref + .read(targetNoteNotifierProvider.notifier) + .favorite(); if (!context.mounted) return; Navigator.of(context).pop(); }, @@ -448,7 +460,7 @@ class NoteModalSheet extends ConsumerWidget implements AutoRouteWrapper { leading: const Icon(Icons.delete), title: Text(S.of(context).delete), onTap: () async { - await ref.read(notifierProvider.notifier).delete(); + await ref.read(targetNoteNotifierProvider.notifier).delete(); if (!context.mounted) return; Navigator.of(context).pop(); }, @@ -457,8 +469,9 @@ class NoteModalSheet extends ConsumerWidget implements AutoRouteWrapper { leading: const Icon(Icons.edit_outlined), title: Text(S.of(context).deletedRecreate), onTap: () async { - final result = - await ref.read(notifierProvider.notifier).deleteRecreate(); + final result = await ref + .read(targetNoteNotifierProvider.notifier) + .deleteRecreate(); if (!result || !context.mounted) return; Navigator.of(context).pop(); await context.pushRoute( @@ -482,7 +495,11 @@ class NoteModalSheet extends ConsumerWidget implements AutoRouteWrapper { ListTile( leading: const Icon(Icons.delete), title: Text(S.of(context).deleteRenote), - onTap: () async => ref.read(notifierProvider.notifier).unRenote(), + onTap: () async { + await ref.read(baseNoteNotiferProvider.notifier).unRenote(); + if (!context.mounted) return; + Navigator.of(context).pop(); + }, ), ], if (accountContext.isSame && baseNote.user.host != null || From 40b1cafc10491bc71c31def2f140b964cfd3e078 Mon Sep 17 00:00:00 2001 From: 4sterisk <4sterisk@ymail.ne.jp> Date: Sun, 10 Nov 2024 02:19:42 +0900 Subject: [PATCH 19/28] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=81=AB?= =?UTF-8?q?=E3=83=AA=E3=83=8E=E3=83=BC=E3=83=88ID=E3=82=92=E5=90=AB?= =?UTF-8?q?=E3=82=81=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../view/common/misskey_notes/note_modal_sheet_test.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/view/common/misskey_notes/note_modal_sheet_test.dart b/test/view/common/misskey_notes/note_modal_sheet_test.dart index 086d849e7..d03f4b561 100644 --- a/test/view/common/misskey_notes/note_modal_sheet_test.dart +++ b/test/view/common/misskey_notes/note_modal_sheet_test.dart @@ -371,8 +371,13 @@ void main() { ); when(misskey.notes).thenReturn(misskeyNotes); when(misskeyNotes.featured(any)).thenAnswer( - (e) async => - [TestData.note1.copyWith(text: null, renote: TestData.note2)], + (e) async => [ + TestData.note1.copyWith( + text: null, + renoteId: TestData.note2.id, + renote: TestData.note2, + ) + ], ); await tester.pumpWidget( ProviderScope( From 7166b3e7727f8f82aac20f6b5acb48ae8100a396 Mon Sep 17 00:00:00 2001 From: 4sterisk <4sterisk@ymail.ne.jp> Date: Sun, 10 Nov 2024 03:19:11 +0900 Subject: [PATCH 20/28] =?UTF-8?q?=E9=9F=B3=E6=A5=BD=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E3=81=A7=E3=81=AF=E3=82=B5=E3=83=A0=E3=83=8D?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/view/common/misskey_notes/misskey_file_view.dart | 4 +++- lib/view/common/note_file_dialog/media_viewer.dart | 11 ++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/view/common/misskey_notes/misskey_file_view.dart b/lib/view/common/misskey_notes/misskey_file_view.dart index 263706420..19431cd69 100644 --- a/lib/view/common/misskey_notes/misskey_file_view.dart +++ b/lib/view/common/misskey_notes/misskey_file_view.dart @@ -70,7 +70,9 @@ class MisskeyFileView extends HookConsumerWidget { width: double.infinity, child: MisskeyImage( isSensitive: targetFile.element.isSensitive, - thumbnailUrl: targetFile.element.thumbnailUrl, + thumbnailUrl: (targetFile.element.type.startsWith("audio")) + ? null + : targetFile.element.thumbnailUrl, targetFiles: targetFiles, fileType: targetFile.element.type, name: targetFile.element.name, diff --git a/lib/view/common/note_file_dialog/media_viewer.dart b/lib/view/common/note_file_dialog/media_viewer.dart index a8d17752c..44cd54f13 100644 --- a/lib/view/common/note_file_dialog/media_viewer.dart +++ b/lib/view/common/note_file_dialog/media_viewer.dart @@ -36,11 +36,12 @@ class MediaViewer extends HookConsumerWidget { fit: StackFit.passthrough, alignment: Alignment.center, children: [ - NetworkImageView( - url: file.thumbnailUrl.toString(), - type: ImageType.imageThumbnail, - fit: BoxFit.contain, - ), + if (!file.type.startsWith("audio")) + NetworkImageView( + url: file.thumbnailUrl.toString(), + type: ImageType.imageThumbnail, + fit: BoxFit.contain, + ), Icon( Icons.play_circle, size: 100, From 05071b7932b228456e4f2f9dccad29eccc80da70 Mon Sep 17 00:00:00 2001 From: 4sterisk <4sterisk@ymail.ne.jp> Date: Sat, 9 Nov 2024 23:42:32 +0900 Subject: [PATCH 21/28] =?UTF-8?q?=E3=82=BF=E3=83=96=E8=A8=AD=E5=AE=9A?= =?UTF-8?q?=E3=80=81=E8=A8=AD=E5=AE=9A=E3=81=AE=E3=82=A4=E3=83=B3=E3=83=9D?= =?UTF-8?q?=E3=83=BC=E3=83=88=E3=81=A7=E3=83=95=E3=83=AA=E3=83=BC=E3=82=BA?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/repository/import_export_repository.dart | 6 ++++-- .../account_settings_page/account_list.dart | 12 ++++-------- .../tab_settings_page/tab_settings_list_page.dart | 8 ++++---- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/lib/repository/import_export_repository.dart b/lib/repository/import_export_repository.dart index 9966b1765..6ef46dbd2 100644 --- a/lib/repository/import_export_repository.dart +++ b/lib/repository/import_export_repository.dart @@ -108,8 +108,10 @@ class ImportExportRepository extends ChangeNotifier { await SimpleMessageDialog.show(context, S.of(context).importCompleted); if (!context.mounted) return; - context.router.removeWhere((route) => true); - await context.router.push(const SplashRoute()); + await context.router.pushAndPopUntil( + const SplashRoute(), + predicate: (_) => false, + ); } Future export(BuildContext context, Account account) async { diff --git a/lib/view/settings_page/account_settings_page/account_list.dart b/lib/view/settings_page/account_settings_page/account_list.dart index a25e477f2..628ad9777 100644 --- a/lib/view/settings_page/account_settings_page/account_list.dart +++ b/lib/view/settings_page/account_settings_page/account_list.dart @@ -59,14 +59,10 @@ class AccountListPage extends ConsumerWidget { child: Padding( padding: const EdgeInsets.all(10), child: ElevatedButton( - onPressed: () async { - final newState = ref.refresh(accountsProvider); - print(newState); - final router = context.router..removeWhere((route) => true); - WidgetsBinding.instance.addPostFrameCallback((_) async { - await router.push(const SplashRoute()); - }); - }, + onPressed: () async => await context.router.pushAndPopUntil( + const SplashRoute(), + predicate: (_) => false, + ), child: Text(S.of(context).quitAccountSettings), ), ), diff --git a/lib/view/settings_page/tab_settings_page/tab_settings_list_page.dart b/lib/view/settings_page/tab_settings_page/tab_settings_list_page.dart index f5fc4ae52..850f3a1f3 100644 --- a/lib/view/settings_page/tab_settings_page/tab_settings_list_page.dart +++ b/lib/view/settings_page/tab_settings_page/tab_settings_list_page.dart @@ -78,10 +78,10 @@ class TabSettingsListPage extends ConsumerWidget { child: Padding( padding: const EdgeInsets.all(10), child: ElevatedButton( - onPressed: () async { - context.router.removeWhere((route) => true); - await context.router.push(const SplashRoute()); - }, + onPressed: () async => await context.router.pushAndPopUntil( + const SplashRoute(), + predicate: (_) => false, + ), child: Text(S.of(context).apply), ), ), From b9ff46aa8232176118d4f44a57f39c4961ee2315 Mon Sep 17 00:00:00 2001 From: sorairo Date: Sun, 10 Nov 2024 15:03:26 +0900 Subject: [PATCH 22/28] Fix #648 --- lib/view/common/misskey_notes/misskey_note.dart | 9 ++++++--- lib/view/common/misskey_notes/reaction_button.dart | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/view/common/misskey_notes/misskey_note.dart b/lib/view/common/misskey_notes/misskey_note.dart index 6de90fb40..4236884ce 100644 --- a/lib/view/common/misskey_notes/misskey_note.dart +++ b/lib/view/common/misskey_notes/misskey_note.dart @@ -133,6 +133,7 @@ class MisskeyNote extends HookConsumerWidget { } await ref.read(dialogStateNotifierProvider.notifier).guard(() async { + final notesRepository = ref.read(notesProvider(account)); await ref .read(misskeyPostContextProvider) .notes @@ -143,7 +144,7 @@ class MisskeyNote extends HookConsumerWidget { const Duration(milliseconds: misskeyHQReactionDelay), ); } - await ref.read(notesProvider(account)).refresh(displayNote.id); + await notesRepository.refresh(displayNote.id); return; }); } @@ -349,6 +350,7 @@ class MisskeyNote extends HookConsumerWidget { if (dialogValue != 0) return; await ref.read(dialogStateNotifierProvider.notifier).guard(() async { + final notesRepository = ref.read(notesWithProvider); await ref .read(misskeyPostContextProvider) .notes @@ -361,7 +363,7 @@ class MisskeyNote extends HookConsumerWidget { ); } - await ref.read(notesWithProvider).refresh(displayNote.id); + await notesRepository.refresh(displayNote.id); }); return; @@ -387,6 +389,7 @@ class MisskeyNote extends HookConsumerWidget { true) { return; } + final notesRepository = ref.read(notesProvider(account)); await ref .read(misskeyPostContextProvider) @@ -398,7 +401,7 @@ class MisskeyNote extends HookConsumerWidget { const Duration(milliseconds: misskeyHQReactionDelay), ); } - await ref.read(notesProvider(account)).refresh(displayNote.id); + await notesRepository.refresh(displayNote.id); return; } final misskey = ref.read(misskeyPostContextProvider); diff --git a/lib/view/common/misskey_notes/reaction_button.dart b/lib/view/common/misskey_notes/reaction_button.dart index 732a760d4..aa5b3ae35 100644 --- a/lib/view/common/misskey_notes/reaction_button.dart +++ b/lib/view/common/misskey_notes/reaction_button.dart @@ -65,6 +65,7 @@ class ReactionButton extends HookConsumerWidget { if (dialogValue != 0) return; await ref.read(dialogStateNotifierProvider.notifier).guard(() async { + final notesRepository = ref.read(notesWithProvider); await ref .read(misskeyPostContextProvider) .notes @@ -76,7 +77,7 @@ class ReactionButton extends HookConsumerWidget { ); } - await ref.read(notesWithProvider).refresh(noteId); + await notesRepository.refresh(noteId); }); return; @@ -96,6 +97,7 @@ class ReactionButton extends HookConsumerWidget { return; } await ref.read(dialogStateNotifierProvider.notifier).guard(() async { + final notesRepository = ref.read(notesWithProvider); await ref.read(misskeyPostContextProvider).notes.reactions.create( NotesReactionsCreateRequest( noteId: noteId, @@ -110,7 +112,7 @@ class ReactionButton extends HookConsumerWidget { ); } - await ref.read(notesWithProvider).refresh(noteId); + await notesRepository.refresh(noteId); }); }); From 5c4e4617921bcd5f19c640fd43661425d6ac69e3 Mon Sep 17 00:00:00 2001 From: sorairo Date: Sun, 10 Nov 2024 15:54:37 +0900 Subject: [PATCH 23/28] Fix #630 --- ios/Podfile.lock | 2 +- lib/view/note_create_page/vote_area.dart | 20 +++++++++++++------- macos/Podfile.lock | 6 ------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 2dd1fa0d1..907199eed 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -215,6 +215,6 @@ SPEC CHECKSUMS: wakelock_plus: 78ec7c5b202cab7761af8e2b2b3d0671be6c4ae1 webview_flutter_wkwebview: 0982481e3d9c78fd5c6f62a002fcd24fc791f1e4 -PODFILE CHECKSUM: 9a5aff7d2a4fe2dcc914618b99f9ff063b14915b +PODFILE CHECKSUM: fc9f5883117ffc5dbdfedd53e44b13710e7871f2 COCOAPODS: 1.14.3 diff --git a/lib/view/note_create_page/vote_area.dart b/lib/view/note_create_page/vote_area.dart index c302dbca9..16527c51a 100644 --- a/lib/view/note_create_page/vote_area.dart +++ b/lib/view/note_create_page/vote_area.dart @@ -66,17 +66,23 @@ class VoteContentListItem extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { + final onVoteContentChange = ref.watch( + noteCreateNotifierProvider + .select((notifier) => notifier.voteContent.length), + ); + final initial = useMemoized( () => ref.read(noteCreateNotifierProvider).voteContent[index], + [onVoteContentChange], ); final controller = useTextEditingController(text: initial); - ref.listen( - noteCreateNotifierProvider.select( - (value) => - value.voteContent.length <= index ? "" : value.voteContent[index], - ), (_, next) { - controller.text = next; - }); + useEffect( + () { + controller.text = initial; + return null; + }, + [initial], + ); useEffect( () { controller.addListener(() { diff --git a/macos/Podfile.lock b/macos/Podfile.lock index a50cdd8fc..930eb2ad0 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -20,8 +20,6 @@ PODS: - path_provider_foundation (0.0.1): - Flutter - FlutterMacOS - - screen_brightness_macos (0.1.0): - - FlutterMacOS - screen_retriever (0.0.1): - FlutterMacOS - share_plus (0.0.1): @@ -53,7 +51,6 @@ DEPENDENCIES: - media_kit_video (from `Flutter/ephemeral/.symlinks/plugins/media_kit_video/macos`) - package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`) - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`) - - screen_brightness_macos (from `Flutter/ephemeral/.symlinks/plugins/screen_brightness_macos/macos`) - screen_retriever (from `Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos`) - share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`) - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`) @@ -84,8 +81,6 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos path_provider_foundation: :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin - screen_brightness_macos: - :path: Flutter/ephemeral/.symlinks/plugins/screen_brightness_macos/macos screen_retriever: :path: Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos share_plus: @@ -114,7 +109,6 @@ SPEC CHECKSUMS: media_kit_video: c75b07f14d59706c775778e4dd47dd027de8d1e5 package_info_plus: f5790acc797bf17c3e959e9d6cf162cc68ff7523 path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 - screen_brightness_macos: 2d6d3af2165592d9a55ffcd95b7550970e41ebda screen_retriever: 59634572a57080243dd1bf715e55b6c54f241a38 share_plus: 36537c04ce0c3e3f5bd297ce4318b6d5ee5fd6cf shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78 From 86857321e5cc3435bca68c84d1613d4dc183e91c Mon Sep 17 00:00:00 2001 From: sorairo Date: Sun, 10 Nov 2024 16:11:17 +0900 Subject: [PATCH 24/28] fix notifier timing --- lib/view/note_create_page/vote_area.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/view/note_create_page/vote_area.dart b/lib/view/note_create_page/vote_area.dart index 16527c51a..2cc6ffdb0 100644 --- a/lib/view/note_create_page/vote_area.dart +++ b/lib/view/note_create_page/vote_area.dart @@ -90,13 +90,14 @@ class VoteContentListItem extends HookConsumerWidget { index) { return; } - ref - .read(noteCreateNotifierProvider.notifier) - .setVoteContent(index, controller.text); + final notifier = ref.read(noteCreateNotifierProvider.notifier); + WidgetsBinding.instance.addPostFrameCallback((_) { + notifier.setVoteContent(index, controller.text); + }); }); return null; }, - [index], + [index, initial], ); return Padding( padding: const EdgeInsets.only(bottom: 5), From f4660f45f020c5bae86475885273193d32f1a09e Mon Sep 17 00:00:00 2001 From: sorairo Date: Sun, 10 Nov 2024 16:18:34 +0900 Subject: [PATCH 25/28] Fix #670 --- lib/repository/general_settings_repository.dart | 2 +- .../general_settings_page/general_settings_page.dart | 3 ++- macos/Podfile.lock | 10 +++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/repository/general_settings_repository.dart b/lib/repository/general_settings_repository.dart index 3edd9c163..a8e67b378 100644 --- a/lib/repository/general_settings_repository.dart +++ b/lib/repository/general_settings_repository.dart @@ -25,8 +25,8 @@ class GeneralSettingsRepository extends ChangeNotifier { Future update(GeneralSettings settings) async { _settings = settings; - notifyListeners(); final prefs = await SharedPreferences.getInstance(); await prefs.setString("general_settings", jsonEncode(settings.toJson())); + notifyListeners(); } } diff --git a/lib/view/settings_page/general_settings_page/general_settings_page.dart b/lib/view/settings_page/general_settings_page/general_settings_page.dart index a0dd4b9c1..0acb89650 100644 --- a/lib/view/settings_page/general_settings_page/general_settings_page.dart +++ b/lib/view/settings_page/general_settings_page/general_settings_page.dart @@ -68,7 +68,8 @@ class GeneralSettingsPage extends HookConsumerWidget { enableLongTextElipsed.value, tabPosition.value, emojiType.value, - textScaleFactor.value, + // 変更ボタンを押すまで反映しない + // textScaleFactor.value, defaultFontName.value, serifFontName.value, monospaceFontName.value, diff --git a/macos/Podfile.lock b/macos/Podfile.lock index 930eb2ad0..589257cc3 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -20,7 +20,7 @@ PODS: - path_provider_foundation (0.0.1): - Flutter - FlutterMacOS - - screen_retriever (0.0.1): + - screen_retriever_macos (0.0.1): - FlutterMacOS - share_plus (0.0.1): - FlutterMacOS @@ -51,7 +51,7 @@ DEPENDENCIES: - media_kit_video (from `Flutter/ephemeral/.symlinks/plugins/media_kit_video/macos`) - package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`) - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`) - - screen_retriever (from `Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos`) + - screen_retriever_macos (from `Flutter/ephemeral/.symlinks/plugins/screen_retriever_macos/macos`) - share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`) - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`) - sqflite_darwin (from `Flutter/ephemeral/.symlinks/plugins/sqflite_darwin/darwin`) @@ -81,8 +81,8 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos path_provider_foundation: :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin - screen_retriever: - :path: Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos + screen_retriever_macos: + :path: Flutter/ephemeral/.symlinks/plugins/screen_retriever_macos/macos share_plus: :path: Flutter/ephemeral/.symlinks/plugins/share_plus/macos shared_preferences_foundation: @@ -109,7 +109,7 @@ SPEC CHECKSUMS: media_kit_video: c75b07f14d59706c775778e4dd47dd027de8d1e5 package_info_plus: f5790acc797bf17c3e959e9d6cf162cc68ff7523 path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 - screen_retriever: 59634572a57080243dd1bf715e55b6c54f241a38 + screen_retriever_macos: 776e0fa5d42c6163d2bf772d22478df4b302b161 share_plus: 36537c04ce0c3e3f5bd297ce4318b6d5ee5fd6cf shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78 sqflite_darwin: a553b1fd6fe66f53bbb0fe5b4f5bab93f08d7a13 From e0b866159c596d1682a979e14c2f397395129848 Mon Sep 17 00:00:00 2001 From: sorairo Date: Sun, 10 Nov 2024 19:18:40 +0900 Subject: [PATCH 26/28] =?UTF-8?q?Fix=20#630=20k=E3=81=8A=E3=82=93=E3=81=A9?= =?UTF-8?q?=E3=81=93=EF=BD=93=E3=81=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/view/note_create_page/vote_area.dart | 32 +++++++++++------------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/lib/view/note_create_page/vote_area.dart b/lib/view/note_create_page/vote_area.dart index 2cc6ffdb0..d1fed557f 100644 --- a/lib/view/note_create_page/vote_area.dart +++ b/lib/view/note_create_page/vote_area.dart @@ -68,7 +68,7 @@ class VoteContentListItem extends HookConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final onVoteContentChange = ref.watch( noteCreateNotifierProvider - .select((notifier) => notifier.voteContent.length), + .select((notifier) => notifier.voteContentCount), ); final initial = useMemoized( @@ -78,26 +78,22 @@ class VoteContentListItem extends HookConsumerWidget { final controller = useTextEditingController(text: initial); useEffect( () { - controller.text = initial; - return null; - }, - [initial], - ); - useEffect( - () { - controller.addListener(() { - if (ref.read(noteCreateNotifierProvider).voteContent.length <= - index) { - return; - } - final notifier = ref.read(noteCreateNotifierProvider.notifier); - WidgetsBinding.instance.addPostFrameCallback((_) { - notifier.setVoteContent(index, controller.text); + controller + ..text = initial + ..addListener(() { + final voteContent = + ref.read(noteCreateNotifierProvider).voteContent; + if (voteContent.length <= index || + voteContent[index] == controller.text) { + return; + } + ref + .read(noteCreateNotifierProvider.notifier) + .setVoteContent(index, controller.text); }); - }); return null; }, - [index, initial], + [index, onVoteContentChange], ); return Padding( padding: const EdgeInsets.only(bottom: 5), From 00541cbf3ffa08699c163f53d12914ef865218a0 Mon Sep 17 00:00:00 2001 From: sorairo Date: Sun, 10 Nov 2024 19:27:31 +0900 Subject: [PATCH 27/28] Fix #647 --- lib/view/user_page/user_info_notifier.dart | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/view/user_page/user_info_notifier.dart b/lib/view/user_page/user_info_notifier.dart index 78be30fe8..505bfe241 100644 --- a/lib/view/user_page/user_info_notifier.dart +++ b/lib/view/user_page/user_info_notifier.dart @@ -202,7 +202,10 @@ class UserInfoNotifier extends _$UserInfoNotifier { final expires = await ref.read(appRouterProvider).push( const ExpireSelectRoute(), ); - if (expires == null) return null; + if (expires == null) { + await ref.read(appRouterProvider).maybePop(); + return null; + } final expiresDate = expires == Expire.indefinite ? null : DateTime.now().add(expires.expires!); @@ -292,7 +295,10 @@ class UserInfoNotifier extends _$UserInfoNotifier { S.of(context).cancel, ], ); - if (confirm == 1) return null; + if (confirm == 1) { + await ref.read(appRouterProvider).maybePop(); + return null; + } return await _dialog.guard(() async { await _postMisskey.blocking.create(BlockCreateRequest(userId: userId)); From 2773561daa868128b6a50b760e6b8a14a506e74f Mon Sep 17 00:00:00 2001 From: sorairo Date: Sun, 10 Nov 2024 19:28:03 +0900 Subject: [PATCH 28/28] =?UTF-8?q?PushableListView=E3=81=AE=E7=94=BB?= =?UTF-8?q?=E9=9D=A2=E3=81=A1=E3=82=89=E3=81=A4=E3=81=8D=E3=82=92=E9=98=B2?= =?UTF-8?q?=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/view/common/pushable_listview.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/view/common/pushable_listview.dart b/lib/view/common/pushable_listview.dart index e4c04a71d..4c48f9986 100644 --- a/lib/view/common/pushable_listview.dart +++ b/lib/view/common/pushable_listview.dart @@ -107,7 +107,10 @@ class PushableListView extends HookConsumerWidget { return const Center( child: Padding( padding: EdgeInsets.all(20), - child: CircularProgressIndicator.adaptive(), + child: SizedBox.square( + dimension: 100, + child: CircularProgressIndicator.adaptive(), + ), ), ); }