Skip to content

Commit f9440bf

Browse files
Timeline date headers
1 parent 0fa069f commit f9440bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1179
-767
lines changed

_locales/en/messages.json

+18-2
Original file line numberDiff line numberDiff line change
@@ -571,11 +571,11 @@
571571
},
572572
"today": {
573573
"message": "Today",
574-
"description": "Section header in the media gallery"
574+
"description": "The string \"today\""
575575
},
576576
"yesterday": {
577577
"message": "Yesterday",
578-
"description": "Section header in the media gallery"
578+
"description": "The string \"yesterday\""
579579
},
580580
"thisWeek": {
581581
"message": "This Week",
@@ -2085,6 +2085,14 @@
20852085
"message": "MMM D",
20862086
"description": "Timestamp format string for displaying month and day (but not the year) of a date within the current year, ex: use 'MMM D' for 'Aug 8', or 'D MMM' for '8 Aug'."
20872087
},
2088+
"timestampFormat__long__today": {
2089+
"message": "[Today] LT",
2090+
"description": "Timestamp format string for displaying \"Today\" and the time"
2091+
},
2092+
"timestampFormat__long__yesterday": {
2093+
"message": "[Yesterday] LT",
2094+
"description": "Timestamp format string for displaying \"Yesterday\" and the time"
2095+
},
20882096
"messageBodyTooLong": {
20892097
"message": "Message body is too long.",
20902098
"description": "Shown if the user tries to send more than 64kb of text"
@@ -5941,6 +5949,14 @@
59415949
"message": "Continue",
59425950
"description": "aria-label for the 'next' button in the forward a message modal dialog"
59435951
},
5952+
"TimelineDateHeader--date-in-last-6-months": {
5953+
"message": "ddd, MMM D",
5954+
"description": "Moment.js format for date headers in the message timeline, for dates <6 months old. See https://momentjs.com/docs/#/displaying/format/."
5955+
},
5956+
"TimelineDateHeader--date-older-than-6-months": {
5957+
"message": "MMM D, YYYY",
5958+
"description": "Moment.js format for date headers in the message timeline, for dates >=6 months old. See https://momentjs.com/docs/#/displaying/format/."
5959+
},
59445960
"MessageRequestWarning__learn-more": {
59455961
"message": "Learn more",
59465962
"description": "Shown on the message request warning. Clicking this button will open a dialog with more information"

stylesheets/_mixins.scss

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016-2021 Signal Messenger, LLC
1+
// Copyright 2016-2022 Signal Messenger, LLC
22
// SPDX-License-Identifier: AGPL-3.0-only
33

44
// Fonts
@@ -686,3 +686,15 @@
686686
font-weight: normal;
687687
}
688688
}
689+
690+
@mixin timeline-floating-header-node {
691+
@include rounded-corners;
692+
box-shadow: 0 1px 4px $color-black-alpha-20;
693+
694+
@include light-theme {
695+
background: $color-white;
696+
}
697+
@include dark-theme {
698+
background: $color-gray-80;
699+
}
700+
}

stylesheets/_modules.scss

+10-71
Original file line numberDiff line numberDiff line change
@@ -4902,25 +4902,19 @@ button.module-image__border-overlay:focus {
49024902
}
49034903

49044904
&__date {
4905+
@include font-caption;
49054906
display: inline-block;
49064907
flex-shrink: 0;
4908+
margin-left: 6px;
4909+
overflow-x: hidden;
4910+
text-overflow: ellipsis;
4911+
white-space: nowrap;
49074912

4908-
&__timestamp {
4909-
flex-shrink: 0;
4910-
margin-left: 6px;
4911-
4912-
@include font-caption;
4913-
4914-
overflow-x: hidden;
4915-
white-space: nowrap;
4916-
text-overflow: ellipsis;
4917-
4918-
@include light-theme {
4919-
color: $color-gray-60;
4920-
}
4921-
@include dark-theme {
4922-
color: $color-gray-25;
4923-
}
4913+
@include light-theme {
4914+
color: $color-gray-60;
4915+
}
4916+
@include dark-theme {
4917+
color: $color-gray-25;
49244918
}
49254919
}
49264920
}
@@ -5460,26 +5454,6 @@ button.module-image__border-overlay:focus {
54605454
cursor: col-resize;
54615455
}
54625456

5463-
// Module: Timeline Loading Row
5464-
5465-
.module-timeline-loading-row {
5466-
height: 48px;
5467-
padding: 12px;
5468-
5469-
display: flex;
5470-
flex-direction: columns;
5471-
justify-content: center;
5472-
align-items: center;
5473-
5474-
@include light-theme {
5475-
color: $color-gray-75;
5476-
}
5477-
5478-
@include dark-theme {
5479-
color: $color-gray-25;
5480-
}
5481-
}
5482-
54835457
// Module: Timeline
54845458

54855459
.module-timeline {
@@ -6885,41 +6859,6 @@ button.module-image__border-overlay:focus {
68856859
@include emoji-size(66px);
68866860
}
68876861

6888-
// Module: Countdown
6889-
6890-
.module-countdown {
6891-
display: block;
6892-
width: 24px;
6893-
height: 24px;
6894-
}
6895-
6896-
// Note: the colors here should match the module-spinner's on-background colors
6897-
.module-countdown__front-path {
6898-
fill-opacity: 0;
6899-
stroke-width: 2;
6900-
6901-
@include light-theme {
6902-
stroke: $color-gray-60;
6903-
}
6904-
6905-
@include dark-theme {
6906-
stroke: $color-gray-25;
6907-
}
6908-
}
6909-
6910-
.module-countdown__back-path {
6911-
fill-opacity: 0;
6912-
stroke-width: 2;
6913-
6914-
@include light-theme {
6915-
stroke: $color-gray-05;
6916-
}
6917-
6918-
@include dark-theme {
6919-
stroke: $color-gray-75;
6920-
}
6921-
}
6922-
69236862
// Module: CompositionInput
69246863
.module-composition-input {
69256864
&__quill {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2022 Signal Messenger, LLC
2+
// SPDX-License-Identifier: AGPL-3.0-only
3+
4+
.TimelineDateHeader {
5+
@include font-body-2;
6+
display: block;
7+
text-align: center;
8+
user-select: none;
9+
10+
@include light-theme {
11+
color: $color-gray-60;
12+
}
13+
@include dark-theme {
14+
color: $color-gray-05;
15+
}
16+
17+
&--inline {
18+
padding: 20px;
19+
}
20+
21+
&--floating {
22+
@include timeline-floating-header-node;
23+
padding: 5px 10px;
24+
}
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Copyright 2022 Signal Messenger, LLC
2+
// SPDX-License-Identifier: AGPL-3.0-only
3+
4+
.TimelineFloatingHeader {
5+
align-items: center;
6+
display: flex;
7+
flex-direction: column;
8+
left: 0;
9+
pointer-events: none;
10+
position: absolute;
11+
top: 10px;
12+
width: 100%;
13+
z-index: $z-index-above-base;
14+
15+
&--visible {
16+
opacity: 1;
17+
}
18+
19+
&--hidden {
20+
opacity: 0;
21+
transition: opacity 0.5s ease-out;
22+
}
23+
24+
&__spinner-container {
25+
@include timeline-floating-header-node;
26+
margin-top: 12px;
27+
padding: 6px;
28+
29+
&--visible {
30+
opacity: 1;
31+
}
32+
33+
&--hidden {
34+
opacity: 0;
35+
transition: opacity 0.1s ease-out 0.3s;
36+
}
37+
}
38+
}

stylesheets/manifest.scss

+3-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@
9898
@import './components/Slider.scss';
9999
@import './components/SystemMessage.scss';
100100
@import './components/Tabs.scss';
101-
@import './components/Toast.scss';
101+
@import './components/TimelineDateHeader.scss';
102+
@import './components/TimelineFloatingHeader.scss';
102103
@import './components/TimelineWarning.scss';
103104
@import './components/TimelineWarnings.scss';
105+
@import './components/Toast.scss';
104106
@import './components/WhatsNew.scss';

ts/RemoteConfig.ts

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export type ConfigKeyType =
1010
| 'desktop.announcementGroup'
1111
| 'desktop.clientExpiration'
1212
| 'desktop.disableGV1'
13+
| 'desktop.floatingDateHeaders.beta'
14+
| 'desktop.floatingDateHeaders.production'
1315
| 'desktop.groupCallOutboundRing'
1416
| 'desktop.groupCalling'
1517
| 'desktop.gv2'

ts/background.ts

+1
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,7 @@ export async function startApp(): Promise<void> {
949949
i18n: window.i18n,
950950
interactionMode: window.getInteractionMode(),
951951
theme,
952+
version: window.getVersion(),
952953
},
953954
};
954955

ts/components/Countdown.stories.tsx

-48
This file was deleted.

0 commit comments

Comments
 (0)