Skip to content

Commit 6a7df54

Browse files
authored
Merge pull request oxen-io#2459 from Bilb/feat-move-attachments-outside-messagebox
feat: move attachments outside of the message box
2 parents 67817c5 + f4c91d0 commit 6a7df54

26 files changed

+376
-630
lines changed

stylesheets/_conversation.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
margin: 4px 16px;
2828
padding: 4px;
2929

30-
border-radius: 15px;
30+
border-radius: var(--border-radius-message-box);
3131

3232
align-self: flex-start;
3333

stylesheets/_modules.scss

Lines changed: 29 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,17 @@
6262
flex-direction: row;
6363
align-items: center;
6464
padding: 10px;
65+
border-radius: var(--border-radius-message-box);
66+
67+
.module-message__container--outgoing & {
68+
color: var(--color-sent-message-text);
69+
background: var(--color-sent-message-background);
70+
}
71+
72+
.module-message__container--incoming & {
73+
color: var(--color-received-message-text);
74+
background: var(--color-received-message-background);
75+
}
6576
}
6677

6778
.module-message__generic-attachment__icon-container {
@@ -88,7 +99,7 @@
8899
}
89100

90101
.module-message__generic-attachment__icon__extension {
91-
font-size: 10px;
102+
font-size: 9px;
92103
line-height: 13px;
93104
letter-spacing: 0.1px;
94105
text-transform: uppercase;
@@ -115,7 +126,6 @@
115126
}
116127

117128
.module-message__generic-attachment__file-name {
118-
color: $color-gray-90;
119129
font-size: 14px;
120130
line-height: 18px;
121131
font-weight: 300;
@@ -127,14 +137,6 @@
127137
text-overflow: ellipsis;
128138
}
129139

130-
.module-message__generic-attachment__file-size,
131-
.module-message__generic-attachment__file-name--outgoing,
132-
.module-message__generic-attachment__file-size--incoming,
133-
.module-message__generic-attachment__file-size--outgoing,
134-
.module-message__generic-attachment__file-name--incoming {
135-
color: var(--color-text);
136-
}
137-
138140
.module-message__generic-attachment__file-size {
139141
font-size: var(--font-size-xs);
140142
line-height: 16px;
@@ -145,17 +147,26 @@
145147

146148
.module-message__link-preview {
147149
cursor: pointer;
148-
border-top-left-radius: $session_message-container-border-radius;
149-
border-top-right-radius: $session_message-container-border-radius;
150+
151+
display: flex;
152+
align-items: center;
153+
background: white;
154+
color: black;
155+
border-radius: var(--border-radius-message-box);
156+
margin: var(--padding-link-preview);
157+
158+
.module-image {
159+
margin: -1px;
160+
}
150161
}
151162

152163
.module-message__link-preview__content {
153-
padding: 8px;
154-
background-color: $color-white;
164+
padding: 0 0 var(--margins-xs) 0;
155165
display: flex;
156166
flex-direction: row;
157167
align-items: flex-start;
158-
border: 1px solid $color-black-015;
168+
flex-grow: 1;
169+
margin-left: var(--margins-sm);
159170
}
160171

161172
.module-message__link-preview__image_container {
@@ -203,12 +214,7 @@
203214
background-color: $color-gray-05;
204215
}
205216

206-
.module-message__link-preview__text--with-icon {
207-
margin-top: 5px;
208-
}
209-
210217
.module-message__link-preview__title {
211-
color: $color-gray-90;
212218
font-size: 16px;
213219
font-weight: 300;
214220
letter-spacing: 0.15px;
@@ -222,7 +228,6 @@
222228

223229
.module-message__link-preview__location {
224230
margin-top: 4px;
225-
color: $color-gray-60;
226231
font-size: 12px;
227232
height: 16px;
228233
letter-spacing: 0.4px;
@@ -787,20 +792,7 @@
787792
}
788793

789794
.module-image--soft-corners {
790-
border-radius: 4px;
791-
}
792-
793-
.module-image__border-overlay {
794-
position: absolute;
795-
top: 0;
796-
bottom: 0;
797-
z-index: 1;
798-
left: 0;
799-
right: 0;
800-
}
801-
802-
.module-image__border-overlay--dark {
803-
background-color: $color-black-02;
795+
border-radius: var(--border-radius-message-box);
804796
}
805797

806798
.module-image__loading-placeholder {
@@ -819,21 +811,6 @@
819811
}
820812
}
821813

822-
.module-image__bottom-overlay {
823-
height: 48px;
824-
background-image: linear-gradient(
825-
to bottom,
826-
rgba(0, 0, 0, 0),
827-
rgba(0, 0, 0, 0) 9%,
828-
rgba(0, 0, 0, 0.6)
829-
);
830-
position: absolute;
831-
bottom: 0;
832-
z-index: 1;
833-
left: 0;
834-
right: 0;
835-
}
836-
837814
.module-image__play-overlay__circle {
838815
position: absolute;
839816
top: 50%;
@@ -879,35 +856,12 @@
879856
position: absolute;
880857
top: 5px;
881858
right: 5px;
882-
width: 16px;
883-
height: 16px;
859+
width: 20px;
860+
height: 20px;
884861
z-index: 2;
885862
background-image: url('../images/x-shadow-16.svg');
886863
}
887864

888-
// Module: Image Grid
889-
890-
.module-image-grid {
891-
display: inline-flex;
892-
flex-direction: row;
893-
align-items: center;
894-
895-
margin: -1px;
896-
}
897-
898-
.module-image-grid__column {
899-
display: inline-flex;
900-
flex-direction: column;
901-
align-items: center;
902-
}
903-
904-
.module-image-grid__row {
905-
display: inline-flex;
906-
flex-direction: row;
907-
align-items: center;
908-
flex-grow: 1;
909-
}
910-
911865
// Module: Attachments
912866

913867
.module-attachments {

stylesheets/_quote.scss

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
&--outgoing {
2121
.module-quote__primary__author {
2222
color: var(--color-sent-message-text);
23+
2324
font-weight: bold;
2425

2526
.module-contact-name {
@@ -38,6 +39,7 @@
3839
&--incoming {
3940
.module-quote__primary__author {
4041
color: var(--color-received-message-text);
42+
4143
font-weight: bold;
4244
.module-contact-name {
4345
font-weight: bold;
@@ -86,10 +88,10 @@
8688
}
8789

8890
.module-quote-container {
89-
margin-bottom: 5px;
90-
margin-top: 10px;
91-
padding-left: 10px;
92-
padding-right: 5px;
91+
margin-bottom: var(--margins-xs);
92+
margin-top: var(--margins-xs);
93+
min-width: 300px; // just because even with the quoted content is small it doesn't look very good
94+
padding-right: var(--margins-xs);
9395
}
9496

9597
.module-quote--no-click {
@@ -279,26 +281,4 @@
279281
}
280282
}
281283

282-
$session-highlight-message-shadow: 0px 0px 10px 1px $session-color-green;
283-
284-
@keyframes remove-box-shadow {
285-
0% {
286-
box-shadow: none;
287-
}
288-
10% {
289-
box-shadow: $session-highlight-message-shadow;
290-
}
291-
75% {
292-
box-shadow: $session-highlight-message-shadow;
293-
}
294-
100% {
295-
box-shadow: none;
296-
}
297-
}
298284

299-
.flash-green-once {
300-
animation-name: remove-box-shadow;
301-
animation-timing-function: linear;
302-
animation-duration: 2s;
303-
box-shadow: $session-highlight-message-shadow;
304-
}

stylesheets/_session.scss

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,6 @@ textarea {
308308
margin-inline-start: auto;
309309
}
310310

311-
pre {
312-
backdrop-filter: brightness(0.8);
313-
padding: var(--margins-xs);
314-
}
315-
316311
.module-message__container {
317312
position: relative;
318313
display: inline-block;
@@ -325,17 +320,6 @@ pre {
325320
label {
326321
user-select: none;
327322
}
328-
.module-message__attachment-container {
329-
// Entirely to ensure that images are centered if they aren't full width of bubble
330-
text-align: center;
331-
position: relative;
332-
overflow: hidden;
333-
334-
border-top-left-radius: $session_message-container-border-radius;
335-
border-bottom-left-radius: $session_message-container-border-radius;
336-
border-top-right-radius: 5px;
337-
border-bottom-right-radius: 5px;
338-
}
339323

340324
.conversation-header {
341325
.module-avatar img {

stylesheets/_session_constants.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,6 @@ $session-modal-size-sm: 220px;
198198
$session-modal-size-md: 400px;
199199
$session-modal-size-lg: 650px;
200200

201-
$session_message-container-border-radius: 13px;
202-
203201
// Spacing
204202
$session-margin-xs: 5px;
205203
$session-margin-sm: 10px;

stylesheets/_session_conversation.scss

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,9 @@ $rhap_font-family: inherit !default;
443443
padding: 0px;
444444
background-color: transparent;
445445
box-shadow: none;
446+
background: var(--color-accent);
447+
padding: var(--padding-message-content);
448+
border-radius: var(--border-radius-message-box);
446449

447450
svg {
448451
transition: fill var(--default-duration);
@@ -473,15 +476,25 @@ $rhap_font-family: inherit !default;
473476
}
474477

475478
.rhap_volume-button {
476-
color: subtle(var(--color-text));
479+
.module-message__container--incoming & {
480+
color: var(--color-received-message-text);
481+
}
482+
.module-message__container--outgoing & {
483+
color: var(--color-sent-message-text);
484+
}
477485
}
478486

479487
.rhap_volume-container div[role='progressbar'] {
480488
display: none;
481489
}
482490

483491
.rhap_time {
484-
color: subtle(var(--color-text));
492+
.module-message__container--incoming & {
493+
color: var(--color-received-message-text);
494+
}
495+
.module-message__container--outgoing & {
496+
color: var(--color-sent-message-text);
497+
}
485498

486499
font-size: 12px;
487500
}
@@ -492,22 +505,25 @@ $rhap_font-family: inherit !default;
492505
z-index: 0;
493506
width: 100%;
494507
height: 5px;
495-
background-color: var(--color-text);
496-
508+
.module-message__container--incoming & {
509+
background-color: var(--color-received-message-text);
510+
}
511+
.module-message__container--outgoing & {
512+
background-color: var(--color-sent-message-text);
513+
}
497514
border-radius: 2px;
498515
}
499516

500517
.rhap_progress-filled {
501-
background-color: rgba(var(--color-accent), 0.6);
502-
518+
background-color: var(--color-text-subtle);
503519
padding-left: 5px;
504520
}
505521

506522
.rhap_download-progress {
507523
height: 100%;
508524
position: absolute;
509525
z-index: 1;
510-
background-color: subtle(var(--color-text));
526+
background-color: var(--color-text-subtle);
511527

512528
border-radius: 2px;
513529
}

0 commit comments

Comments
 (0)