Skip to content

Implemented pronouns in @-mentions autocomplete #1434

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 13 additions & 0 deletions lib/widgets/autocomplete.dart
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,16 @@ class _MentionAutocompleteItem extends StatelessWidget {
Widget avatar;
String label;
String? sublabel;
String? pronouns;
switch (option) {
case UserMentionAutocompleteResult(:var userId):
final user = store.getUser(userId)!; // must exist because UserMentionAutocompleteResult
avatar = Avatar(userId: userId, size: 36, borderRadius: 4);
label = user.fullName;
sublabel = store.userDisplayEmail(user);
if(user.profileData !=null){
pronouns = user.profileData![19]?.value;
}
case WildcardMentionAutocompleteResult(:var wildcardOption):
avatar = SizedBox.square(dimension: 36,
child: const Icon(ZulipIcons.three_person, size: 24));
Expand Down Expand Up @@ -306,6 +310,14 @@ class _MentionAutocompleteItem extends StatelessWidget {
overflow: TextOverflow.ellipsis,
maxLines: 1);

final pronounWidget = pronouns == null ? null : Text(
pronouns,
style: TextStyle(
fontSize: 14,
height: 16 / 14,
color: designVariables.contextMenuItemMeta),);


return Padding(
padding: const EdgeInsetsDirectional.fromSTEB(4, 4, 8, 4),
child: Row(children: [
Expand All @@ -318,6 +330,7 @@ class _MentionAutocompleteItem extends StatelessWidget {
labelWidget,
if (sublabelWidget != null) sublabelWidget,
])),
if(pronounWidget != null) pronounWidget,
]));
}
}
Expand Down
6 changes: 6 additions & 0 deletions packages/zulip_plugin/pubspec.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages: {}
sdks:
dart: ">=3.4.0-256.0.dev <4.0.0"
flutter: ">=3.3.0"
56 changes: 28 additions & 28 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ packages:
dependency: "direct dev"
description:
name: args
sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6
sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04
url: "https://pub.dev"
source: hosted
version: "2.6.0"
version: "2.7.0"
async:
dependency: transitive
description:
Expand Down Expand Up @@ -117,10 +117,10 @@ packages:
dependency: transitive
description:
name: built_value
sha256: "8b158ab94ec6913e480dc3f752418348b5ae099eb75868b5f4775f0572999c61"
sha256: ea90e81dc4a25a043d9bee692d20ed6d1c4a1662a28c03a96417446c093ed6b4
url: "https://pub.dev"
source: hosted
version: "8.9.4"
version: "8.9.5"
characters:
dependency: transitive
description:
Expand Down Expand Up @@ -310,10 +310,10 @@ packages:
dependency: "direct main"
description:
name: file_picker
sha256: "7423298f08f6fc8cce05792bae329f9a93653fc9c08712831b1a55540127995d"
sha256: "127d84b954527b2a59208c5cba556d8fb9078538f41ec869a56651f72f212a4b"
url: "https://pub.dev"
source: hosted
version: "9.0.2"
version: "9.2.0"
file_selector_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -446,10 +446,10 @@ packages:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
sha256: "1c2b787f99bdca1f3718543f81d38aa1b124817dfeb9fb196201bea85b6134bf"
sha256: "5a1e6fb2c0561958d7e4c33574674bda7b77caaca7a33b758876956f2902eea3"
url: "https://pub.dev"
source: hosted
version: "2.0.26"
version: "2.0.27"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -533,10 +533,10 @@ packages:
dependency: transitive
description:
name: image_picker_android
sha256: "82652a75e3dd667a91187769a6a2cc81bd8c111bbead698d8e938d2b63e5e89a"
sha256: "8bd392ba8b0c8957a157ae0dc9fcf48c58e6c20908d5880aea1d79734df090e9"
url: "https://pub.dev"
source: hosted
version: "0.8.12+21"
version: "0.8.12+22"
image_picker_for_web:
dependency: transitive
description:
Expand All @@ -557,10 +557,10 @@ packages:
dependency: transitive
description:
name: image_picker_linux
sha256: "4ed1d9bb36f7cd60aa6e6cd479779cc56a4cb4e4de8f49d487b1aaad831300fa"
sha256: "34a65f6740df08bbbeb0a1abd8e6d32107941fd4868f67a507b25601651022c9"
url: "https://pub.dev"
source: hosted
version: "0.2.1+1"
version: "0.2.1+2"
image_picker_macos:
dependency: transitive
description:
Expand Down Expand Up @@ -738,10 +738,10 @@ packages:
dependency: transitive
description:
name: package_config
sha256: "92d4488434b520a62570293fbd33bb556c7d49230791c1b4bbd973baf6d2dc67"
sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.2.0"
package_info_plus:
dependency: "direct main"
description:
Expand Down Expand Up @@ -778,10 +778,10 @@ packages:
dependency: transitive
description:
name: path_provider_android
sha256: "4adf4fd5423ec60a29506c76581bc05854c55e3a0b72d35bb28d661c9686edf2"
sha256: "0ca7359dad67fd7063cb2892ab0c0737b2daafd807cf1acecd62374c8fae6c12"
url: "https://pub.dev"
source: hosted
version: "2.2.15"
version: "2.2.16"
path_provider_foundation:
dependency: transitive
description:
Expand Down Expand Up @@ -826,10 +826,10 @@ packages:
dependency: "direct dev"
description:
name: pigeon
sha256: "1bab69b62617e5f31cf84dcab82c62aa21b7883055f0ca7ff93e76651eef8575"
sha256: "286b64a30967eac2edc4ca292132fb662b460dd57d085fef5436ed02dd7721e7"
url: "https://pub.dev"
source: hosted
version: "24.2.1"
version: "24.2.2"
platform:
dependency: transitive
description:
Expand Down Expand Up @@ -874,10 +874,10 @@ packages:
dependency: transitive
description:
name: pub_semver
sha256: "7b3cfbf654f3edd0c6298ecd5be782ce997ddf0e00531b9464b55245185bbbbd"
sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585"
url: "https://pub.dev"
source: hosted
version: "2.1.5"
version: "2.2.0"
pubspec_parse:
dependency: transitive
description:
Expand Down Expand Up @@ -999,10 +999,10 @@ packages:
dependency: "direct main"
description:
name: sqlite3
sha256: "32b632dda27d664f85520093ed6f735ae5c49b5b75345afb8b19411bc59bb53d"
sha256: "310af39c40dd0bb2058538333c9d9840a2725ae0b9f77e4fd09ad6696aa8f66e"
url: "https://pub.dev"
source: hosted
version: "2.7.4"
version: "2.7.5"
sqlite3_flutter_libs:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1119,10 +1119,10 @@ packages:
dependency: "direct main"
description:
name: url_launcher_android
sha256: "6fc2f56536ee873eeb867ad176ae15f304ccccc357848b351f6f0d8d4a40d193"
sha256: "1d0eae19bd7606ef60fe69ef3b312a437a16549476c42321d5dc1506c9ca3bf4"
url: "https://pub.dev"
source: hosted
version: "6.3.14"
version: "6.3.15"
url_launcher_ios:
dependency: transitive
description:
Expand Down Expand Up @@ -1199,10 +1199,10 @@ packages:
dependency: transitive
description:
name: video_player_android
sha256: "7018dbcb395e2bca0b9a898e73989e67c0c4a5db269528e1b036ca38bcca0d0b"
sha256: ae7d4f1b41e3ac6d24dd9b9d5d6831b52d74a61bdd90a7a6262a33d8bb97c29a
url: "https://pub.dev"
source: hosted
version: "2.7.17"
version: "2.8.2"
video_player_avfoundation:
dependency: transitive
description:
Expand Down Expand Up @@ -1303,10 +1303,10 @@ packages:
dependency: transitive
description:
name: win32
sha256: b89e6e24d1454e149ab20fbb225af58660f0c0bf4475544650700d8e2da54aef
sha256: dc6ecaa00a7c708e5b4d10ee7bec8c270e9276dfcab1783f57e9962d7884305f
url: "https://pub.dev"
source: hosted
version: "5.11.0"
version: "5.12.0"
win32_registry:
dependency: transitive
description:
Expand Down