Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement bottom tabs and main menu #1076

Merged
merged 11 commits into from
Dec 11, 2024
25 changes: 25 additions & 0 deletions assets/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@
"@chooseAccountPageTitle": {
"description": "Title for the page to choose between Zulip accounts."
},
"switchAccountButton": "Switch account",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    nav: Add bottom tabs and main menu

Commit-message nit:

    We include an ad-hoc button to navigate to the choose-account page with
    a custom loading placeholder, so that the user still has the option to
    go back from the loading screen.

Without more context, I get confused by the part that starts with "with". Grammatically, "with a custom loading placeholder" might be attached to any of these:

  1. the button that navigates
  2. how the navigation happens
  3. the choose-account page

but I don't know which one you mean. Probably not (1) because I don't think that button should have a loading state. Maybe not (3)? I don't see a need for a loading placeholder on that page. That leaves (2), but I don't understand what "to navigate with a custom loading placeholder" means. I'm also lost when I read the part after the comma.

I vaguely remember something from my last review about full-screen loading placeholders. But that memory can't help anyone but me 🙂 and it probably won't still be in my brain if I revisit this commit a month from now. I could probably figure out what this paragraph means if I reread that discussion, but a commit message shouldn't require that of its readers.

"@switchAccountButton": {
"description": "Label for main-menu button leading to the choose-account page."
},
"tryAnotherAccountMessage": "Your account at {url} is taking a while to load.",
"@tryAnotherAccountMessage": {
"description": "Message that appears on the loading screen after waiting for some time.",
"url": {"type": "String", "example": "http://chat.example.com/"}
},
"tryAnotherAccountButton": "Try another account",
"@tryAnotherAccountButton": {
"description": "Label for loading screen button prompting user to try another account."
},
"chooseAccountPageLogOutButton": "Log out",
"@chooseAccountPageLogOutButton": {
"description": "Label for the 'Log out' button for an account on the choose-account page"
Expand Down Expand Up @@ -561,6 +574,10 @@
"@userRoleUnknown": {
"description": "Label for UserRole.unknown"
},
"inboxPageTitle": "Inbox",
"@inboxPageTitle": {
"description": "Title for the page with unreads."
},
"recentDmConversationsPageTitle": "Direct messages",
"@recentDmConversationsPageTitle": {
"description": "Title for the page with a list of DM conversations."
Expand All @@ -577,6 +594,14 @@
"@starredMessagesPageTitle": {
"description": "Page title for the 'Starred messages' message view."
},
"channelsPageTitle": "Channels",
"@channelsPageTitle": {
"description": "Title for the page with a list of subscribed channels."
},
"mainMenuMyProfile": "My profile",
"@mainMenuMyProfile": {
"description": "Label for main-menu button leading to the user's own profile."
},
"channelFeedButtonTooltip": "Channel feed",
"@channelFeedButtonTooltip": {
"description": "Tooltip for button to navigate to a given channel's feed"
Expand Down
36 changes: 36 additions & 0 deletions lib/generated/l10n/zulip_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,24 @@ abstract class ZulipLocalizations {
/// **'Choose account'**
String get chooseAccountPageTitle;

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

/// Message that appears on the loading screen after waiting for some time.
///
/// In en, this message translates to:
/// **'Your account at {url} is taking a while to load.'**
String tryAnotherAccountMessage(Object url);

/// Label for loading screen button prompting user to try another account.
///
/// In en, this message translates to:
/// **'Try another account'**
String get tryAnotherAccountButton;

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

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

/// Title for the page with a list of DM conversations.
///
/// In en, this message translates to:
Expand All @@ -877,6 +901,18 @@ abstract class ZulipLocalizations {
/// **'Starred messages'**
String get starredMessagesPageTitle;

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

/// Label for main-menu button leading to the user's own profile.
///
/// In en, this message translates to:
/// **'My profile'**
String get mainMenuMyProfile;

/// Tooltip for button to navigate to a given channel's feed
///
/// In en, this message translates to:
Expand Down
20 changes: 20 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,17 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
@override
String get chooseAccountPageTitle => 'Choose account';

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

@override
String tryAnotherAccountMessage(Object url) {
return 'Your account at $url is taking a while to load.';
}

@override
String get tryAnotherAccountButton => 'Try another account';

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

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

@override
String get inboxPageTitle => 'Inbox';

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

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

@override
String get channelsPageTitle => 'Channels';

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

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

Expand Down
20 changes: 20 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,17 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
@override
String get chooseAccountPageTitle => 'Choose account';

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

@override
String tryAnotherAccountMessage(Object url) {
return 'Your account at $url is taking a while to load.';
}

@override
String get tryAnotherAccountButton => 'Try another account';

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

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

@override
String get inboxPageTitle => 'Inbox';

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

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

@override
String get channelsPageTitle => 'Channels';

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

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

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

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

@override
String tryAnotherAccountMessage(Object url) {
return 'Your account at $url is taking a while to load.';
}

@override
String get tryAnotherAccountButton => 'Try another account';

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

Expand Down Expand Up @@ -443,6 +454,9 @@ class ZulipLocalizationsFr extends ZulipLocalizations {
@override
String get userRoleUnknown => 'Unknown';

@override
String get inboxPageTitle => 'Inbox';

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

Expand All @@ -455,6 +469,12 @@ class ZulipLocalizationsFr extends ZulipLocalizations {
@override
String get starredMessagesPageTitle => 'Starred messages';

@override
String get channelsPageTitle => 'Channels';

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

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

Expand Down
20 changes: 20 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,17 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
@override
String get chooseAccountPageTitle => 'アカウントを選択';

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

@override
String tryAnotherAccountMessage(Object url) {
return 'Your account at $url is taking a while to load.';
}

@override
String get tryAnotherAccountButton => 'Try another account';

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

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

@override
String get inboxPageTitle => 'Inbox';

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

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

@override
String get channelsPageTitle => 'Channels';

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

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

Expand Down
20 changes: 20 additions & 0 deletions lib/generated/l10n/zulip_localizations_pl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
@override
String get chooseAccountPageTitle => 'Wybierz konto';

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

@override
String tryAnotherAccountMessage(Object url) {
return 'Your account at $url is taking a while to load.';
}

@override
String get tryAnotherAccountButton => 'Try another account';

@override
String get chooseAccountPageLogOutButton => 'Wyloguj';

Expand Down Expand Up @@ -443,6 +454,9 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
@override
String get userRoleUnknown => 'Nieznany';

@override
String get inboxPageTitle => 'Inbox';

@override
String get recentDmConversationsPageTitle => 'Wiadomości bezpośrednie';

Expand All @@ -455,6 +469,12 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
@override
String get starredMessagesPageTitle => 'Wiadomości z gwiazdką';

@override
String get channelsPageTitle => 'Channels';

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

@override
String get channelFeedButtonTooltip => 'Strumień kanału';

Expand Down
20 changes: 20 additions & 0 deletions lib/generated/l10n/zulip_localizations_ru.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
@override
String get chooseAccountPageTitle => 'Выберите учетную запись';

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

@override
String tryAnotherAccountMessage(Object url) {
return 'Your account at $url is taking a while to load.';
}

@override
String get tryAnotherAccountButton => 'Try another account';

@override
String get chooseAccountPageLogOutButton => 'Выход из системы';

Expand Down Expand Up @@ -443,6 +454,9 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
@override
String get userRoleUnknown => 'Unknown';

@override
String get inboxPageTitle => 'Inbox';

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

Expand All @@ -455,6 +469,12 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
@override
String get starredMessagesPageTitle => 'Отмеченные сообщения';

@override
String get channelsPageTitle => 'Channels';

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

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

Expand Down
4 changes: 2 additions & 2 deletions lib/widgets/action_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class ActionSheetCancelButton extends StatelessWidget {
final designVariables = DesignVariables.of(context);
return TextButton(
style: TextButton.styleFrom(
minimumSize: const Size.fromHeight(44),
padding: const EdgeInsets.all(10),
foregroundColor: designVariables.contextMenuCancelText,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(7)),
Expand All @@ -139,8 +140,7 @@ class ActionSheetCancelButton extends StatelessWidget {
},
child: Text(ZulipLocalizations.of(context).dialogCancel,
style: const TextStyle(fontSize: 20, height: 24 / 20)
.merge(weightVariableTextStyle(context, wght: 600))),
);
.merge(weightVariableTextStyle(context, wght: 600))));
}
}

Expand Down
Loading