Skip to content

Commit 4f00a5f

Browse files
committed
nav: Add bottom tabs and main menu
This is an initial implementation because some features were considered out-of-scope as of now for zulip#1035. Compared to the Figma, we swapped the order of _ChannelsButton and _DirectMessagesButton in the menu so they match their order on the navigation bar. See: https://chat.zulip.org/#narrow/channel/48-mobile/topic/Buttons.20on.20the.20bottom.20tabs.20and.20main.20menu We also added _CombinedFeedButton, using the same icon we have for "Combined feed" on the web app's topleft sidebar, added a "Switch account" button, and renamed "Streams" to "Channels". This does not fully implement the app bar redesign; we keep a simple one for now. Signed-off-by: Zixuan James Li <[email protected]>
1 parent 9dd5630 commit 4f00a5f

11 files changed

+756
-85
lines changed

assets/l10n/app_en.arb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
"@chooseAccountPageTitle": {
2020
"description": "Title for ChooseAccountPage"
2121
},
22+
"switchAccountButton": "Switch account",
23+
"@switchAccountButton": {
24+
"description": "Main menu button for the choose-account page"
25+
},
2226
"chooseAccountPageLogOutButton": "Log out",
2327
"@chooseAccountPageLogOutButton": {
2428
"description": "Label for the 'Log out' button for an account on the choose-account page"
@@ -529,6 +533,10 @@
529533
"@userRoleUnknown": {
530534
"description": "Label for UserRole.unknown"
531535
},
536+
"inboxPageTitle": "Inbox",
537+
"@inboxPageTitle": {
538+
"description": "Title for the page of inbox."
539+
},
532540
"recentDmConversationsPageTitle": "Direct messages",
533541
"@recentDmConversationsPageTitle": {
534542
"description": "Title for the page of recent DM conversations"
@@ -545,6 +553,14 @@
545553
"@starredMessagesPageTitle": {
546554
"description": "Title for the page of starred messages."
547555
},
556+
"channelsPageTitle": "Channels",
557+
"@channelsPageTitle": {
558+
"description": "Title for the page of channels."
559+
},
560+
"profilePageTitle": "My profile",
561+
"@profilePageTitle": {
562+
"description": "Title for the page of the logged in user's profile."
563+
},
548564
"channelFeedButtonTooltip": "Channel feed",
549565
"@channelFeedButtonTooltip": {
550566
"description": "Tooltip for button to navigate to a given channel's feed"

lib/generated/l10n/zulip_localizations.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ abstract class ZulipLocalizations {
127127
/// **'Choose account'**
128128
String get chooseAccountPageTitle;
129129

130+
/// Main menu button for the choose-account page
131+
///
132+
/// In en, this message translates to:
133+
/// **'Switch account'**
134+
String get switchAccountButton;
135+
130136
/// Label for the 'Log out' button for an account on the choose-account page
131137
///
132138
/// In en, this message translates to:
@@ -799,6 +805,12 @@ abstract class ZulipLocalizations {
799805
/// **'Unknown'**
800806
String get userRoleUnknown;
801807

808+
/// Title for the page of inbox.
809+
///
810+
/// In en, this message translates to:
811+
/// **'Inbox'**
812+
String get inboxPageTitle;
813+
802814
/// Title for the page of recent DM conversations
803815
///
804816
/// In en, this message translates to:
@@ -823,6 +835,18 @@ abstract class ZulipLocalizations {
823835
/// **'Starred messages'**
824836
String get starredMessagesPageTitle;
825837

838+
/// Title for the page of channels.
839+
///
840+
/// In en, this message translates to:
841+
/// **'Channels'**
842+
String get channelsPageTitle;
843+
844+
/// Title for the page of the logged in user's profile.
845+
///
846+
/// In en, this message translates to:
847+
/// **'My profile'**
848+
String get profilePageTitle;
849+
826850
/// Tooltip for button to navigate to a given channel's feed
827851
///
828852
/// In en, this message translates to:

lib/generated/l10n/zulip_localizations_ar.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
2323
@override
2424
String get chooseAccountPageTitle => 'Choose account';
2525

26+
@override
27+
String get switchAccountButton => 'Switch account';
28+
2629
@override
2730
String get chooseAccountPageLogOutButton => 'Log out';
2831

@@ -419,6 +422,9 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
419422
@override
420423
String get userRoleUnknown => 'Unknown';
421424

425+
@override
426+
String get inboxPageTitle => 'Inbox';
427+
422428
@override
423429
String get recentDmConversationsPageTitle => 'Direct messages';
424430

@@ -431,6 +437,12 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
431437
@override
432438
String get starredMessagesPageTitle => 'Starred messages';
433439

440+
@override
441+
String get channelsPageTitle => 'Channels';
442+
443+
@override
444+
String get profilePageTitle => 'My profile';
445+
434446
@override
435447
String get channelFeedButtonTooltip => 'Channel feed';
436448

lib/generated/l10n/zulip_localizations_en.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
2323
@override
2424
String get chooseAccountPageTitle => 'Choose account';
2525

26+
@override
27+
String get switchAccountButton => 'Switch account';
28+
2629
@override
2730
String get chooseAccountPageLogOutButton => 'Log out';
2831

@@ -419,6 +422,9 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
419422
@override
420423
String get userRoleUnknown => 'Unknown';
421424

425+
@override
426+
String get inboxPageTitle => 'Inbox';
427+
422428
@override
423429
String get recentDmConversationsPageTitle => 'Direct messages';
424430

@@ -431,6 +437,12 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
431437
@override
432438
String get starredMessagesPageTitle => 'Starred messages';
433439

440+
@override
441+
String get channelsPageTitle => 'Channels';
442+
443+
@override
444+
String get profilePageTitle => 'My profile';
445+
434446
@override
435447
String get channelFeedButtonTooltip => 'Channel feed';
436448

lib/generated/l10n/zulip_localizations_ja.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
2323
@override
2424
String get chooseAccountPageTitle => 'アカウントを選択';
2525

26+
@override
27+
String get switchAccountButton => 'Switch account';
28+
2629
@override
2730
String get chooseAccountPageLogOutButton => 'Log out';
2831

@@ -419,6 +422,9 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
419422
@override
420423
String get userRoleUnknown => '不明';
421424

425+
@override
426+
String get inboxPageTitle => 'Inbox';
427+
422428
@override
423429
String get recentDmConversationsPageTitle => 'Direct messages';
424430

@@ -431,6 +437,12 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
431437
@override
432438
String get starredMessagesPageTitle => 'Starred messages';
433439

440+
@override
441+
String get channelsPageTitle => 'Channels';
442+
443+
@override
444+
String get profilePageTitle => 'My profile';
445+
434446
@override
435447
String get channelFeedButtonTooltip => 'Channel feed';
436448

lib/widgets/app.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import 'about_zulip.dart';
1313
import 'actions.dart';
1414
import 'dialog.dart';
1515
import 'home.dart';
16-
import 'inbox.dart';
1716
import 'login.dart';
1817
import 'page.dart';
1918
import 'store.dart';
@@ -209,11 +208,10 @@ class _ZulipAppState extends State<ZulipApp> with WidgetsBindingObserver {
209208

210209
onGenerateInitialRoutes: (_) {
211210
return [
212-
MaterialWidgetRoute(page: const ChooseAccountPage()),
213-
if (initialAccountId != null) ...[
211+
if (initialAccountId != null)
214212
HomePage.buildRoute(accountId: initialAccountId),
215-
InboxPage.buildRoute(accountId: initialAccountId),
216-
],
213+
if (initialAccountId == null)
214+
MaterialWidgetRoute(page: const ChooseAccountPage()),
217215
];
218216
});
219217
}));

0 commit comments

Comments
 (0)