mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
fix tablet inbox review findings
Signed-off-by: kenny lopez <klopez4212@gmail.com>
This commit is contained in:
@@ -121,6 +121,7 @@ class ActivityPage extends HookConsumerWidget {
|
||||
(item) => item.conversationId == selectedItemId.value,
|
||||
);
|
||||
final retainsSelectedDetail =
|
||||
unreadOnly.value &&
|
||||
selectedItemForDetail.value?.conversationId == selectedItemId.value;
|
||||
if (!hasSelectedItem && !retainsSelectedDetail) {
|
||||
selectedItemId.value = visibleItems.first.conversationId;
|
||||
@@ -134,7 +135,7 @@ class ActivityPage extends HookConsumerWidget {
|
||||
(item) => item?.conversationId == selectedItemId.value,
|
||||
orElse: () => null,
|
||||
) ??
|
||||
selectedItemForDetail.value;
|
||||
(unreadOnly.value ? selectedItemForDetail.value : null);
|
||||
|
||||
// Preload sender profiles for visible rows.
|
||||
final preloadPubkeys = {
|
||||
@@ -461,9 +462,11 @@ class _WideActivityDetail extends HookWidget {
|
||||
return const _WideActivityEmptyDetail();
|
||||
}
|
||||
|
||||
final navigatorKey = useMemoized(GlobalKey<NavigatorState>.new, [item!.id]);
|
||||
final navigatorKey = useMemoized(GlobalKey<NavigatorState>.new, [
|
||||
item!.conversationId,
|
||||
]);
|
||||
return NavigatorPopHandler(
|
||||
key: ValueKey('wide-activity-detail-${item!.id}'),
|
||||
key: ValueKey('wide-activity-detail-${item!.conversationId}'),
|
||||
onPopWithResult: (_) => navigatorKey.currentState?.maybePop(),
|
||||
child: Navigator(
|
||||
key: navigatorKey,
|
||||
|
||||
@@ -27,8 +27,6 @@ import '../profile/profile_avatar.dart';
|
||||
import '../profile/profile_provider.dart';
|
||||
import '../profile/presence_cache_provider.dart';
|
||||
import '../profile/user_cache_provider.dart';
|
||||
import '../profile/user_profile.dart';
|
||||
import '../profile/user_status_provider.dart';
|
||||
import '../pairing/pairing_page.dart';
|
||||
import '../pairing/pairing_provider.dart';
|
||||
import 'channel.dart';
|
||||
|
||||
@@ -608,17 +608,10 @@ class _WideNavigationProfile extends ConsumerWidget {
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final palette = _wideSidebarPalette(context);
|
||||
final profile = ref.watch(profileProvider).value;
|
||||
final status = ref.watch(userStatusProvider).asData?.value;
|
||||
final displayName = profile?.displayName?.trim();
|
||||
final name = displayName != null && displayName.isNotEmpty
|
||||
? displayName
|
||||
: 'You';
|
||||
final statusEmoji = status?.emoji ?? '';
|
||||
final statusText = status?.text.trim() ?? '';
|
||||
final statusLabel = [
|
||||
if (statusEmoji.isNotEmpty) statusEmoji,
|
||||
if (statusText.isNotEmpty) statusText,
|
||||
].join(' ');
|
||||
|
||||
return SizedBox(
|
||||
key: const Key('wide-navigation-profile'),
|
||||
@@ -659,17 +652,6 @@ class _WideNavigationProfile extends ConsumerWidget {
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
if (statusLabel.isNotEmpty) ...[
|
||||
const SizedBox(height: Grid.quarter),
|
||||
Text(
|
||||
statusLabel,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context.textTheme.labelSmall?.copyWith(
|
||||
color: palette.mutedForeground,
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -701,7 +683,7 @@ class _WideNavigationProfile extends ConsumerWidget {
|
||||
class _WideChannelDestination extends StatelessWidget {
|
||||
final Channel channel;
|
||||
final String label;
|
||||
final UserProfile? directMessageProfile;
|
||||
final dynamic directMessageProfile;
|
||||
final bool selected;
|
||||
final VoidCallback onTap;
|
||||
|
||||
@@ -876,7 +858,7 @@ class _WideNavigationDestination extends StatelessWidget {
|
||||
String _wideSidebarChannelLabel(
|
||||
Channel channel, {
|
||||
required String? currentPubkey,
|
||||
required Map<String, UserProfile> profiles,
|
||||
required Map<String, dynamic> profiles,
|
||||
}) {
|
||||
if (!channel.isDm) return channel.displayLabel();
|
||||
|
||||
@@ -899,10 +881,10 @@ String _wideSidebarChannelLabel(
|
||||
return resolveDmChannelDisplayLabel(channel, currentPubkey: currentPubkey);
|
||||
}
|
||||
|
||||
UserProfile? _wideSidebarDirectMessageProfile(
|
||||
dynamic _wideSidebarDirectMessageProfile(
|
||||
Channel channel, {
|
||||
required String? currentPubkey,
|
||||
required Map<String, UserProfile> profiles,
|
||||
required Map<String, dynamic> profiles,
|
||||
}) {
|
||||
if (!channel.isDm) return null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user