From e0f5e5dd0ddddccd3edef3e758c7df20e04e343f Mon Sep 17 00:00:00 2001 From: kenny lopez Date: Sun, 16 Aug 2026 14:14:47 +0100 Subject: [PATCH] fix(mobile): address timeline review feedback Signed-off-by: kenny lopez --- .../channel_detail_page/message_list.dart | 1 + .../channels/jump_to_latest_button.dart | 5 ++-- .../features/channels/sticky_date_header.dart | 5 ++-- .../channels/jump_to_latest_button_test.dart | 17 ++++++++----- .../channels/sticky_date_header_test.dart | 25 ++++++++++++------- 5 files changed, 34 insertions(+), 19 deletions(-) diff --git a/mobile/lib/features/channels/channel_detail_page/message_list.dart b/mobile/lib/features/channels/channel_detail_page/message_list.dart index c411f4760..59e4c746f 100644 --- a/mobile/lib/features/channels/channel_detail_page/message_list.dart +++ b/mobile/lib/features/channels/channel_detail_page/message_list.dart @@ -516,6 +516,7 @@ class _MessageList extends HookConsumerWidget { entries.length, itemPositionsListener, appBarTitleContentHeight, + composerBottomInset, ], ); diff --git a/mobile/lib/features/channels/jump_to_latest_button.dart b/mobile/lib/features/channels/jump_to_latest_button.dart index 314fb624e..cb6b703a3 100644 --- a/mobile/lib/features/channels/jump_to_latest_button.dart +++ b/mobile/lib/features/channels/jump_to_latest_button.dart @@ -6,12 +6,13 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:lucide_icons_flutter/lucide_icons.dart'; import '../../shared/theme/theme.dart'; /// Compact conversation control that returns a detached timeline to its tail. -class JumpToLatestButton extends HookWidget { +class JumpToLatestButton extends HookConsumerWidget { final VoidCallback onPressed; const JumpToLatestButton({required this.onPressed, super.key}); @@ -19,7 +20,7 @@ class JumpToLatestButton extends HookWidget { static const _iosViewType = 'buzz/jump_to_latest_glass'; @override - Widget build(BuildContext context) { + Widget build(BuildContext context, WidgetRef ref) { final nativeChannel = useState(null); final onPressedRef = useRef(onPressed)..value = onPressed; final brightness = context.theme.brightness.name; diff --git a/mobile/lib/features/channels/sticky_date_header.dart b/mobile/lib/features/channels/sticky_date_header.dart index cad7f452b..f6d17d2b9 100644 --- a/mobile/lib/features/channels/sticky_date_header.dart +++ b/mobile/lib/features/channels/sticky_date_header.dart @@ -7,6 +7,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import '../../shared/theme/theme.dart'; @@ -154,7 +155,7 @@ class StickyDateHeader extends StatelessWidget { } } -class _IosStickyDateGlass extends HookWidget { +class _IosStickyDateGlass extends HookConsumerWidget { final String label; final double width; final double height; @@ -166,7 +167,7 @@ class _IosStickyDateGlass extends HookWidget { }); @override - Widget build(BuildContext context) { + Widget build(BuildContext context, WidgetRef ref) { final nativeChannel = useState(null); final brightness = context.theme.brightness.name; diff --git a/mobile/test/features/channels/jump_to_latest_button_test.dart b/mobile/test/features/channels/jump_to_latest_button_test.dart index b934f83aa..26b504558 100644 --- a/mobile/test/features/channels/jump_to_latest_button_test.dart +++ b/mobile/test/features/channels/jump_to_latest_button_test.dart @@ -4,6 +4,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; void main() { testWidgets('keeps the native iOS glass in sync with the app theme', ( @@ -20,9 +21,11 @@ void main() { }); try { await tester.pumpWidget( - MaterialApp( - theme: AppTheme.light(), - home: Scaffold(body: JumpToLatestButton(onPressed: () {})), + ProviderScope( + child: MaterialApp( + theme: AppTheme.light(), + home: Scaffold(body: JumpToLatestButton(onPressed: () {})), + ), ), ); @@ -47,9 +50,11 @@ void main() { methodCalls.clear(); await tester.pumpWidget( - MaterialApp( - theme: AppTheme.dark(), - home: Scaffold(body: JumpToLatestButton(onPressed: () {})), + ProviderScope( + child: MaterialApp( + theme: AppTheme.dark(), + home: Scaffold(body: JumpToLatestButton(onPressed: () {})), + ), ), ); await tester.pumpAndSettle(); diff --git a/mobile/test/features/channels/sticky_date_header_test.dart b/mobile/test/features/channels/sticky_date_header_test.dart index c6c012ba0..5f89ebb81 100644 --- a/mobile/test/features/channels/sticky_date_header_test.dart +++ b/mobile/test/features/channels/sticky_date_header_test.dart @@ -4,6 +4,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; void main() { testWidgets('updates the native iOS glass date and app theme', ( @@ -23,9 +24,11 @@ void main() { }); try { await tester.pumpWidget( - MaterialApp( - theme: AppTheme.light(), - home: Scaffold(body: StickyDateHeader(state: state)), + ProviderScope( + child: MaterialApp( + theme: AppTheme.light(), + home: Scaffold(body: StickyDateHeader(state: state)), + ), ), ); @@ -65,9 +68,11 @@ void main() { methodCalls.clear(); await tester.pumpWidget( - MaterialApp( - theme: AppTheme.dark(), - home: Scaffold(body: StickyDateHeader(state: state)), + ProviderScope( + child: MaterialApp( + theme: AppTheme.dark(), + home: Scaffold(body: StickyDateHeader(state: state)), + ), ), ); await tester.pumpAndSettle(); @@ -93,9 +98,11 @@ void main() { final state = ValueNotifier(const StickyDateHeaderState(label: 'Today')); try { await tester.pumpWidget( - MaterialApp( - theme: AppTheme.light(), - home: Scaffold(body: StickyDateHeader(state: state)), + ProviderScope( + child: MaterialApp( + theme: AppTheme.light(), + home: Scaffold(body: StickyDateHeader(state: state)), + ), ), );