Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Make comments screen more similar to figma design

ashilkn22e0713f2ea8
diff --git a/mobile/apps/photos/lib/emergency/emergency_page.dart b/mobile/apps/photos/lib/emergency/emergency_page.dart
index 6c967d32b1..394fa547e1 100644
--- a/mobile/apps/photos/lib/emergency/emergency_page.dart
+++ b/mobile/apps/photos/lib/emergency/emergency_page.dart
@@ -176,7 +176,7 @@ class _EmergencyPageState extends State<EmergencyPage> {
alwaysShowSuccessState: false,
leadingIconWidget: UserAvatarWidget(
contact.emergencyContact,
- type: AvatarType.mini,
+ type: AvatarType.md,
currentUserID: currentUserID,
),
menuItemColor:
@@ -304,7 +304,7 @@ class _EmergencyPageState extends State<EmergencyPage> {
leadingIconSize: 24.0,
leadingIconWidget: UserAvatarWidget(
currentUser.user,
- type: AvatarType.mini,
+ type: AvatarType.md,
currentUserID: currentUserID,
),
menuItemColor:
diff --git a/mobile/apps/photos/lib/emergency/select_contact_page.dart b/mobile/apps/photos/lib/emergency/select_contact_page.dart
index 029fe3dd0f..d279dca5f0 100644
--- a/mobile/apps/photos/lib/emergency/select_contact_page.dart
+++ b/mobile/apps/photos/lib/emergency/select_contact_page.dart
@@ -125,7 +125,7 @@ class _AddContactPage extends State<AddContactPage> {
leadingIconSize: 24.0,
leadingIconWidget: UserAvatarWidget(
currentUser,
- type: AvatarType.mini,
+ type: AvatarType.md,
),
menuItemColor:
getEnteColorScheme(context).fillFaint,
diff --git a/mobile/apps/photos/lib/ui/collections/album/row_item.dart b/mobile/apps/photos/lib/ui/collections/album/row_item.dart
index 8597c6393a..e1ad82c7df 100644
--- a/mobile/apps/photos/lib/ui/collections/album/row_item.dart
+++ b/mobile/apps/photos/lib/ui/collections/album/row_item.dart
@@ -155,7 +155,7 @@ class AlbumRowItemWidget extends StatelessWidget {
child: AlbumSharesIcons(
padding: const EdgeInsets.only(left: 4, top: 4),
sharees: c.getSharees(),
- type: AvatarType.mini,
+ type: AvatarType.md,
trailingWidget: linkIcon,
),
),
diff --git a/mobile/apps/photos/lib/ui/sharing/add_participant_page.dart b/mobile/apps/photos/lib/ui/sharing/add_participant_page.dart
index 81002b4270..b5e3e23cf0 100644
--- a/mobile/apps/photos/lib/ui/sharing/add_participant_page.dart
+++ b/mobile/apps/photos/lib/ui/sharing/add_participant_page.dart
@@ -171,7 +171,7 @@ class _AddParticipantPage extends State<AddParticipantPage> {
leadingIconSize: 24.0,
leadingIconWidget: UserAvatarWidget(
currentUser,
- type: AvatarType.mini,
+ type: AvatarType.md,
),
menuItemColor:
getEnteColorScheme(context).fillFaint,
diff --git a/mobile/apps/photos/lib/ui/sharing/album_participants_page.dart b/mobile/apps/photos/lib/ui/sharing/album_participants_page.dart
index 2f9cc78b17..0207a711df 100644
--- a/mobile/apps/photos/lib/ui/sharing/album_participants_page.dart
+++ b/mobile/apps/photos/lib/ui/sharing/album_participants_page.dart
@@ -233,7 +233,7 @@ class _AlbumParticipantsPageState extends State<AlbumParticipantsPage> {
leadingIconSize: 24.0,
leadingIconWidget: UserAvatarWidget(
currentUser,
- type: AvatarType.mini,
+ type: AvatarType.md,
currentUserID: currentUserID,
),
menuItemColor: colorScheme.fillFaint,
@@ -316,7 +316,7 @@ class _AlbumParticipantsPageState extends State<AlbumParticipantsPage> {
leadingIconSize: 24.0,
leadingIconWidget: UserAvatarWidget(
currentUser,
- type: AvatarType.mini,
+ type: AvatarType.md,
currentUserID: currentUserID,
),
menuItemColor: colorScheme.fillFaint,
@@ -397,7 +397,7 @@ class _AlbumParticipantsPageState extends State<AlbumParticipantsPage> {
leadingIconSize: 24.0,
leadingIconWidget: UserAvatarWidget(
currentUser,
- type: AvatarType.mini,
+ type: AvatarType.md,
currentUserID: currentUserID,
),
menuItemColor: colorScheme.fillFaint,
diff --git a/mobile/apps/photos/lib/ui/sharing/album_share_info_widget.dart b/mobile/apps/photos/lib/ui/sharing/album_share_info_widget.dart
index e856862146..2835586918 100644
--- a/mobile/apps/photos/lib/ui/sharing/album_share_info_widget.dart
+++ b/mobile/apps/photos/lib/ui/sharing/album_share_info_widget.dart
@@ -17,7 +17,7 @@ class AlbumSharesIcons extends StatelessWidget {
const AlbumSharesIcons({
super.key,
required this.sharees,
- this.type = AvatarType.tiny,
+ this.type = AvatarType.sm,
this.limitCountTo = 2,
this.removeBorder = true,
this.trailingWidget,
@@ -77,26 +77,30 @@ class AlbumSharesIcons extends StatelessWidget {
double getOverlapPadding(AvatarType type) {
switch (type) {
- case AvatarType.extra:
+ case AvatarType.xs:
return 14.0;
- case AvatarType.tiny:
+ case AvatarType.sm:
return 14.0;
- case AvatarType.mini:
+ case AvatarType.md:
return 20.0;
- case AvatarType.small:
+ case AvatarType.lg:
+ return 24.0;
+ case AvatarType.xl:
return 28.0;
}
}
MoreCountType moreCountTypeFromAvatarType(AvatarType type) {
switch (type) {
- case AvatarType.extra:
- return MoreCountType.extra;
- case AvatarType.tiny:
- return MoreCountType.tiny;
- case AvatarType.mini:
- return MoreCountType.mini;
- case AvatarType.small:
- return MoreCountType.small;
+ case AvatarType.xs:
+ return MoreCountType.xs;
+ case AvatarType.sm:
+ return MoreCountType.sm;
+ case AvatarType.md:
+ return MoreCountType.md;
+ case AvatarType.lg:
+ return MoreCountType.lg;
+ case AvatarType.xl:
+ return MoreCountType.xl;
}
}
diff --git a/mobile/apps/photos/lib/ui/sharing/more_count_badge.dart b/mobile/apps/photos/lib/ui/sharing/more_count_badge.dart
index 0fa74ac9c1..c98f5f8fe7 100644
--- a/mobile/apps/photos/lib/ui/sharing/more_count_badge.dart
+++ b/mobile/apps/photos/lib/ui/sharing/more_count_badge.dart
@@ -3,7 +3,7 @@ import 'package:photos/theme/colors.dart';
import 'package:photos/theme/ente_theme.dart';
import 'package:tuple/tuple.dart';
-enum MoreCountType { small, mini, tiny, extra }
+enum MoreCountType { xl, lg, md, sm, xs }
class MoreCountWidget extends StatelessWidget {
final MoreCountType type;
@@ -13,7 +13,7 @@ class MoreCountWidget extends StatelessWidget {
const MoreCountWidget(
this.count, {
super.key,
- this.type = MoreCountType.mini,
+ this.type = MoreCountType.md,
this.thumbnailView = false,
});
@@ -66,13 +66,15 @@ class MoreCountWidget extends StatelessWidget {
) {
final enteTextTheme = getEnteTextTheme(context);
switch (type) {
- case MoreCountType.small:
+ case MoreCountType.xl:
return Tuple2(32.0, enteTextTheme.small);
- case MoreCountType.mini:
+ case MoreCountType.lg:
+ return Tuple2(28.0, enteTextTheme.mini);
+ case MoreCountType.md:
return Tuple2(24.0, enteTextTheme.mini);
- case MoreCountType.tiny:
+ case MoreCountType.sm:
return Tuple2(18.0, enteTextTheme.tiny);
- case MoreCountType.extra:
+ case MoreCountType.xs:
return Tuple2(18.0, enteTextTheme.tiny);
}
}
diff --git a/mobile/apps/photos/lib/ui/sharing/share_collection_page.dart b/mobile/apps/photos/lib/ui/sharing/share_collection_page.dart
index 202e3019c0..357c6e060a 100644
--- a/mobile/apps/photos/lib/ui/sharing/share_collection_page.dart
+++ b/mobile/apps/photos/lib/ui/sharing/share_collection_page.dart
@@ -400,7 +400,7 @@ class EmailItemWidget extends StatelessWidget {
sharees: collection.getSharees(),
padding: const EdgeInsets.all(0),
limitCountTo: 10,
- type: AvatarType.mini,
+ type: AvatarType.md,
removeBorder: false,
),
),
diff --git a/mobile/apps/photos/lib/ui/sharing/user_avator_widget.dart b/mobile/apps/photos/lib/ui/sharing/user_avator_widget.dart
index baab01b249..645d5daee1 100644
--- a/mobile/apps/photos/lib/ui/sharing/user_avator_widget.dart
+++ b/mobile/apps/photos/lib/ui/sharing/user_avator_widget.dart
@@ -14,20 +14,22 @@ import "package:photos/ui/viewer/people/person_face_widget.dart";
import "package:photos/utils/standalone/debouncer.dart";
import 'package:tuple/tuple.dart';
-enum AvatarType { small, mini, tiny, extra }
+enum AvatarType { xl, lg, md, sm, xs }
class UserAvatarWidget extends StatefulWidget {
final User user;
final AvatarType type;
final int currentUserID;
final bool thumbnailView;
+ final bool addStroke;
const UserAvatarWidget(
this.user, {
super.key,
this.currentUserID = -1,
- this.type = AvatarType.mini,
+ this.type = AvatarType.md,
this.thumbnailView = false,
+ this.addStroke = true,
});
@override
@@ -90,17 +92,20 @@ class _UserAvatarWidgetState extends State<UserAvatarWidget> {
final double size = getAvatarSize(widget.type);
return _personID != null
? Container(
- padding: const EdgeInsets.all(0.5),
- decoration: BoxDecoration(
- shape: BoxShape.circle,
- border: Border.all(
- color: widget.thumbnailView
- ? strokeMutedDark
- : getEnteColorScheme(context).strokeMuted,
- width: UserAvatarWidget.strokeWidth,
- strokeAlign: BorderSide.strokeAlignOutside,
- ),
- ),
+ padding:
+ widget.addStroke ? const EdgeInsets.all(0.5) : EdgeInsets.zero,
+ decoration: widget.addStroke
+ ? BoxDecoration(
+ shape: BoxShape.circle,
+ border: Border.all(
+ color: widget.thumbnailView
+ ? strokeMutedDark
+ : getEnteColorScheme(context).strokeMuted,
+ width: UserAvatarWidget.strokeWidth,
+ strokeAlign: BorderSide.strokeAlignOutside,
+ ),
+ )
+ : null,
child: SizedBox(
height: size,
width: size,
@@ -234,13 +239,15 @@ class _FirstLetterCircularAvatarState
) {
final enteTextTheme = getEnteTextTheme(context);
switch (type) {
- case AvatarType.small:
+ case AvatarType.xl:
return Tuple2(32.0, enteTextTheme.small);
- case AvatarType.mini:
+ case AvatarType.lg:
+ return Tuple2(28.0, enteTextTheme.mini);
+ case AvatarType.md:
return Tuple2(24.0, enteTextTheme.mini);
- case AvatarType.tiny:
+ case AvatarType.sm:
return Tuple2(18.0, enteTextTheme.tiny);
- case AvatarType.extra:
+ case AvatarType.xs:
return Tuple2(18.0, enteTextTheme.tiny);
}
}
@@ -250,13 +257,15 @@ double getAvatarSize(
AvatarType type,
) {
switch (type) {
- case AvatarType.small:
+ case AvatarType.xl:
return 32.0;
- case AvatarType.mini:
+ case AvatarType.lg:
+ return 28.0;
+ case AvatarType.md:
return 24.0;
- case AvatarType.tiny:
+ case AvatarType.sm:
return 18.0;
- case AvatarType.extra:
+ case AvatarType.xs:
return 18.0;
}
}
diff --git a/mobile/apps/photos/lib/ui/social/comments_screen.dart b/mobile/apps/photos/lib/ui/social/comments_screen.dart
index e20a6a9a70..fe4f19ba43 100644
--- a/mobile/apps/photos/lib/ui/social/comments_screen.dart
+++ b/mobile/apps/photos/lib/ui/social/comments_screen.dart
@@ -251,6 +251,8 @@ class _CommentsScreenState extends State<CommentsScreen> {
),
CommentInputWidget(
replyingTo: _replyingTo,
+ replyingToUser:
+ _replyingTo != null ? _getUserForComment(_replyingTo!) : null,
onDismissReply: _dismissReply,
controller: _textController,
focusNode: _inputFocusNode,
diff --git a/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart b/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart
index 68066ff2a2..ca64622d20 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart
@@ -173,30 +173,39 @@ class _InlineParentQuote extends StatelessWidget {
}
final parentText = parentComment?.data ?? "Original comment unavailable";
+ final isDarkMode = Theme.of(context).brightness == Brightness.dark;
+
+ final lineColor = isOwnComment
+ ? (isDarkMode ? const Color(0x33000000) : const Color(0xFF08571C))
+ : const Color(0xFF8C8C8C);
return Container(
margin: const EdgeInsets.only(bottom: 8),
- padding: const EdgeInsets.only(left: 10),
- decoration: BoxDecoration(
- border: Border(
- left: BorderSide(
- color: isOwnComment
- ? textBaseDark.withValues(alpha: 0.6)
- : colorScheme.strokeMuted,
- width: 2,
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Container(
+ width: 3,
+ height: 14,
+ decoration: BoxDecoration(
+ color: lineColor,
+ borderRadius: BorderRadius.circular(1.5),
+ ),
),
- ),
- ),
- child: Text(
- parentText,
- style: textTheme.tiny.copyWith(
- height: 1.7,
- color: isOwnComment
- ? textBaseDark.withValues(alpha: 0.9)
- : colorScheme.textMuted,
- ),
- maxLines: 2,
- overflow: TextOverflow.ellipsis,
+ const SizedBox(width: 10),
+ Text(
+ parentText,
+ style: textTheme.tiny.copyWith(
+ height: 1.7,
+ color: isOwnComment
+ ? textBaseDark.withValues(alpha: 0.9)
+ : colorScheme.textMuted,
+ ),
+ maxLines: 2,
+ overflow: TextOverflow.ellipsis,
+ ),
+ ],
),
);
}
@@ -351,7 +360,9 @@ class _Header extends StatelessWidget {
UserAvatarWidget(
user,
currentUserID: currentUserID,
- type: AvatarType.small,
+ type: AvatarType.lg,
+ thumbnailView: true,
+ addStroke: false,
),
const SizedBox(width: 10),
Flexible(child: headerText),
@@ -361,7 +372,9 @@ class _Header extends StatelessWidget {
UserAvatarWidget(
user,
currentUserID: currentUserID,
- type: AvatarType.small,
+ type: AvatarType.lg,
+ thumbnailView: true,
+ addStroke: false,
),
],
],
diff --git a/mobile/apps/photos/lib/ui/social/widgets/comment_input_widget.dart b/mobile/apps/photos/lib/ui/social/widgets/comment_input_widget.dart
index 6dcf94ae2c..2eb6c73a61 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/comment_input_widget.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/comment_input_widget.dart
@@ -1,10 +1,12 @@
import "package:flutter/material.dart";
+import "package:photos/models/api/collection/user.dart";
import "package:photos/models/social/comment.dart";
import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/social/widgets/reply_preview_widget.dart";
class CommentInputWidget extends StatelessWidget {
final Comment? replyingTo;
+ final User? replyingToUser;
final VoidCallback? onDismissReply;
final TextEditingController controller;
final FocusNode focusNode;
@@ -12,6 +14,7 @@ class CommentInputWidget extends StatelessWidget {
const CommentInputWidget({
this.replyingTo,
+ this.replyingToUser,
this.onDismissReply,
required this.controller,
required this.focusNode,
@@ -38,26 +41,28 @@ class CommentInputWidget extends StatelessWidget {
top: 20,
),
color: colorScheme.backgroundBase,
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- if (replyingTo != null)
- ReplyPreviewWidget(
- replyingTo: replyingTo!,
- onDismiss: onDismissReply!,
+ child: SafeArea(
+ top: false,
+ child: Container(
+ decoration: BoxDecoration(
+ color: textFieldFillColor,
+ border: Border.all(
+ color: textFieldBorderColor,
+ width: 2,
+ strokeAlign: BorderSide.strokeAlignOutside,
),
- SafeArea(
- top: false,
- child: Container(
- decoration: BoxDecoration(
- border: Border.all(
- color: textFieldBorderColor,
- width: 2,
- strokeAlign: BorderSide.strokeAlignOutside,
+ borderRadius: BorderRadius.circular(20),
+ ),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ if (replyingTo != null && replyingToUser != null)
+ ReplyPreviewWidget(
+ replyingTo: replyingTo!,
+ replyingToUser: replyingToUser!,
+ onDismiss: onDismissReply!,
),
- borderRadius: BorderRadius.circular(20),
- ),
- child: TextField(
+ TextField(
controller: controller,
focusNode: focusNode,
textInputAction: TextInputAction.send,
@@ -75,7 +80,7 @@ class CommentInputWidget extends StatelessWidget {
),
border: InputBorder.none,
filled: true,
- fillColor: textFieldFillColor,
+ fillColor: Colors.transparent,
contentPadding: const EdgeInsets.symmetric(
horizontal: 18,
vertical: 14,
@@ -101,9 +106,9 @@ class CommentInputWidget extends StatelessWidget {
),
),
),
- ),
+ ],
),
- ],
+ ),
),
);
}
diff --git a/mobile/apps/photos/lib/ui/social/widgets/reply_preview_widget.dart b/mobile/apps/photos/lib/ui/social/widgets/reply_preview_widget.dart
index 7351fe69c4..adc85e5b3c 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/reply_preview_widget.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/reply_preview_widget.dart
@@ -1,13 +1,17 @@
import "package:flutter/material.dart";
+import "package:photos/extensions/user_extension.dart";
+import "package:photos/models/api/collection/user.dart";
import "package:photos/models/social/comment.dart";
import "package:photos/theme/ente_theme.dart";
class ReplyPreviewWidget extends StatelessWidget {
final Comment replyingTo;
+ final User replyingToUser;
final VoidCallback onDismiss;
const ReplyPreviewWidget({
required this.replyingTo,
+ required this.replyingToUser,
required this.onDismiss,
super.key,
});
@@ -19,9 +23,9 @@ class ReplyPreviewWidget extends StatelessWidget {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
- decoration: BoxDecoration(
- color: colorScheme.fillFaint,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(8)),
+ decoration: const BoxDecoration(
+ color: Colors.transparent,
+ borderRadius: BorderRadius.vertical(top: Radius.circular(8)),
),
child: Row(
children: [
@@ -31,8 +35,10 @@ class ReplyPreviewWidget extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: [
Text(
- "Replying to User #${replyingTo.userID}...",
+ "Replying to ${replyingToUser.displayName ?? replyingToUser.email}",
style: textTheme.small.copyWith(color: colorScheme.textMuted),
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
),
const SizedBox(height: 2),
Text(
@@ -44,16 +50,17 @@ class ReplyPreviewWidget extends StatelessWidget {
],
),
),
- GestureDetector(
- onTap: onDismiss,
- child: Icon(
- Icons.close,
- size: 18,
- color: colorScheme.textMuted,
- ),
- ),
],
),
);
}
}
+
+// GestureDetector(
+// onTap: onDismiss,
+// child: Icon(
+// Icons.close,
+// size: 18,
+// color: colorScheme.textMuted,
+// ),
+// ),
diff --git a/mobile/apps/photos/lib/ui/viewer/file/file_icons_widget.dart b/mobile/apps/photos/lib/ui/viewer/file/file_icons_widget.dart
index eeacb28a94..efc115d652 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/file_icons_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/file_icons_widget.dart
@@ -210,7 +210,7 @@ class OwnerAvatarOverlayIcon extends StatelessWidget {
padding: const EdgeInsets.only(right: 4, top: 4),
child: UserAvatarWidget(
user,
- type: AvatarType.tiny,
+ type: AvatarType.sm,
thumbnailView: true,
),
),
diff --git a/mobile/apps/photos/lib/ui/viewer/people/link_email_screen.dart b/mobile/apps/photos/lib/ui/viewer/people/link_email_screen.dart
index b337659e0d..bca8a4d78c 100644
--- a/mobile/apps/photos/lib/ui/viewer/people/link_email_screen.dart
+++ b/mobile/apps/photos/lib/ui/viewer/people/link_email_screen.dart
@@ -145,7 +145,7 @@ class _LinkEmailScreen extends State<LinkEmailScreen> {
leadingIconSize: 24.0,
leadingIconWidget: UserAvatarWidget(
currentUser,
- type: AvatarType.mini,
+ type: AvatarType.md,
),
menuItemColor:
getEnteColorScheme(context).fillFaint,
diff --git a/mobile/apps/photos/lib/ui/viewer/people/save_or_edit_person.dart b/mobile/apps/photos/lib/ui/viewer/people/save_or_edit_person.dart
index 9c6e049e0b..8b79c8309a 100644
--- a/mobile/apps/photos/lib/ui/viewer/people/save_or_edit_person.dart
+++ b/mobile/apps/photos/lib/ui/viewer/people/save_or_edit_person.dart
@@ -710,8 +710,8 @@ class _EmailSectionState extends State<_EmailSection> {
@override
Widget build(BuildContext context) {
const limitCountTo = 5;
- final avatarSize = getAvatarSize(AvatarType.small);
- final overlapPadding = getOverlapPadding(AvatarType.small);
+ final avatarSize = getAvatarSize(AvatarType.xl);
+ final overlapPadding = getOverlapPadding(AvatarType.xl);
if (_email == null || _email!.isEmpty) {
return AnimatedSize(
duration: const Duration(milliseconds: 200),
@@ -739,7 +739,7 @@ class _EmailSectionState extends State<_EmailSection> {
child: AlbumSharesIcons(
sharees: _contacts,
limitCountTo: limitCountTo,
- type: AvatarType.small,
+ type: AvatarType.xl,
padding: EdgeInsets.zero,
stackAlignment: Alignment.center,
),