Skip to content
Merged
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
19 changes: 17 additions & 2 deletions storybook/pages/StatusEmojiPopupPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

import StatusQ
import StatusQ.Core.Theme
import StatusQ.Core.Utils as StatusQUtils

Expand All @@ -21,6 +22,7 @@ SplitView {
QtObject {
id: d
property string lastSelectedEmoji: "N/A"
property string lastSelectedEmojiHexcode: ""
}

Pane {
Expand Down Expand Up @@ -62,6 +64,7 @@ SplitView {
onEmojiSelected: function(emoji, atCu, hexcode) {
logs.logEvent("onEmojiSelected", ["emoji", "atCu", "hexcode"], arguments)
d.lastSelectedEmoji = emoji
d.lastSelectedEmojiHexcode = hexcode
}
}
}
Expand All @@ -79,14 +82,26 @@ SplitView {
text: "Clear settings (reload to take effect)"
onClicked: {
d.lastSelectedEmoji = ""
d.lastSelectedEmojiHexcode = ""
settings.recentEmojis = []
settings.skinColor = ""
settings.sync()
}
}

Label {
text: "Last selected: %1 ('%2')".arg(d.lastSelectedEmoji).arg(settings.recentEmojis[0] ?? "")
RowLayout {
Label {
text: "Last selected: %1 ('%2')".arg(d.lastSelectedEmoji).arg(d.lastSelectedEmojiHexcode)
}
ToolButton {
Layout.preferredWidth: 32
Layout.preferredHeight: 32
text: "📋"
enabled: !!d.lastSelectedEmojiHexcode
onClicked: ClipboardUtils.setText(d.lastSelectedEmojiHexcode)
ToolTip.text: "Copy to clipboard"
ToolTip.visible: hovered
}
}

Button {
Expand Down
15 changes: 9 additions & 6 deletions storybook/pages/StatusMessagePage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ SplitView {
readonly property var reactionsModels: ReactionsModels {}

readonly property var messageWithThreeReactions: [{
timestamp: 1667937830123,
timestamp: new Date().valueOf(),
senderId: "zq123456790",
senderDisplayName: "Alice",
contentType: StatusMessage.ContentType.Text,
message: "This message has 3 reactions",
message: "This message has 3 reactions and should have current timestamp",
isContact: true,
isAReply: false,
trustIndicator: StatusContactVerificationIcons.TrustedType.None,
Expand All @@ -39,7 +39,7 @@ SplitView {
senderId: "zq123456790",
senderDisplayName: "Alice",
contentType: StatusMessage.ContentType.Text,
message: "This message has 20 reactions",
message: "This message has 20 reactions (max)",
isContact: true,
isAReply: false,
trustIndicator: StatusContactVerificationIcons.TrustedType.None,
Expand Down Expand Up @@ -265,19 +265,20 @@ SplitView {
sender.isEnsVerified: isEnsVerified
sender.profileImage {
name: model.profileImage || ""
colorId: index
colorId: index % Theme.palette.userCustomizationColors.length
}
album: model.contentType === StatusMessage.ContentType.Image ? d.exampleAlbum : []
albumCount: model.contentType === StatusMessage.ContentType.Image ? d.exampleAlbum.length : 0
}

replyDetails {
amISender: true
amISender: index % 2
sender.id: "0xdeadbeef"
sender.displayName: "Foobar"
sender.profileImage {
width: 20
height: 20
name: ModelsData.icons.dribble
name: index % 2 ? ModelsData.icons.dribble : ModelsData.icons.socks
}
messageText: ModelsData.descriptions.mediumLoremIpsum
}
Expand All @@ -289,6 +290,8 @@ SplitView {
onResendClicked: logs.logEvent("StatusMessage::resendClicked")
onLinkActivated: logs.logEvent("StatusMessage::linkActivated", ["link"], arguments)
onImageClicked: logs.logEvent("StatusMessage::imageClicked")
onAddReactionClicked: logs.logEvent("StatusMessage::addReactionClicked")
onToggleReactionClicked: logs.logEvent("StatusMessage::toggleReactionClicked", ["hexcode"], arguments)
}
}
}
Expand Down
61 changes: 29 additions & 32 deletions storybook/src/Models/ReactionsModels.qml
Original file line number Diff line number Diff line change
@@ -1,150 +1,147 @@
import QtQuick

import QtQml

QtObject {
readonly property var threeReactions: [
{
emoji: "😄",
emoji: "1f600",
didIReactWithThisEmoji: true,
numberOfReactions: 1,
jsonArrayOfUsersReactedWithThisEmoji: "[\"You\"]"
},
{
emoji: "🕵️‍♀",
emoji: "1f575-fe0f-200d-2642-fe0f",
didIReactWithThisEmoji: false,
numberOfReactions: 2,
jsonArrayOfUsersReactedWithThisEmoji: "[\"Bob\", \"John\"]"
},
{
emoji: "😂",
emoji: "1f602",
didIReactWithThisEmoji: true,
numberOfReactions: 5,
jsonArrayOfUsersReactedWithThisEmoji: "[\"You\", \"Sally\", \"Tom\", \"Eve\", \"Raj\"]"
}

]

readonly property var twentyReactions: [
{
emoji: "😄",
emoji: "1f604",
didIReactWithThisEmoji: true,
numberOfReactions: 1,
jsonArrayOfUsersReactedWithThisEmoji: "[\"You\"]"
},
{
emoji: "🕵️‍♀",
emoji: "1fae3",
didIReactWithThisEmoji: false,
numberOfReactions: 232,
numberOfReactions: 23,
jsonArrayOfUsersReactedWithThisEmoji: "[\"Bob\", \"John\"]"
},
{
emoji: "😂",
emoji: "1f602",
didIReactWithThisEmoji: true,
numberOfReactions: 5,
jsonArrayOfUsersReactedWithThisEmoji: "[\"You\", \"Sally\", \"Tom\", \"Eve\", \"Raj\"]"
},
{
emoji: "❤️",
emoji: "2764",
didIReactWithThisEmoji: false,
numberOfReactions: 8,
jsonArrayOfUsersReactedWithThisEmoji: "[\"Mia\", \"Noah\", \"Liam\", \"Olivia\", \"Ava\", \"Emma\", \"Lucas\", \"Zoe\"]"
},
{
emoji: "👍",
emoji: "1f44d",
didIReactWithThisEmoji: true,
numberOfReactions: 3,
jsonArrayOfUsersReactedWithThisEmoji: "[\"You\", \"Ben\", \"Claire\"]"
},
{
emoji: "🎉",
emoji: "1f389",
didIReactWithThisEmoji: false,
numberOfReactions: 4,
jsonArrayOfUsersReactedWithThisEmoji: "[\"Ivy\", \"Ken\", \"Lara\", \"Omar\"]"
numberOfReactions: 16,
jsonArrayOfUsersReactedWithThisEmoji: "[\"Mia\", \"Noah\", \"Liam\", \"Olivia\", \"Ava\", \"Emma\", \"Lucas\", \"Zoe\", \"Mia\", \"Noah\", \"Liam\", \"Olivia\", \"Ava\", \"Emma\", \"Lucas\", \"Zoe\"]"
},
{
emoji: "😮",
emoji: "1f62e",
didIReactWithThisEmoji: false,
numberOfReactions: 1,
jsonArrayOfUsersReactedWithThisEmoji: "[\"Zed\"]"
},
{
emoji: "😢",
emoji: "1f972",
didIReactWithThisEmoji: false,
numberOfReactions: 2,
jsonArrayOfUsersReactedWithThisEmoji: "[\"Martha\", \"Gus\"]"
},
{
emoji: "🔥",
emoji: "1f525",
didIReactWithThisEmoji: true,
numberOfReactions: 6,
jsonArrayOfUsersReactedWithThisEmoji: "[\"You\", \"Alex\", \"Sam\", \"Nina\", \"Pax\", \"Rae\"]"
},
{
emoji: "🙏",
emoji: "1f64f",
didIReactWithThisEmoji: false,
numberOfReactions: 2,
jsonArrayOfUsersReactedWithThisEmoji: "[\"Hana\", \"Ike\"]"
},
{
emoji: "😅",
emoji: "1f917",
didIReactWithThisEmoji: true,
numberOfReactions: 2,
jsonArrayOfUsersReactedWithThisEmoji: "[\"You\", \"Pete\"]"
},
{
emoji: "😎",
emoji: "1f636-200d-1f32b-fe0f",
didIReactWithThisEmoji: false,
numberOfReactions: 3,
jsonArrayOfUsersReactedWithThisEmoji: "[\"Ruth\", \"Vik\", \"Jill\"]"
},
{
emoji: "🤔",
emoji: "1f914",
didIReactWithThisEmoji: false,
numberOfReactions: 1,
jsonArrayOfUsersReactedWithThisEmoji: "[\"Oli\"]"
},
{
emoji: "🤯",
emoji: "1f92f",
didIReactWithThisEmoji: true,
numberOfReactions: 7,
jsonArrayOfUsersReactedWithThisEmoji: "[\"You\", \"Abe\", \"Maya\", \"Noel\", \"Cory\", \"Lina\", \"Zara\"]"
},
{
emoji: "🎶",
emoji: "1f3b6",
didIReactWithThisEmoji: false,
numberOfReactions: 2,
jsonArrayOfUsersReactedWithThisEmoji: "[\"Tess\", \"Bea\"]"
},
{
emoji: "💯",
emoji: "1f4af",
didIReactWithThisEmoji: true,
numberOfReactions: 9,
jsonArrayOfUsersReactedWithThisEmoji: "[\"You\", \"Gabe\", \"Rin\", \"Seth\", \"Moe\", \"Luz\", \"Ira\", \"Noa\", \"Pam\"]"
},
{
emoji: "👀",
emoji: "1f440",
didIReactWithThisEmoji: false,
numberOfReactions: 1,
jsonArrayOfUsersReactedWithThisEmoji: "[\"Kai\"]"
},
{
emoji: "😜",
emoji: "1f609",
didIReactWithThisEmoji: true,
numberOfReactions: 3,
jsonArrayOfUsersReactedWithThisEmoji: "[\"You\", \"Dot\", \"Max\"]"
},
{
emoji: "🥳",
emoji: "1f973",
didIReactWithThisEmoji: false,
numberOfReactions: 4,
jsonArrayOfUsersReactedWithThisEmoji: "[\"June\", \"Fay\", \"Roy\", \"Skye\"]"
},
{
emoji: "🤝",
emoji: "1f37b",
didIReactWithThisEmoji: false,
numberOfReactions: 2,
numberOfReactions: 123456789,
jsonArrayOfUsersReactedWithThisEmoji: "[\"Ivy\", \"Omar\"]"
}

]
// Component.onCompleted: append(data)
}
17 changes: 15 additions & 2 deletions test/e2e/gui/screens/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,22 @@ def get_emoji_reactions_pathes(self):
reactions_pathes = []
for child in walk_children(self.object):
if getattr(child, 'id', '') == 'reactionDelegate':
# Search for StatusIcon inside reactionDelegate and extract emoji ID from icon path
for item in walk_children(child):
if getattr(item, 'objectName', '') == 'emojiReaction':
reactions_pathes.append(item.emojiId)
icon_path = None
if hasattr(item, 'icon'):
icon_path = str(item.icon)
elif hasattr(item, 'source'):
icon_path = str(item.source)

if icon_path:
# Extract emoji ID from path like "qrc:/assets/twemoji/svg/1f600.svg"
match = re.search(r'/([a-f0-9]+)\.svg', icon_path)
if match:
reactions_pathes.append(match.group(1))
break
if not reactions_pathes:
raise LookupError('No emoji reactions found for this message')
return reactions_pathes


Expand Down
Loading