fix mobile status provider layering

Signed-off-by: kenny lopez <klopez4212@gmail.com>
This commit is contained in:
kenny lopez
2026-08-03 18:24:57 +01:00
parent 737d3d1aef
commit 97294b4caa
13 changed files with 35 additions and 16 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ import 'features/home/home_page.dart';
import 'features/pairing/pairing_page.dart';
import 'features/channels/agent_activity/observer_subscription.dart';
import 'features/channels/deep_link_dispatcher.dart';
import 'features/profile/user_status_cache_provider.dart';
import 'shared/relay/user_status_cache_provider.dart';
import 'features/profile/settings_profile_header.dart';
import 'features/settings/settings_page.dart';
import 'shared/auth/auth.dart';
@@ -13,6 +13,7 @@ import 'package:lucide_icons_flutter/lucide_icons.dart';
import '../../shared/auth/auth.dart';
import '../../shared/community/community_icon_provider.dart';
import '../../shared/relay/relay.dart';
import '../../shared/relay/user_status_provider.dart';
import '../../shared/theme/theme.dart';
import '../../shared/widgets/avatar_image.dart';
import '../../shared/widgets/anchored_popover_menu.dart';
@@ -608,10 +608,17 @@ 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'),
@@ -652,6 +659,17 @@ 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,
),
),
],
],
),
),
@@ -3,13 +3,13 @@ import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:lucide_icons_flutter/lucide_icons.dart';
import '../../shared/relay/user_status.dart';
import '../../shared/relay/user_status_cache_provider.dart';
import '../../shared/theme/theme.dart';
import '../../shared/widgets/avatar_image.dart';
import '../../shared/widgets/buzz_loading_indicator.dart';
import '../profile/user_cache_provider.dart';
import '../profile/user_profile.dart';
import '../profile/user_status.dart';
import '../profile/user_status_cache_provider.dart';
import 'agent_activity/agent_activity_sheet.dart';
import 'agent_activity/working_bots_provider.dart';
import 'channel.dart';
@@ -8,10 +8,10 @@ import 'package:lucide_icons_flutter/lucide_icons.dart';
import '../../shared/custom_emoji/custom_emoji.dart';
import '../../shared/custom_emoji/custom_emoji_provider.dart';
import '../../shared/custom_emoji/custom_emoji_render.dart';
import '../../shared/relay/user_status.dart';
import '../../shared/relay/user_status_provider.dart';
import '../../shared/theme/theme.dart';
import '../channels/emoji_picker.dart';
import 'user_status.dart';
import 'user_status_provider.dart';
/// The emoji well and the text field are sized to be the two things you reach
/// for, so they carry no borders — the sheet has no other controls to compete
@@ -4,12 +4,12 @@ import 'package:lucide_icons_flutter/lucide_icons.dart';
import '../../shared/custom_emoji/custom_emoji_provider.dart';
import '../../shared/custom_emoji/custom_emoji_render.dart';
import '../../shared/relay/user_status_provider.dart';
import '../../shared/theme/theme.dart';
import '../../shared/widgets/avatar_image.dart';
import '../../shared/widgets/masked_avatar_badge.dart';
import 'profile_provider.dart';
import 'set_status_sheet.dart';
import 'user_status_provider.dart';
/// Desktop's settings-avatar treatment (`ProfileSettingsCard`): a large centred
/// avatar with a circular badge notched out of its bottom-right corner. Desktop
@@ -12,7 +12,7 @@ import '../channels/channel_detail_page.dart';
import '../channels/channel_management_provider.dart';
import 'presence_cache_provider.dart';
import 'user_cache_provider.dart';
import 'user_status_cache_provider.dart';
import '../../shared/relay/user_status_cache_provider.dart';
import '../channels/message_content.dart';
/// Show a user profile bottom sheet for the given [pubkey].
@@ -1,6 +1,6 @@
import 'package:flutter/foundation.dart';
import '../../shared/relay/nostr_models.dart';
import 'nostr_models.dart';
/// A user's NIP-38 status (kind:30315, d=general).
@immutable
@@ -3,7 +3,7 @@ import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import '../../shared/relay/relay.dart';
import 'relay.dart';
import 'user_status.dart';
/// In-memory cache of other users' NIP-38 statuses (kind:30315, d=general).
@@ -1,7 +1,7 @@
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:nostr/nostr.dart' as nostr;
import '../../shared/relay/relay.dart';
import 'relay.dart';
import 'user_status.dart';
import 'user_status_cache_provider.dart';
@@ -5,8 +5,8 @@ import 'package:buzz/features/channels/channel.dart';
import 'package:buzz/features/channels/channels_page.dart';
import 'package:buzz/features/channels/channels_provider.dart';
import 'package:buzz/features/profile/profile_avatar.dart';
import 'package:buzz/features/profile/user_status.dart';
import 'package:buzz/features/profile/user_status_provider.dart';
import 'package:buzz/shared/relay/user_status.dart';
import 'package:buzz/shared/relay/user_status_provider.dart';
import 'package:buzz/shared/community/community.dart';
import 'package:buzz/shared/community/community_provider.dart';
import 'package:buzz/shared/theme/theme.dart';
@@ -1,6 +1,6 @@
import 'package:buzz/features/profile/set_status_sheet.dart';
import 'package:buzz/features/profile/user_status.dart';
import 'package:buzz/features/profile/user_status_provider.dart';
import 'package:buzz/shared/relay/user_status.dart';
import 'package:buzz/shared/relay/user_status_provider.dart';
import 'package:buzz/shared/custom_emoji/custom_emoji_provider.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
@@ -1,8 +1,8 @@
import 'package:buzz/features/profile/profile_provider.dart';
import 'package:buzz/features/profile/settings_profile_header.dart';
import 'package:buzz/features/profile/user_profile.dart';
import 'package:buzz/features/profile/user_status.dart';
import 'package:buzz/features/profile/user_status_provider.dart';
import 'package:buzz/shared/relay/user_status.dart';
import 'package:buzz/shared/relay/user_status_provider.dart';
import 'package:buzz/shared/custom_emoji/custom_emoji_provider.dart';
import 'package:buzz/shared/widgets/masked_avatar_badge.dart';
import 'package:flutter_test/flutter_test.dart';