From 6d8d79435912409bb5276840d38e6732650253d4 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Tue, 17 Oct 2023 10:50:14 +0100
Subject: [PATCH 1/3] Update copy
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/i18n/strings/en_EN.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index be3e9cd76f0..e80adab5cb5 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -3418,7 +3418,7 @@
"label": "Message Actions",
"view_in_room": "View in room"
},
- "message_timestamp_received_at": "Recovered at: %(dateTime)s",
+ "message_timestamp_received_at": "Received at: %(dateTime)s",
"message_timestamp_sent_at": "Sent at: %(dateTime)s",
"mjolnir": {
"changed_rule_glob": "%(senderName)s updated a ban rule that was matching %(oldGlob)s to matching %(newGlob)s for %(reason)s",
From 22f6b77c50ca765e2ed0a9fb070043cb8c6e5e98 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Tue, 17 Oct 2023 11:14:19 +0100
Subject: [PATCH 2/3] Add icon to late event timestamp
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
res/css/views/messages/_MessageTimestamp.pcss | 8 ++++++++
res/img/sensor.svg | 3 +++
src/components/views/messages/MessageTimestamp.tsx | 6 +++++-
3 files changed, 16 insertions(+), 1 deletion(-)
create mode 100644 res/img/sensor.svg
diff --git a/res/css/views/messages/_MessageTimestamp.pcss b/res/css/views/messages/_MessageTimestamp.pcss
index 80f64df09ee..62da4066549 100644
--- a/res/css/views/messages/_MessageTimestamp.pcss
+++ b/res/css/views/messages/_MessageTimestamp.pcss
@@ -29,3 +29,11 @@ limitations under the License.
white-space: nowrap;
user-select: none;
}
+
+.mx_MessageTimestamp_lateIcon {
+ position: absolute;
+ right: 100%;
+ top: 50%;
+ transform: translateY(-50%);
+ color: inherit;
+}
diff --git a/res/img/sensor.svg b/res/img/sensor.svg
new file mode 100644
index 00000000000..0bc41eac0bc
--- /dev/null
+++ b/res/img/sensor.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/components/views/messages/MessageTimestamp.tsx b/src/components/views/messages/MessageTimestamp.tsx
index fba6db726b9..6e0984808fd 100644
--- a/src/components/views/messages/MessageTimestamp.tsx
+++ b/src/components/views/messages/MessageTimestamp.tsx
@@ -15,11 +15,12 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-import React from "react";
+import React, { ReactNode } from "react";
import { Tooltip } from "@vector-im/compound-web";
import { formatFullDate, formatTime, formatFullTime, formatRelativeTime } from "../../../DateUtils";
import { _t } from "../../../languageHandler";
+import { Icon as LateIcon } from "../../../../res/img/sensor.svg";
interface IProps {
ts: number;
@@ -49,17 +50,20 @@ export default class MessageTimestamp extends React.Component {
let label = formatFullDate(date, this.props.showTwelveHour);
let caption: string | undefined;
+ let icon: ReactNode | undefined;
if (this.props.receivedTs !== undefined) {
label = _t("timeline|message_timestamp_sent_at", { dateTime: label });
const receivedDate = new Date(this.props.receivedTs);
caption = _t("timeline|message_timestamp_received_at", {
dateTime: formatFullDate(receivedDate, this.props.showTwelveHour),
});
+ icon = ;
}
return (
+ {icon}
{timestamp}
From 5f95002aa203fe1e1bdec7125aa9cc94fd3ffd11 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Tue, 17 Oct 2023 11:56:00 +0100
Subject: [PATCH 3/3] Update snapshot
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
test/components/views/messages/MessageTimestamp-test.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/components/views/messages/MessageTimestamp-test.tsx b/test/components/views/messages/MessageTimestamp-test.tsx
index a636e6f3e60..05a1ca12c15 100644
--- a/test/components/views/messages/MessageTimestamp-test.tsx
+++ b/test/components/views/messages/MessageTimestamp-test.tsx
@@ -57,7 +57,7 @@ describe("MessageTimestamp", () => {
);
await userEvent.hover(container.querySelector(".mx_MessageTimestamp")!);
expect((await screen.findByRole("tooltip")).textContent).toMatchInlineSnapshot(
- `"Sent at: Fri, Dec 17, 2021, 08:09:00Recovered at: Sat, Dec 18, 2021, 08:09:00"`,
+ `"Sent at: Fri, Dec 17, 2021, 08:09:00Received at: Sat, Dec 18, 2021, 08:09:00"`,
);
});
});