Skip to content

Add a "You" indicator in direct messages list #1320 #1345

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .idea/zulip.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ try {

android {
namespace "com.zulip.flutter"
ndkVersion "26.3.11579264"

compileSdkVersion flutter.compileSdkVersion

Expand Down
11 changes: 11 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
buildscript {
repositories {
google() // Ensure this is included
mavenCentral()// Optional, depending on your project
}
dependencies {
classpath 'com.android.tools.build:gradle:8.2.0' // Your Gradle plugin version
}
}

allprojects {
repositories {
google()
Expand All @@ -6,6 +16,7 @@ allprojects {
}

rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
Expand Down
2 changes: 2 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
org.gradle.jvmargs=-Xmx3072M
android.useAndroidX=true
android.enableJetifier=true
android.ndkVersion=26.3.11579264


# Versions for our Android build dependencies.
# Defining them here makes them available both in
Expand Down
12 changes: 9 additions & 3 deletions lib/widgets/message_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1318,6 +1318,9 @@ class MessageWithPossibleSender extends StatelessWidget {
if (item.showSender) {
final time = _kMessageTimestampFormat
.format(DateTime.fromMillisecondsSinceEpoch(1000 * message.timestamp));

final isCurrentUser = store.account.userId == message.senderId;

senderRow = Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.baseline,
Expand All @@ -1334,13 +1337,15 @@ class MessageWithPossibleSender extends StatelessWidget {
userId: message.senderId),
const SizedBox(width: 8),
Flexible(
child: Text(message.senderFullName, // TODO get from user data
child: Text(isCurrentUser ? '${message.senderFullName} (you)' : message.senderFullName, // TODO get from user data
style: TextStyle(
fontSize: 18,
height: (22 / 18),
color: messageListTheme.senderName,
).merge(weightVariableTextStyle(context, wght: 600)),
overflow: TextOverflow.ellipsis)),
overflow: TextOverflow.ellipsis
)
),
if (sender?.isBot ?? false) ...[
const SizedBox(width: 5),
Icon(
Expand All @@ -1349,7 +1354,8 @@ class MessageWithPossibleSender extends StatelessWidget {
color: messageListTheme.senderBotIcon,
),
],
]))),
]
))),
const SizedBox(width: 4),
Text(time,
style: TextStyle(
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"
28 changes: 14 additions & 14 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,10 @@ packages:
dependency: "direct dev"
description:
name: fake_async
sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
url: "https://pub.dev"
source: hosted
version: "1.3.2"
version: "1.3.3"
ffi:
dependency: transitive
description:
Expand Down Expand Up @@ -355,10 +355,10 @@ packages:
dependency: "direct main"
description:
name: firebase_core
sha256: "0307c1fde82e2b8b97e0be2dab93612aff9a72f31ebe9bfac66ed8b37ef7c568"
sha256: "93dc4dd12f9b02c5767f235307f609e61ed9211047132d07f9e02c668f0bfc33"
url: "https://pub.dev"
source: hosted
version: "3.10.0"
version: "3.11.0"
firebase_core_platform_interface:
dependency: transitive
description:
Expand All @@ -371,10 +371,10 @@ packages:
dependency: transitive
description:
name: firebase_core_web
sha256: fbc008cf390d909b823763064b63afefe9f02d8afdb13eb3f485b871afee956b
sha256: "0e13c80f0de8acaa5d0519cbe23c8b4cc138a2d5d508b5755c861bdfc9762678"
url: "https://pub.dev"
source: hosted
version: "2.19.0"
version: "2.20.0"
firebase_messaging:
dependency: "direct main"
description:
Expand Down Expand Up @@ -607,10 +607,10 @@ packages:
dependency: "direct main"
description:
name: intl
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5"
url: "https://pub.dev"
source: hosted
version: "0.19.0"
version: "0.20.2"
io:
dependency: transitive
description:
Expand Down Expand Up @@ -647,10 +647,10 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
url: "https://pub.dev"
source: hosted
version: "10.0.8"
version: "10.0.9"
leak_tracker_flutter_testing:
dependency: transitive
description:
Expand Down Expand Up @@ -1244,10 +1244,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
url: "https://pub.dev"
source: hosted
version: "14.3.1"
version: "15.0.0"
wakelock_plus:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1300,10 +1300,10 @@ packages:
dependency: transitive
description:
name: webdriver
sha256: "3d773670966f02a646319410766d3b5e1037efb7f07cc68f844d5e06cd4d61c8"
sha256: "2f3a14ca026957870cfd9c635b83507e0e51d8091568e90129fbf805aba7cade"
url: "https://pub.dev"
source: hosted
version: "3.0.4"
version: "3.1.0"
webkit_inspection_protocol:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ dependencies:
device_info_plus: ^11.2.0
drift: ^2.5.0
file_picker: ^8.0.0+1
firebase_core: ^3.3.0
firebase_messaging: ^15.0.1
flutter_color_models: ^1.3.3+2
html: ^0.15.1
Expand All @@ -64,6 +63,7 @@ dependencies:
wakelock_plus: ^1.2.8
zulip_plugin:
path: ./packages/zulip_plugin
firebase_core: ^3.11.0
# Keep list sorted when adding dependencies; it helps prevent merge conflicts.

dependency_overrides:
Expand Down
2 changes: 1 addition & 1 deletion tools/content/fetch_messages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'package:zulip/api/backoff.dart';
import 'model.dart';

/// Fetch all public message contents from a Zulip server in bulk.
///
///dsa
/// It outputs JSON entries of the message IDs and the rendered HTML contents in
/// JSON Lines (https://jsonlines.org) format. The output can be used later to
/// perform checks for discovering unimplemented features.
Expand Down
7 changes: 6 additions & 1 deletion windows/flutter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ include(${EPHEMERAL_DIR}/generated_config.cmake)
# https://github.com/flutter/flutter/issues/57146.
set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")

# Set fallback configurations for older versions of the flutter tool.
if (NOT DEFINED FLUTTER_TARGET_PLATFORM)
set(FLUTTER_TARGET_PLATFORM "windows-x64")
endif()

# === Flutter Library ===
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")

Expand Down Expand Up @@ -92,7 +97,7 @@ add_custom_command(
COMMAND ${CMAKE_COMMAND} -E env
${FLUTTER_TOOL_ENVIRONMENT}
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
windows-x64 $<CONFIG>
${FLUTTER_TARGET_PLATFORM} $<CONFIG>
VERBATIM
)
add_custom_target(flutter_assemble DEPENDS
Expand Down
5 changes: 5 additions & 0 deletions windows/runner/flutter_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ bool FlutterWindow::OnCreate() {
this->Show();
});

// Flutter can complete the first frame before the "show window" callback is
// registered. The following call ensures a frame is pending to ensure the
// window is shown. It is a no-op if the first frame hasn't completed yet.
flutter_controller_->ForceRedraw();

return true;
}

Expand Down