mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
fix tablet inbox review feedback
Signed-off-by: kenny lopez <klopez4212@gmail.com>
This commit is contained in:
@@ -118,12 +118,12 @@ class ActivityPage extends HookConsumerWidget {
|
||||
useEffect(() {
|
||||
if (!isWideInbox || visibleItems.isEmpty) return null;
|
||||
final hasSelectedItem = visibleItems.any(
|
||||
(item) => item.id == selectedItemId.value,
|
||||
(item) => item.conversationId == selectedItemId.value,
|
||||
);
|
||||
final retainsSelectedDetail =
|
||||
selectedItemForDetail.value?.id == selectedItemId.value;
|
||||
selectedItemForDetail.value?.conversationId == selectedItemId.value;
|
||||
if (!hasSelectedItem && !retainsSelectedDetail) {
|
||||
selectedItemId.value = visibleItems.first.id;
|
||||
selectedItemId.value = visibleItems.first.conversationId;
|
||||
selectedItemTarget.value = null;
|
||||
selectedItemForDetail.value = null;
|
||||
}
|
||||
@@ -131,7 +131,7 @@ class ActivityPage extends HookConsumerWidget {
|
||||
}, [isWideInbox, visibleItemIdsKey, filter.value, unreadOnly.value]);
|
||||
final selectedItem =
|
||||
visibleItems.cast<InboxItem?>().firstWhere(
|
||||
(item) => item?.id == selectedItemId.value,
|
||||
(item) => item?.conversationId == selectedItemId.value,
|
||||
orElse: () => null,
|
||||
) ??
|
||||
selectedItemForDetail.value;
|
||||
@@ -213,7 +213,7 @@ class ActivityPage extends HookConsumerWidget {
|
||||
: thread.parentId;
|
||||
|
||||
if (isWideInbox) {
|
||||
selectedItemId.value = item.id;
|
||||
selectedItemId.value = item.conversationId;
|
||||
selectedItemTarget.value = target;
|
||||
selectedItemForDetail.value = item;
|
||||
markItemRead(item);
|
||||
|
||||
@@ -11,6 +11,7 @@ const _wideNavigationIdentityAvatarInset =
|
||||
Grid.xs + Grid.half - (Grid.quarter / 2);
|
||||
const _wideNavigationIdentityLabelGap = Grid.half + (Grid.quarter / 2);
|
||||
|
||||
/// A top-level tablet workspace destination supplied by the Home shell.
|
||||
class WideNavigationDestination {
|
||||
final IconData icon;
|
||||
final IconData selectedIcon;
|
||||
@@ -23,6 +24,7 @@ class WideNavigationDestination {
|
||||
});
|
||||
}
|
||||
|
||||
/// Tablet channel sidebar that owns channel/profile presentation and callbacks.
|
||||
class WideChannelsNavigation extends HookConsumerWidget {
|
||||
final int? selectedIndex;
|
||||
final ValueChanged<int> onDestinationSelected;
|
||||
@@ -792,6 +794,7 @@ class _WideChannelDestination extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
/// Nested tablet channel detail surface resolved from a selected channel ID.
|
||||
class WideChannelContent extends HookConsumerWidget {
|
||||
final String channelId;
|
||||
final VoidCallback onChannelLeft;
|
||||
|
||||
@@ -48,7 +48,6 @@ class ChannelsNotifier extends AsyncNotifier<List<Channel>> {
|
||||
Set<String> _participatedRootIds = {};
|
||||
Set<String> _authoredRootIds = {};
|
||||
String? _threadInterestPubkey;
|
||||
bool _hasLoaded = false;
|
||||
|
||||
Map<String, int> get latestObservedByChannel =>
|
||||
Map.unmodifiable(_latestObservedByChannel);
|
||||
@@ -110,7 +109,6 @@ class ChannelsNotifier extends AsyncNotifier<List<Channel>> {
|
||||
subscribeLive: subscribeLive,
|
||||
fetchLastMessage: fetchLastMessage,
|
||||
);
|
||||
_hasLoaded = true;
|
||||
return channels;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@ class HomePage extends HookConsumerWidget {
|
||||
static const Duration _tabIconWeightDuration = Duration(milliseconds: 120);
|
||||
static const double _wideNavigationBreakpoint = 840;
|
||||
static const double _wideContentInset = Grid.half + Grid.quarter;
|
||||
static const double _wideContentRadius = 24;
|
||||
|
||||
static const _destinations = [
|
||||
WideNavigationDestination(
|
||||
@@ -191,7 +190,7 @@ class HomePage extends HookConsumerWidget {
|
||||
decoration: BoxDecoration(
|
||||
color: context.colors.surface,
|
||||
borderRadius: BorderRadius.circular(
|
||||
HomePage._wideContentRadius,
|
||||
Radii.dialog,
|
||||
),
|
||||
// Matches desktop's Buzz content surface: a
|
||||
// hairline on the upper-left edge plus a very
|
||||
@@ -215,7 +214,7 @@ class HomePage extends HookConsumerWidget {
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(
|
||||
HomePage._wideContentRadius,
|
||||
Radii.dialog,
|
||||
),
|
||||
child: MediaQuery(
|
||||
// The desktop-like canvas is inset below the
|
||||
|
||||
Reference in New Issue
Block a user