Skip to content

Commit

Permalink
nav: Add bottom tabs and main menu
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
PIG208 committed Dec 4, 2024
1 parent c9b66c4 commit 661c5b0
Show file tree
Hide file tree
Showing 11 changed files with 756 additions and 85 deletions.
16 changes: 16 additions & 0 deletions assets/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
"@chooseAccountPageTitle": {
"description": "Title for ChooseAccountPage"
},
"switchAccountButton": "Switch account",
"@switchAccountButton": {
"description": "Main menu button for the choose-account page"
},
"chooseAccountPageLogOutButton": "Log out",
"@chooseAccountPageLogOutButton": {
"description": "Label for the 'Log out' button for an account on the choose-account page"
Expand Down Expand Up @@ -529,6 +533,10 @@
"@userRoleUnknown": {
"description": "Label for UserRole.unknown"
},
"inboxPageTitle": "Inbox",
"@inboxPageTitle": {
"description": "Title for the page of inbox."
},
"recentDmConversationsPageTitle": "Direct messages",
"@recentDmConversationsPageTitle": {
"description": "Title for the page of recent DM conversations"
Expand All @@ -545,6 +553,14 @@
"@starredMessagesPageTitle": {
"description": "Title for the page of starred messages."
},
"channelsPageTitle": "Channels",
"@channelsPageTitle": {
"description": "Title for the page of channels."
},
"profilePageTitle": "My profile",
"@profilePageTitle": {
"description": "Title for the page of the logged in user's profile."
},
"channelFeedButtonTooltip": "Channel feed",
"@channelFeedButtonTooltip": {
"description": "Tooltip for button to navigate to a given channel's feed"
Expand Down
24 changes: 24 additions & 0 deletions lib/generated/l10n/zulip_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ abstract class ZulipLocalizations {
/// **'Choose account'**
String get chooseAccountPageTitle;

/// Main menu button for the choose-account page
///
/// In en, this message translates to:
/// **'Switch account'**
String get switchAccountButton;

/// Label for the 'Log out' button for an account on the choose-account page
///
/// In en, this message translates to:
Expand Down Expand Up @@ -799,6 +805,12 @@ abstract class ZulipLocalizations {
/// **'Unknown'**
String get userRoleUnknown;

/// Title for the page of inbox.
///
/// In en, this message translates to:
/// **'Inbox'**
String get inboxPageTitle;

/// Title for the page of recent DM conversations
///
/// In en, this message translates to:
Expand All @@ -823,6 +835,18 @@ abstract class ZulipLocalizations {
/// **'Starred messages'**
String get starredMessagesPageTitle;

/// Title for the page of channels.
///
/// In en, this message translates to:
/// **'Channels'**
String get channelsPageTitle;

/// Title for the page of the logged in user's profile.
///
/// In en, this message translates to:
/// **'My profile'**
String get profilePageTitle;

/// Tooltip for button to navigate to a given channel's feed
///
/// In en, this message translates to:
Expand Down
12 changes: 12 additions & 0 deletions lib/generated/l10n/zulip_localizations_ar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
@override
String get chooseAccountPageTitle => 'Choose account';

@override
String get switchAccountButton => 'Switch account';

@override
String get chooseAccountPageLogOutButton => 'Log out';

Expand Down Expand Up @@ -419,6 +422,9 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
@override
String get userRoleUnknown => 'Unknown';

@override
String get inboxPageTitle => 'Inbox';

@override
String get recentDmConversationsPageTitle => 'Direct messages';

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

@override
String get channelsPageTitle => 'Channels';

@override
String get profilePageTitle => 'My profile';

@override
String get channelFeedButtonTooltip => 'Channel feed';

Expand Down
12 changes: 12 additions & 0 deletions lib/generated/l10n/zulip_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
@override
String get chooseAccountPageTitle => 'Choose account';

@override
String get switchAccountButton => 'Switch account';

@override
String get chooseAccountPageLogOutButton => 'Log out';

Expand Down Expand Up @@ -419,6 +422,9 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
@override
String get userRoleUnknown => 'Unknown';

@override
String get inboxPageTitle => 'Inbox';

@override
String get recentDmConversationsPageTitle => 'Direct messages';

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

@override
String get channelsPageTitle => 'Channels';

@override
String get profilePageTitle => 'My profile';

@override
String get channelFeedButtonTooltip => 'Channel feed';

Expand Down
12 changes: 12 additions & 0 deletions lib/generated/l10n/zulip_localizations_ja.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
@override
String get chooseAccountPageTitle => 'アカウントを選択';

@override
String get switchAccountButton => 'Switch account';

@override
String get chooseAccountPageLogOutButton => 'Log out';

Expand Down Expand Up @@ -419,6 +422,9 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
@override
String get userRoleUnknown => '不明';

@override
String get inboxPageTitle => 'Inbox';

@override
String get recentDmConversationsPageTitle => 'Direct messages';

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

@override
String get channelsPageTitle => 'Channels';

@override
String get profilePageTitle => 'My profile';

@override
String get channelFeedButtonTooltip => 'Channel feed';

Expand Down
8 changes: 3 additions & 5 deletions lib/widgets/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import 'about_zulip.dart';
import 'actions.dart';
import 'dialog.dart';
import 'home.dart';
import 'inbox.dart';
import 'login.dart';
import 'page.dart';
import 'store.dart';
Expand Down Expand Up @@ -209,11 +208,10 @@ class _ZulipAppState extends State<ZulipApp> with WidgetsBindingObserver {

onGenerateInitialRoutes: (_) {
return [
MaterialWidgetRoute(page: const ChooseAccountPage()),
if (initialAccountId != null) ...[
if (initialAccountId != null)
HomePage.buildRoute(accountId: initialAccountId),
InboxPage.buildRoute(accountId: initialAccountId),
],
if (initialAccountId == null)
MaterialWidgetRoute(page: const ChooseAccountPage()),
];
});
}));
Expand Down
Loading

0 comments on commit 661c5b0

Please sign in to comment.