-
Notifications
You must be signed in to change notification settings - Fork 310
general chat #1: add support at most places #1297
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
Changes from all commits
6fec187
303649a
a2bdbc8
0ba9b44
65e0d4a
8e21f98
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -302,6 +302,7 @@ class PerAccountStore extends ChangeNotifier with EmojiStore, UserStore, Channel | |
realmMandatoryTopics: initialSnapshot.realmMandatoryTopics, | ||
realmWaitingPeriodThreshold: initialSnapshot.realmWaitingPeriodThreshold, | ||
maxFileUploadSizeMib: initialSnapshot.maxFileUploadSizeMib, | ||
realmEmptyTopicDisplayName: initialSnapshot.realmEmptyTopicDisplayName, | ||
realmDefaultExternalAccounts: initialSnapshot.realmDefaultExternalAccounts, | ||
customProfileFields: _sortCustomProfileFields(initialSnapshot.customProfileFields), | ||
emailAddressVisibility: initialSnapshot.emailAddressVisibility, | ||
|
@@ -344,6 +345,7 @@ class PerAccountStore extends ChangeNotifier with EmojiStore, UserStore, Channel | |
required this.realmMandatoryTopics, | ||
required this.realmWaitingPeriodThreshold, | ||
required this.maxFileUploadSizeMib, | ||
required String? realmEmptyTopicDisplayName, | ||
required this.realmDefaultExternalAccounts, | ||
required this.customProfileFields, | ||
required this.emailAddressVisibility, | ||
|
@@ -362,6 +364,7 @@ class PerAccountStore extends ChangeNotifier with EmojiStore, UserStore, Channel | |
assert(realmUrl == connection.realmUrl), | ||
assert(emoji.realmUrl == realmUrl), | ||
_globalStore = globalStore, | ||
_realmEmptyTopicDisplayName = realmEmptyTopicDisplayName, | ||
_emoji = emoji, | ||
_users = users, | ||
_channels = channels, | ||
|
@@ -414,6 +417,18 @@ class PerAccountStore extends ChangeNotifier with EmojiStore, UserStore, Channel | |
/// For docs, please see [InitialSnapshot.realmWaitingPeriodThreshold]. | ||
final int realmWaitingPeriodThreshold; // TODO(#668): update this realm setting | ||
final int maxFileUploadSizeMib; // No event for this. | ||
|
||
/// The display name to use for empty topics. | ||
/// | ||
/// This should only be accessed when FL >= 334, since topics cannot | ||
/// be empty otherwise. | ||
// TODO(server-10) simplify this | ||
String get realmEmptyTopicDisplayName { | ||
assert(_realmEmptyTopicDisplayName != null); // TODO(log) | ||
return _realmEmptyTopicDisplayName ?? 'general chat'; | ||
} | ||
final String? _realmEmptyTopicDisplayName; // TODO(#668): update this realm setting | ||
Comment on lines
+426
to
+430
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: set this group off with blank lines |
||
|
||
final Map<String, RealmDefaultExternalAccount> realmDefaultExternalAccounts; | ||
List<CustomProfileField> customProfileFields; | ||
/// For docs, please see [InitialSnapshot.emailAddressVisibility]. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -339,8 +339,11 @@ class MessageListAppBarTitle extends StatelessWidget { | |
return Row( | ||
mainAxisSize: MainAxisSize.min, | ||
children: [ | ||
Flexible(child: Text(topic.displayName, style: const TextStyle( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
(Same comment about this being an NFC commit.) |
||
// ignore: dead_null_aware_expression // null topic names soon to be enabled | ||
Flexible(child: Text(topic.displayName ?? store.realmEmptyTopicDisplayName, style: TextStyle( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's have a test for this part too. Should be quick, I think; can go in the "app bar" group. |
||
fontSize: 13, | ||
// ignore: unnecessary_null_comparison // null topic names soon to be enabled | ||
fontStyle: topic.displayName == null ? FontStyle.italic : null, | ||
).merge(weightVariableTextStyle(context)))), | ||
if (icon != null) | ||
Padding( | ||
|
@@ -1092,11 +1095,15 @@ class StreamMessageRecipientHeader extends StatelessWidget { | |
child: Row( | ||
children: [ | ||
Flexible( | ||
child: Text(topic.displayName, | ||
// ignore: dead_null_aware_expression // null topic names soon to be enabled | ||
child: Text(topic.displayName ?? store.realmEmptyTopicDisplayName, | ||
// TODO: Give a way to see the whole topic (maybe a | ||
// long-press interaction?) | ||
overflow: TextOverflow.ellipsis, | ||
style: recipientHeaderTextStyle(context))), | ||
style: recipientHeaderTextStyle(context, | ||
// ignore: unnecessary_null_comparison // null topic names soon to be enabled | ||
fontStyle: topic.displayName == null ? FontStyle.italic : null, | ||
))), | ||
const SizedBox(width: 4), | ||
Icon(size: 14, color: designVariables.title.withFadedAlpha(0.5), | ||
// A null [Icon.icon] makes a blank space. | ||
|
@@ -1191,12 +1198,13 @@ class DmRecipientHeader extends StatelessWidget { | |
} | ||
} | ||
|
||
TextStyle recipientHeaderTextStyle(BuildContext context) { | ||
TextStyle recipientHeaderTextStyle(BuildContext context, {FontStyle? fontStyle}) { | ||
return TextStyle( | ||
color: DesignVariables.of(context).title, | ||
fontSize: 16, | ||
letterSpacing: proportionalLetterSpacing(context, 0.02, baseFontSize: 16), | ||
height: (18 / 16), | ||
fontStyle: fontStyle, | ||
).merge(weightVariableTextStyle(context, wght: 600)); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This calls for a comment explaining why this condition is supposed to be unreachable — it doesn't seem obvious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe clearest: a bit of dartdoc saying not to access this unless zulipFeatureLevel is at least such-and-such. That's the idea for why this shouldn't happen, right?