Skip to content

anchors 6/n: Make scroll-to-end work for split slivers #1486

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

Merged
merged 22 commits into from
May 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c50a521
deps: Upgrade Flutter to 3.32.0-1.0.pre.332
gnprice Apr 30, 2025
8992f35
msglist [nfc]: Simplify name of _scrollToBottomVisible
gnprice Apr 5, 2025
323fc7b
msglist [nfc]: Fix name of scroll-to-bottom callback
gnprice Apr 6, 2025
6479d6c
msglist test [nfc]: Clean up tests of scroll-to-bottom button
gnprice Apr 18, 2025
0605fce
msglist: Fix speed calculations in scroll to bottom
gnprice Apr 6, 2025
172b2c2
msglist: Drop easing curve in scroll-to-bottom
gnprice Apr 18, 2025
4274467
msglist [nfc]: Discard scroll-to-bottom animation future up front
gnprice Apr 5, 2025
8f20279
msglist [nfc]: Specify we have a MessageListScrollController
gnprice Apr 5, 2025
43e2514
scroll [nfc]: Expose MessageListScrollPosition on MessageListScrollCo…
gnprice Apr 5, 2025
56adcb4
scroll [nfc]: Move scroll-to-bottom logic into our ScrollPosition sub…
gnprice Apr 6, 2025
1694112
scroll test [nfc]: Share a controller variable in MessageListScrollVi…
gnprice Apr 19, 2025
4057561
scroll test: Test basic behavior of scroll-to-end feature
gnprice Apr 19, 2025
2645712
scroll [nfc]: Explain magic numbers in scroll-to-end calculations
gnprice Apr 6, 2025
c778908
scroll [nfc]: Clarify scroll-to-end calculations a bit more
gnprice Apr 25, 2025
717cd04
scroll [nfc]: Inline animateTo implementation into scrollToEnd
gnprice Apr 6, 2025
63734b0
test [nfc]: Organize Flutter checks-extensions by library
gnprice Apr 19, 2025
c72b99a
test [nfc]: Organize Flutter checks-extensions thematically within ea…
gnprice Apr 19, 2025
7055b9c
scroll: Handle starting from overscroll in "scroll to end"
gnprice Apr 19, 2025
6264ed9
scroll [nfc]: Introduce ScrollToEndActivity
gnprice Apr 18, 2025
fbd5266
scroll: Avoid overscroll in "scroll to end"
gnprice Apr 18, 2025
25b6111
scroll: Drive "scroll to end" through uncertainty about endpoint
gnprice Apr 5, 2025
ca0abe5
scroll: Apply a min velocity in ScrollToEndSimulation
gnprice Apr 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 59 additions & 26 deletions lib/generated/l10n/zulip_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,17 @@ import 'zulip_localizations_uk.dart';
/// be consistent with the languages listed in the ZulipLocalizations.supportedLocales
/// property.
abstract class ZulipLocalizations {
ZulipLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString());
ZulipLocalizations(String locale)
: localeName = intl.Intl.canonicalizedLocale(locale.toString());

final String localeName;

static ZulipLocalizations of(BuildContext context) {
return Localizations.of<ZulipLocalizations>(context, ZulipLocalizations)!;
}

static const LocalizationsDelegate<ZulipLocalizations> delegate = _ZulipLocalizationsDelegate();
static const LocalizationsDelegate<ZulipLocalizations> delegate =
_ZulipLocalizationsDelegate();

/// A list of this localizations delegate along with the default localizations
/// delegates.
Expand All @@ -88,12 +90,13 @@ abstract class ZulipLocalizations {
/// Additional delegates can be added by appending to this list in
/// MaterialApp. This list does not have to be used at all if a custom list
/// of delegates is preferred or required.
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates = <LocalizationsDelegate<dynamic>>[
delegate,
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
];
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates =
<LocalizationsDelegate<dynamic>>[
delegate,
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
];

/// A list of this localizations delegate's supported locales.
static const List<Locale> supportedLocales = <Locale>[
Expand All @@ -104,7 +107,7 @@ abstract class ZulipLocalizations {
Locale('pl'),
Locale('ru'),
Locale('sk'),
Locale('uk')
Locale('uk'),
];

/// Title for About Zulip page.
Expand Down Expand Up @@ -381,7 +384,11 @@ abstract class ZulipLocalizations {
///
/// In en, this message translates to:
/// **'{num, plural, =1{File is} other{{num} files are}} larger than the server\'s limit of {maxFileUploadSizeMib} MiB and will not be uploaded:\n\n{listMessage}'**
String errorFilesTooLarge(int num, int maxFileUploadSizeMib, String listMessage);
String errorFilesTooLarge(
int num,
int maxFileUploadSizeMib,
String listMessage,
);

/// Error title when attached files are too large in size.
///
Expand Down Expand Up @@ -459,7 +466,11 @@ abstract class ZulipLocalizations {
///
/// In en, this message translates to:
/// **'Error handling a Zulip event from {serverUrl}; will retry.\n\nError: {error}\n\nEvent: {event}'**
String errorHandlingEventDetails(String serverUrl, String error, String event);
String errorHandlingEventDetails(
String serverUrl,
String error,
String event,
);

/// Error title when opening a link failed.
///
Expand Down Expand Up @@ -831,7 +842,11 @@ abstract class ZulipLocalizations {
///
/// In en, this message translates to:
/// **'{url} is running Zulip Server {zulipVersion}, which is unsupported. The minimum supported version is Zulip Server {minSupportedZulipVersion}.'**
String errorServerVersionUnsupportedMessage(String url, String zulipVersion, String minSupportedZulipVersion);
String errorServerVersionUnsupportedMessage(
String url,
String zulipVersion,
String minSupportedZulipVersion,
);

/// Error message in the dialog for invalid API key.
///
Expand Down Expand Up @@ -1290,40 +1305,58 @@ abstract class ZulipLocalizations {
String get zulipAppTitle;
}

class _ZulipLocalizationsDelegate extends LocalizationsDelegate<ZulipLocalizations> {
class _ZulipLocalizationsDelegate
extends LocalizationsDelegate<ZulipLocalizations> {
const _ZulipLocalizationsDelegate();

@override
Future<ZulipLocalizations> load(Locale locale) {
return SynchronousFuture<ZulipLocalizations>(lookupZulipLocalizations(locale));
return SynchronousFuture<ZulipLocalizations>(
lookupZulipLocalizations(locale),
);
}

@override
bool isSupported(Locale locale) => <String>['ar', 'en', 'ja', 'nb', 'pl', 'ru', 'sk', 'uk'].contains(locale.languageCode);
bool isSupported(Locale locale) => <String>[
'ar',
'en',
'ja',
'nb',
'pl',
'ru',
'sk',
'uk',
].contains(locale.languageCode);

@override
bool shouldReload(_ZulipLocalizationsDelegate old) => false;
}

ZulipLocalizations lookupZulipLocalizations(Locale locale) {


// Lookup logic when only language code is specified.
switch (locale.languageCode) {
case 'ar': return ZulipLocalizationsAr();
case 'en': return ZulipLocalizationsEn();
case 'ja': return ZulipLocalizationsJa();
case 'nb': return ZulipLocalizationsNb();
case 'pl': return ZulipLocalizationsPl();
case 'ru': return ZulipLocalizationsRu();
case 'sk': return ZulipLocalizationsSk();
case 'uk': return ZulipLocalizationsUk();
case 'ar':
return ZulipLocalizationsAr();
case 'en':
return ZulipLocalizationsEn();
case 'ja':
return ZulipLocalizationsJa();
case 'nb':
return ZulipLocalizationsNb();
case 'pl':
return ZulipLocalizationsPl();
case 'ru':
return ZulipLocalizationsRu();
case 'sk':
return ZulipLocalizationsSk();
case 'uk':
return ZulipLocalizationsUk();
}

throw FlutterError(
'ZulipLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
'an issue with the localizations generation tool. Please file an issue '
'on GitHub with a reproducible sample app and the gen-l10n configuration '
'that was used.'
'that was used.',
);
}
75 changes: 53 additions & 22 deletions lib/generated/l10n/zulip_localizations_ar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
String get logOutConfirmationDialogTitle => 'Log out?';

@override
String get logOutConfirmationDialogMessage => 'To use this account in the future, you will have to re-enter the URL for your organization and your account information.';
String get logOutConfirmationDialogMessage =>
'To use this account in the future, you will have to re-enter the URL for your organization and your account information.';

@override
String get logOutConfirmationDialogConfirmButton => 'Log out';
Expand All @@ -65,10 +66,12 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
String get permissionsNeededOpenSettings => 'Open settings';

@override
String get permissionsDeniedCameraAccess => 'To upload an image, please grant Zulip additional permissions in Settings.';
String get permissionsDeniedCameraAccess =>
'To upload an image, please grant Zulip additional permissions in Settings.';

@override
String get permissionsDeniedReadExternalStorage => 'To upload files, please grant Zulip additional permissions in Settings.';
String get permissionsDeniedReadExternalStorage =>
'To upload files, please grant Zulip additional permissions in Settings.';

@override
String get actionSheetOptionMarkChannelAsRead => 'Mark channel as read';
Expand All @@ -95,7 +98,8 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
String get errorResolveTopicFailedTitle => 'Failed to mark topic as resolved';

@override
String get errorUnresolveTopicFailedTitle => 'Failed to mark topic as unresolved';
String get errorUnresolveTopicFailedTitle =>
'Failed to mark topic as unresolved';

@override
String get actionSheetOptionCopyMessageText => 'Copy message text';
Expand Down Expand Up @@ -136,7 +140,8 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
}

@override
String get errorCouldNotFetchMessageSource => 'Could not fetch message source';
String get errorCouldNotFetchMessageSource =>
'Could not fetch message source';

@override
String get errorCopyingFailed => 'Copying failed';
Expand All @@ -152,7 +157,11 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
}

@override
String errorFilesTooLarge(int num, int maxFileUploadSizeMib, String listMessage) {
String errorFilesTooLarge(
int num,
int maxFileUploadSizeMib,
String listMessage,
) {
String _temp0 = intl.Intl.pluralLogic(
num,
locale: localeName,
Expand Down Expand Up @@ -191,7 +200,8 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
String get errorCouldNotConnectTitle => 'Could not connect';

@override
String get errorMessageDoesNotSeemToExist => 'That message does not seem to exist.';
String get errorMessageDoesNotSeemToExist =>
'That message does not seem to exist.';

@override
String get errorQuotationFailed => 'Quotation failed';
Expand All @@ -202,18 +212,24 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
}

@override
String get errorConnectingToServerShort => 'Error connecting to Zulip. Retrying…';
String get errorConnectingToServerShort =>
'Error connecting to Zulip. Retrying…';

@override
String errorConnectingToServerDetails(String serverUrl, String error) {
return 'Error connecting to Zulip at $serverUrl. Will retry:\n\n$error';
}

@override
String get errorHandlingEventTitle => 'Error handling a Zulip event. Retrying connection…';
String get errorHandlingEventTitle =>
'Error handling a Zulip event. Retrying connection…';

@override
String errorHandlingEventDetails(String serverUrl, String error, String event) {
String errorHandlingEventDetails(
String serverUrl,
String error,
String event,
) {
return 'Error handling a Zulip event from $serverUrl; will retry.\n\nError: $error\n\nEvent: $event';
}

Expand Down Expand Up @@ -256,10 +272,12 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
String get successMessageLinkCopied => 'Message link copied';

@override
String get errorBannerDeactivatedDmLabel => 'You cannot send messages to deactivated users.';
String get errorBannerDeactivatedDmLabel =>
'You cannot send messages to deactivated users.';

@override
String get errorBannerCannotPostInChannelLabel => 'You do not have permission to post in this channel.';
String get errorBannerCannotPostInChannelLabel =>
'You do not have permission to post in this channel.';

@override
String get composeBoxAttachFilesTooltip => 'Attach files';
Expand Down Expand Up @@ -328,16 +346,19 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
String get messageListGroupYouWithYourself => 'Messages with yourself';

@override
String get contentValidationErrorTooLong => 'Message length shouldn\'t be greater than 10000 characters.';
String get contentValidationErrorTooLong =>
'Message length shouldn\'t be greater than 10000 characters.';

@override
String get contentValidationErrorEmpty => 'You have nothing to send!';

@override
String get contentValidationErrorQuoteAndReplyInProgress => 'Please wait for the quotation to complete.';
String get contentValidationErrorQuoteAndReplyInProgress =>
'Please wait for the quotation to complete.';

@override
String get contentValidationErrorUploadInProgress => 'Please wait for the upload to complete.';
String get contentValidationErrorUploadInProgress =>
'Please wait for the upload to complete.';

@override
String get dialogCancel => 'Cancel';
Expand Down Expand Up @@ -411,13 +432,19 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
String get loginErrorMissingUsername => 'Please enter your username.';

@override
String get topicValidationErrorTooLong => 'Topic length shouldn\'t be greater than 60 characters.';
String get topicValidationErrorTooLong =>
'Topic length shouldn\'t be greater than 60 characters.';

@override
String get topicValidationErrorMandatoryButEmpty => 'Topics are required in this organization.';
String get topicValidationErrorMandatoryButEmpty =>
'Topics are required in this organization.';

@override
String errorServerVersionUnsupportedMessage(String url, String zulipVersion, String minSupportedZulipVersion) {
String errorServerVersionUnsupportedMessage(
String url,
String zulipVersion,
String minSupportedZulipVersion,
) {
return '$url is running Zulip Server $zulipVersion, which is unsupported. The minimum supported version is Zulip Server $minSupportedZulipVersion.';
}

Expand Down Expand Up @@ -457,10 +484,12 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
String get serverUrlValidationErrorInvalidUrl => 'Please enter a valid URL.';

@override
String get serverUrlValidationErrorNoUseEmail => 'Please enter the server URL, not your email.';
String get serverUrlValidationErrorNoUseEmail =>
'Please enter the server URL, not your email.';

@override
String get serverUrlValidationErrorUnsupportedScheme => 'The server URL must start with http:// or https://.';
String get serverUrlValidationErrorUnsupportedScheme =>
'The server URL must start with http:// or https://.';

@override
String get spoilerDefaultHeaderText => 'Spoiler';
Expand Down Expand Up @@ -655,13 +684,15 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
String get experimentalFeatureSettingsPageTitle => 'Experimental features';

@override
String get experimentalFeatureSettingsWarning => 'These options enable features which are still under development and not ready. They may not work, and may cause issues in other areas of the app.\n\nThe purpose of these settings is for experimentation by people working on developing Zulip.';
String get experimentalFeatureSettingsWarning =>
'These options enable features which are still under development and not ready. They may not work, and may cause issues in other areas of the app.\n\nThe purpose of these settings is for experimentation by people working on developing Zulip.';

@override
String get errorNotificationOpenTitle => 'Failed to open notification';

@override
String get errorNotificationOpenAccountMissing => 'The account associated with this notification no longer exists.';
String get errorNotificationOpenAccountMissing =>
'The account associated with this notification no longer exists.';

@override
String get errorReactionAddingFailedTitle => 'Adding reaction failed';
Expand Down
Loading