From ee33495f14f6eec40955e49488b984e0993b051a Mon Sep 17 00:00:00 2001 From: poppingmoon <63451158+poppingmoon@users.noreply.github.com> Date: Sat, 15 Mar 2025 11:38:45 +0900 Subject: [PATCH 1/2] feat: update children notes on reply or quote --- lib/view/widget/post_form.dart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/view/widget/post_form.dart b/lib/view/widget/post_form.dart index f04bd01e..5317abe6 100644 --- a/lib/view/widget/post_form.dart +++ b/lib/view/widget/post_form.dart @@ -24,6 +24,7 @@ import '../../provider/account_settings_notifier_provider.dart'; import '../../provider/accounts_notifier_provider.dart'; import '../../provider/api/attaches_notifier_provider.dart'; import '../../provider/api/channel_notifier_provider.dart'; +import '../../provider/api/children_notes_notifier_provider.dart'; import '../../provider/api/i_notifier_provider.dart'; import '../../provider/api/misskey_provider.dart'; import '../../provider/api/user_notifier_provider.dart'; @@ -165,6 +166,12 @@ class PostForm extends HookConsumerWidget { unawaited( ref.read(postFormHashtagsNotifierProvider(account).notifier).save(), ); + if (note.replyId case final replyId?) { + ref.invalidate(childrenNotesNotifierProvider(account, replyId)); + } + if (note.renoteId case final renoteId?) { + ref.invalidate(childrenNotesNotifierProvider(account, renoteId)); + } ref.invalidate(attachesNotifierProvider(account, noteId: noteId)); ref.context.pop(); } From 324c0281e4f6b4160f71ad3a032b799c231d803c Mon Sep 17 00:00:00 2001 From: poppingmoon <63451158+poppingmoon@users.noreply.github.com> Date: Sat, 15 Mar 2025 11:50:06 +0900 Subject: [PATCH 2/2] fix: reduce height of divider --- lib/view/widget/note_detailed_widget.dart | 41 ++++++++++------------- 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/lib/view/widget/note_detailed_widget.dart b/lib/view/widget/note_detailed_widget.dart index f8452a58..3cc5aab8 100644 --- a/lib/view/widget/note_detailed_widget.dart +++ b/lib/view/widget/note_detailed_widget.dart @@ -102,6 +102,7 @@ class NoteDetailedWidget extends HookConsumerWidget { ? ref.watch(conversationNotesProvider(account, noteId)) : null; final isRenote = note.isRenote; + final theme = Theme.of(context); final style = DefaultTextStyle.of(context).style; return InkWell( @@ -221,16 +222,15 @@ class NoteDetailedWidget extends HookConsumerWidget { decoration: BoxDecoration( border: BorderDirectional( start: BorderSide( - color: - Theme.of( - context, - ).colorScheme.outlineVariant, + color: theme.colorScheme.outlineVariant, width: 2.0, ), ), ), padding: const EdgeInsetsDirectional.only( start: 4.0, + top: 4.0, + bottom: 4.0, ), child: NoteSubWidget( account: account, @@ -254,25 +254,19 @@ class NoteDetailedWidget extends HookConsumerWidget { separatorBuilder: (context, index) => index < notes.length - 1 - ? ChannelColorBarBox( - note: note, - child: Container( - margin: EdgeInsetsDirectional.only( - start: horizontalPadding - 4.0, - ), - decoration: BoxDecoration( - border: BorderDirectional( - start: BorderSide( - color: - Theme.of( - context, - ).colorScheme.outlineVariant, - width: 2.0, - ), + ? Container( + margin: EdgeInsetsDirectional.only( + start: horizontalPadding - 4.0, + ), + decoration: BoxDecoration( + border: BorderDirectional( + start: BorderSide( + color: theme.colorScheme.outlineVariant, + width: 2.0, ), ), - child: const Divider(), ), + child: const Divider(height: 0.0), ) : const SizedBox.shrink(), itemCount: notes.length + 1, @@ -337,9 +331,8 @@ class _NoteDetailedContent extends HookConsumerWidget { ), ), ); - final colors = ref.watch( - misskeyColorsProvider(Theme.of(context).brightness), - ); + final theme = Theme.of(context); + final colors = ref.watch(misskeyColorsProvider(theme.brightness)); return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -470,7 +463,7 @@ class _NoteDetailedContent extends HookConsumerWidget { padding: const EdgeInsetsDirectional.only(end: 4.0), child: Icon( Icons.reply, - color: Theme.of(context).colorScheme.primary, + color: theme.colorScheme.primary, ), ), ),