Skip to content

Commit eb1eefa

Browse files
birdbluesclaude
andcommitted
mobile: replace the phone's tab bar with the sidebar's rows and profile footer
The phone home is now the wide shell's sidebar at full width, so the three surfaces share one structure: the channel list under its community header, the Activity and Search rows pinned beneath it, and the profile card as the footer. The floating tab bar (Home / Activity / Search), its content transitions, its clearance inset and its footer fade are gone, and so is the header's Settings avatar on every surface; the footer card is the one way into Settings. The rows move out of the wide shell into `HomeNavRows`, shared by both layouts (`home-nav-activity`, `home-nav-search`, `home-nav-activity- unread-dot`). The wide shell still selects its main-pane surface with them and highlights the selection; the phone pushes `ActivityPage` and `SearchPage` as full-screen routes, which now imply Back when pushed and show none as a pane root. Search takes an `autofocus` flag so the phone opens it ready to type while the pane keeps it idle. The tab-reselection hooks (scroll to top, re-activate the field) go with the tab bar. The navigation guard test now covers Activity and Search too, allowing only the phone home, which exists in the compact layout alone, to push them directly. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01UAm5qbNPszvcwnMMbfGVGa Signed-off-by: dhseo <[email protected]>
1 parent d94b002 commit eb1eefa

17 files changed

Lines changed: 330 additions & 936 deletions

‎docs/client-desktop.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ sandbox WebView only ever loads `about:blank` from a string.
135135

136136
1. Launch, pair with the host by pasting the pairing code (no camera needed).
137137
2. Quit and relaunch: still signed in (keychain works).
138-
3. Resize: the window stops at 1000×700 and never shows the phone tab bar.
138+
3. Resize: the window stops at 1000×700 and never falls back to the phone
139+
layout (the stacked single column).
139140
4. Composer: Enter sends, Shift+Enter inserts a newline, Enter during Korean
140141
composition commits the syllable without sending, Escape leaves the
141142
field, a second Escape closes the thread pane.

‎docs/mobile-sidebar.md‎

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ button); this fork replaces it so the three surfaces look and work alike.
88

99
```
1010
슈 Community name header: tap opens the community switcher
11-
▤ Activity ● navigation rows (wide shell today; phone next)
12-
🔍 Search
11+
▤ Activity ● navigation rows: the wide shell selects a pane,
12+
🔍 Search the phone pushes the page (with Back)
1313
# Channels + ⋮ ⌄ + creates a channel
1414
# general
1515
# design [Join] an open channel you have not joined
@@ -18,6 +18,24 @@ button); this fork replaces it so the three surfaces look and work alike.
1818
C Display name footer card: tap opens Settings
1919
```
2020

21+
## Navigation rows and the phone
22+
23+
`HomeNavRows` (`lib/features/home/home_nav_rows.dart`) sits pinned under the
24+
community header on every surface (`home-nav-activity`, `home-nav-search`,
25+
the unread dot `home-nav-activity-unread-dot`). The wide shell selects the
26+
Activity or Search surface of its main pane and highlights the selected row;
27+
the phone pushes `ActivityPage` or `SearchPage` as a full-screen route with
28+
a Back button, and Search opens with its field focused (`autofocus`). A
29+
pushed page starts fresh each time: there is no retained tab state and no
30+
"tap the tab again to scroll to the top".
31+
32+
The phone's `HomePage` is therefore the wide shell's sidebar at full width:
33+
the channel list, the rows, and the profile card as the footer, with the
34+
bottom safe area under the card. Upstream's floating tab bar (Home /
35+
Activity / Search), its content transitions, its clearance inset and its
36+
footer fade are gone; only the composer still paints that fade behind
37+
itself.
38+
2139
## Section headers
2240

2341
Each built-in section header carries, after its label, a `+`
@@ -62,5 +80,6 @@ sidebar; upstream mobile listed neither joined nor open forums there.
6280

6381
`SidebarProfileCard` (`channels_page/profile_card.dart`): the avatar with
6482
its presence dot and the display name; tapping it opens Settings. The
65-
community is named in the header above, so the card does not repeat it. The
66-
wide shell hosts it today; the phone gets it with the tab bar's removal.
83+
community is named in the header above, so the card does not repeat it, and
84+
the channel list header carries no Settings avatar on any surface: the card
85+
is the one way into Settings.

‎mobile/lib/features/activity/activity_page.dart‎

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import 'dart:async';
22

3-
import 'package:flutter/foundation.dart';
43
import 'package:flutter/material.dart';
54
import 'package:flutter/services.dart';
65
import 'package:flutter_hooks/flutter_hooks.dart';
@@ -65,10 +64,7 @@ EdgeInsets _activityScrollPadding(
6564
/// navigation. Row taps deep-link to the represented message (oldest unread
6665
/// for grouped conversations) rather than just opening the channel.
6766
class ActivityPage extends HookConsumerWidget {
68-
const ActivityPage({this.tabReselection, super.key});
69-
70-
/// Notifies this page when its already-selected tab is tapped again.
71-
final ValueListenable<int>? tabReselection;
67+
const ActivityPage({super.key});
7268

7369
@override
7470
Widget build(BuildContext context, WidgetRef ref) {
@@ -77,31 +73,6 @@ class ActivityPage extends HookConsumerWidget {
7773
final filter = useState(InboxFilter.all);
7874
final unreadOnly = useState(false);
7975
final scrollController = useScrollController();
80-
final reducedMotion = MediaQuery.disableAnimationsOf(context);
81-
useEffect(() {
82-
final tabReselection = this.tabReselection;
83-
if (tabReselection == null) return null;
84-
85-
void scrollToTop() {
86-
if (!scrollController.hasClients) return;
87-
final position = scrollController.position;
88-
if (position.pixels <= position.minScrollExtent + 0.5) return;
89-
if (reducedMotion) {
90-
scrollController.jumpTo(position.minScrollExtent);
91-
return;
92-
}
93-
unawaited(
94-
scrollController.animateTo(
95-
position.minScrollExtent,
96-
duration: const Duration(milliseconds: 260),
97-
curve: Curves.easeOutCubic,
98-
),
99-
);
100-
}
101-
102-
tabReselection.addListener(scrollToTop);
103-
return () => tabReselection.removeListener(scrollToTop);
104-
}, [tabReselection, scrollController, reducedMotion]);
10576
final headerTitleStyle = context.textTheme.titleMedium?.copyWith(
10677
fontSize: 22,
10778
fontWeight: FontWeight.w600,
@@ -408,8 +379,9 @@ class ActivityPage extends HookConsumerWidget {
408379

409380
return FrostedScaffold(
410381
backgroundColor: context.colors.surface,
382+
// Pushed from the phone's navigation rows the bar implies Back; as a
383+
// wide-shell pane root nothing can pop, so none is shown.
411384
appBar: FrostedAppBar(
412-
automaticallyImplyLeading: false,
413385
horizontalInset: Grid.gutter,
414386
showBottomDivider: true,
415387
bottomDividerOpacity: 0.07,

‎mobile/lib/features/channels/channels_page.dart‎

Lines changed: 2 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import 'dart:io';
33
import 'dart:math' show max, min;
44
import 'dart:ui';
55

6-
import 'package:flutter/foundation.dart';
76
import 'package:flutter/material.dart';
87
import 'package:flutter/services.dart';
98
import 'package:flutter_hooks/flutter_hooks.dart';
@@ -90,7 +89,6 @@ const double _kChannelLabelInset =
9089
const double _kDmAvatarSize = _kChannelIconSize;
9190

9291
const double _kTopSectionCommunityAvatarSize = 40.0;
93-
const double _kTopSectionProfileAvatarSize = 36.0;
9492
const double _kTopSectionBottomPadding = Grid.xxs;
9593

9694
/// The top section's avatars are 40dp circles, which fill their box edge to
@@ -164,20 +162,15 @@ class ChannelsPage extends HookConsumerWidget {
164162
const ChannelsPage({
165163
required this.settingsPageBuilder,
166164
required this.onSettingsTransitionProgress,
167-
this.tabReselection,
168165
this.pinnedHeader,
169166
this.pinnedHeaderHeight = 0,
170-
this.showProfileAvatar = true,
171167
super.key,
172168
}) : assert(pinnedHeader == null || pinnedHeaderHeight > 0);
173169

170+
/// Builds the Settings page; the home's footer card opens it with
171+
/// [settingsPageRoute], so the header carries no Settings control.
174172
final WidgetBuilder settingsPageBuilder;
175173

176-
/// Whether the header's trailing profile avatar (the Settings entry point
177-
/// on a phone) is shown. The wide shell hides it and offers Settings from
178-
/// its sidebar profile card instead, like the desktop app.
179-
final bool showProfileAvatar;
180-
181174
/// Content pinned below the community header, above the scrolling list.
182175
/// The wide shell uses it for its Activity/Search navigation rows.
183176
final Widget? pinnedHeader;
@@ -189,9 +182,6 @@ class ChannelsPage extends HookConsumerWidget {
189182
/// render from the same timeline.
190183
final ValueChanged<double> onSettingsTransitionProgress;
191184

192-
/// Notifies this page when its already-selected tab is tapped again.
193-
final ValueListenable<int>? tabReselection;
194-
195185
@override
196186
Widget build(BuildContext context, WidgetRef ref) {
197187
final channelsAsync = ref.watch(channelsProvider);
@@ -213,7 +203,6 @@ class ChannelsPage extends HookConsumerWidget {
213203
bottomHeight: topSectionBottomHeight,
214204
);
215205
final channelsScrollController = useScrollController();
216-
final reducedMotion = MediaQuery.disableAnimationsOf(context);
217206
final headerFrostProgress = useState(0.0);
218207
useEffect(() {
219208
void updateHeaderTreatment() {
@@ -231,31 +220,6 @@ class ChannelsPage extends HookConsumerWidget {
231220
return () =>
232221
channelsScrollController.removeListener(updateHeaderTreatment);
233222
}, [channelsScrollController]);
234-
useEffect(() {
235-
final tabReselection = this.tabReselection;
236-
if (tabReselection == null) return null;
237-
238-
void scrollToTop() {
239-
if (!channelsScrollController.hasClients) return;
240-
final position = channelsScrollController.position;
241-
if (position.pixels <= position.minScrollExtent + 0.5) return;
242-
if (reducedMotion) {
243-
channelsScrollController.jumpTo(position.minScrollExtent);
244-
return;
245-
}
246-
unawaited(
247-
channelsScrollController.animateTo(
248-
position.minScrollExtent,
249-
duration: const Duration(milliseconds: 260),
250-
curve: Curves.easeOutCubic,
251-
),
252-
);
253-
}
254-
255-
tabReselection.addListener(scrollToTop);
256-
return () => tabReselection.removeListener(scrollToTop);
257-
}, [tabReselection, channelsScrollController, reducedMotion]);
258-
259223
// Cache the last successfully loaded channels so the UI never flashes
260224
// back to a loading state when the provider rebuilds (e.g. reconnect).
261225
// Clear the cache on community switch so we show a full loader instead of
@@ -367,28 +331,6 @@ class ChannelsPage extends HookConsumerWidget {
367331
style: headerTitleStyle,
368332
onTap: openCommunitySwitcher,
369333
),
370-
actions: [
371-
if (showProfileAvatar)
372-
SizedBox(
373-
width: Grid.xl,
374-
height: Grid.xl,
375-
child: Center(
376-
child: ProfileAvatar(
377-
size: _kTopSectionProfileAvatarSize,
378-
showPresence: false,
379-
onTap: () {
380-
unawaited(HapticFeedback.lightImpact());
381-
Navigator.of(context).push(
382-
settingsPageRoute(
383-
builder: settingsPageBuilder,
384-
onTransitionProgress: onSettingsTransitionProgress,
385-
),
386-
);
387-
},
388-
),
389-
),
390-
),
391-
],
392334
bottomHeight: topSectionBottomHeight,
393335
bottom: pinnedHeader == null
394336
? const SizedBox.expand()

‎mobile/lib/features/home/adaptive_home.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import 'wide_home_shell.dart';
66

77
/// Chooses the authenticated home for the current window size.
88
///
9-
/// Compact windows (phones) get the tabbed [HomePage]; wide windows (iPad
9+
/// Compact windows (phones) get the stacked [HomePage]; wide windows (iPad
1010
/// landscape, large tablets) get the three-column [WideHomeShell]. The chosen
1111
/// [LayoutMode] is published so navigation can decide between pushing a
1212
/// route and selecting a pane.

mobile/lib/features/home/wide_home_shell/sidebar_nav_rows.dart renamed to mobile/lib/features/home/home_nav_rows.dart

Lines changed: 46 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,77 @@
1-
part of '../wide_home_shell.dart';
1+
import 'package:flutter/material.dart';
2+
import 'package:lucide_icons_flutter/lucide_icons.dart';
23

3-
/// Activity and Search rows pinned under the sidebar's community header.
4-
class _SidebarNavRows extends ConsumerWidget {
5-
const _SidebarNavRows({required this.hasUnreadInbox});
4+
import '../../shared/theme/theme.dart';
65

6+
/// The Activity and Search rows pinned under the channel list's community
7+
/// header on every surface, like the desktop sidebar's primary menu. The wide
8+
/// shell selects a main-pane surface with them and shows which is selected;
9+
/// the phone pushes the page.
10+
class HomeNavRows extends StatelessWidget {
11+
/// Creates the rows.
12+
const HomeNavRows({
13+
required this.hasUnreadInbox,
14+
required this.onActivity,
15+
required this.onSearch,
16+
this.activitySelected = false,
17+
this.searchSelected = false,
18+
super.key,
19+
});
20+
21+
/// Whether the Activity inbox has unread items (a dot on its row).
722
final bool hasUnreadInbox;
823

24+
/// Opens the Activity inbox.
25+
final VoidCallback onActivity;
26+
27+
/// Opens Search.
28+
final VoidCallback onSearch;
29+
30+
/// Whether the Activity inbox is the surface on show (wide shell only).
31+
final bool activitySelected;
32+
33+
/// Whether Search is the surface on show (wide shell only).
34+
final bool searchSelected;
35+
36+
/// Height of one row.
937
static const double rowHeight = 36;
1038

11-
/// Total height reserved by the sidebar header for these rows.
39+
/// Total height the list header reserves for these rows.
1240
static const double height = rowHeight * 2 + Grid.xxs;
1341

1442
@override
15-
Widget build(BuildContext context, WidgetRef ref) {
16-
final surface = ref.watch(wideShellProvider.select((s) => s.surface));
17-
final notifier = ref.read(wideShellProvider.notifier);
43+
Widget build(BuildContext context) {
1844
return Padding(
1945
padding: const EdgeInsets.fromLTRB(Grid.twelve, 0, Grid.twelve, Grid.xxs),
2046
child: Column(
2147
mainAxisSize: MainAxisSize.min,
2248
children: [
23-
_SidebarNavRow(
24-
key: const ValueKey('wide-nav-activity'),
49+
_HomeNavRow(
50+
key: const ValueKey('home-nav-activity'),
2551
icon: LucideIcons.inbox300,
2652
selectedIcon: LucideIcons.inbox500,
2753
label: 'Activity',
28-
selected: surface == WideSurface.inbox,
54+
selected: activitySelected,
2955
showUnreadDot: hasUnreadInbox,
30-
onTap: notifier.showInbox,
56+
onTap: onActivity,
3157
),
32-
_SidebarNavRow(
33-
key: const ValueKey('wide-nav-search'),
58+
_HomeNavRow(
59+
key: const ValueKey('home-nav-search'),
3460
icon: LucideIcons.search300,
3561
selectedIcon: LucideIcons.search500,
3662
label: 'Search',
37-
selected: surface == WideSurface.search,
63+
selected: searchSelected,
3864
showUnreadDot: false,
39-
onTap: notifier.showSearch,
65+
onTap: onSearch,
4066
),
4167
],
4268
),
4369
);
4470
}
4571
}
4672

47-
class _SidebarNavRow extends StatelessWidget {
48-
const _SidebarNavRow({
73+
class _HomeNavRow extends StatelessWidget {
74+
const _HomeNavRow({
4975
super.key,
5076
required this.icon,
5177
required this.selectedIcon,
@@ -71,7 +97,7 @@ class _SidebarNavRow extends StatelessWidget {
7197
label: showUnreadDot ? '$label, unread' : label,
7298
excludeSemantics: true,
7399
child: SizedBox(
74-
height: _SidebarNavRows.rowHeight,
100+
height: HomeNavRows.rowHeight,
75101
child: Material(
76102
color: selected
77103
? context.colors.primary.withValues(alpha: 0.12)
@@ -105,7 +131,7 @@ class _SidebarNavRow extends StatelessWidget {
105131
),
106132
if (showUnreadDot)
107133
Container(
108-
key: const ValueKey('wide-nav-activity-unread-dot'),
134+
key: const ValueKey('home-nav-activity-unread-dot'),
109135
width: 8,
110136
height: 8,
111137
decoration: BoxDecoration(

0 commit comments

Comments
 (0)