Skip to content

armgit / ente

Public Imported from GitHub
0

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

[space][web] Refine message previews and touch navigation

Anand Baburajan270708094d9a
diff --git a/web/apps/space/src/screens/MessagesScreen.tsx b/web/apps/space/src/screens/MessagesScreen.tsx
index 38d429118b..43d46583b3 100644
--- a/web/apps/space/src/screens/MessagesScreen.tsx
+++ b/web/apps/space/src/screens/MessagesScreen.tsx
@@ -190,7 +190,7 @@ const conversationPreview = (conversation: SpaceMessageConversation) => {
const activity = conversation.latestActivity;
if (activity.isUnavailable) return "Message unavailable";
if (activity.type == "empty") {
- return "No messages yet";
+ return "Say hello!";
}
const text = activity.text ? truncateMessageText(activity.text) : "";
if (activity.type == "post_reply") {
@@ -227,6 +227,7 @@ const ConversationPreviewLine: React.FC<{
const previewLineSx = {
...spaceActivityPreviewSx,
color: conversation.notificationUnread ? "#D0D0D0" : spaceTextMuted,
+ fontStyle: activity.type == "empty" ? "italic" : "normal",
fontWeight: conversation.notificationUnread
? 600
: spaceActivityPreviewSx.fontWeight,
@@ -353,7 +354,9 @@ const ConversationListItem: React.FC<{
}) => {
const name =
conversation.friend.fullName.trim() || conversation.friend.username;
- const post = conversation.latestActivity.post;
+ const post = conversation.latestActivity.outgoing
+ ? undefined
+ : conversation.latestActivity.post;
const showPostThumbnailSlot = Boolean(post);
const unreadCount = conversation.unreadCount;
React.useEffect(() => {
diff --git a/web/apps/space/src/screens/ProfileScreen.tsx b/web/apps/space/src/screens/ProfileScreen.tsx
index 44b4280882..f3017d7e9f 100644
--- a/web/apps/space/src/screens/ProfileScreen.tsx
+++ b/web/apps/space/src/screens/ProfileScreen.tsx
@@ -545,15 +545,11 @@ export const ProfileScreen: React.FC<ProfileScreenProps> = ({
(loadedPostImageURLFor(profilePostPhoto(item, index)) ?? ""),
})),
);
- const selectedPhotoIndex = selectedPost
- ? profileViewerPhotos.findIndex(
- (photo) =>
- photo.id == selectedPost.id &&
- photo.postPhotoIndex == selectedPost.photoIndex,
- )
- : 0;
+ const selectedPostPhotos = profileViewerPhotos.filter(
+ (photo) => photo.id == selectedPost?.id,
+ );
const handleSelectedPostIndexChange = (photoIndex: number) => {
- const photo = profileViewerPhotos[photoIndex];
+ const photo = selectedPostPhotos[photoIndex];
if (!photo) return;
setSelectedPost({
id: photo.id,
@@ -1517,8 +1513,8 @@ export const ProfileScreen: React.FC<ProfileScreenProps> = ({
closeOnSwipePastEnd
headerHeight={profileHeaderHeight}
photo={selectedPost.photo}
- photos={profileViewerPhotos}
- photoIndex={selectedPhotoIndex}
+ photos={selectedPostPhotos}
+ photoIndex={selectedPost.photoIndex}
onPhotoIndexChange={handleSelectedPostIndexChange}
onLoadPhoto={onLoadPostImage}
postActionMode={selectedPostActionMode}
diff --git a/web/apps/space/src/styles/activity-list.ts b/web/apps/space/src/styles/activity-list.ts
index a912dac7dd..a1f325a04d 100644
--- a/web/apps/space/src/styles/activity-list.ts
+++ b/web/apps/space/src/styles/activity-list.ts
@@ -18,9 +18,11 @@ export const spaceActivityRowSx = {
p: "8px",
textAlign: "left",
transition: "background-color 140ms ease",
+ userSelect: "none",
width: "calc(100% + 16px)",
- "&:active": { bgcolor: spaceSurface },
- "&:hover": { bgcolor: spaceSurface },
+ "@media (hover: hover) and (pointer: fine)": {
+ "&:active, &:hover": { bgcolor: spaceSurface },
+ },
} as const;
export const spaceActivityPreviewSx = {