Skip to content

Commit

Permalink
Resolve #1361
Browse files Browse the repository at this point in the history
  • Loading branch information
the-djmaze committed Dec 13, 2023
1 parent 1d652e0 commit dd46434
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 28 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,26 +140,26 @@ RainLoop 1.17 vs SnappyMail

|js/* |RainLoop |Snappy |
|--------------- |--------: |--------: |
|admin.js |2.170.153 | 80.467 |
|app.js |4.207.787 | 407.517 |
|admin.js |2.170.153 | 80.366 |
|app.js |4.207.787 | 407.909 |
|boot.js | 868.735 | 4.142 |
|libs.js | 658.812 | 192.287 |
|libs.js | 658.812 | 192.289 |
|sieve.js | 0 | 85.085 |
|polyfills.js | 334.608 | 0 |
|serviceworker.js | 0 | 285 |
|TOTAL |8.240.095 | 769.783 |
|TOTAL |8.240.095 | 770.076 |

|js/min/* |RainLoop |Snappy |RL gzip |SM gzip |RL brotli |SM brotli |
|--------------- |--------: |--------: |------: |------: |--------: |--------: |
|admin.min.js | 256.831 | 39.328 | 73.606 | 13.191 | 60.877 | 11.815 |
|app.min.js | 515.367 | 186.005 |139.456 | 63.143 |110.485 | 54.149 |
|admin.min.js | 256.831 | 39.283 | 73.606 | 13.181 | 60.877 | 11.803 |
|app.min.js | 515.367 | 186.036 |139.456 | 63.062 |110.485 | 54.135 |
|boot.min.js | 84.659 | 2.084 | 26.998 | 1.202 | 23.643 | 1.003 |
|libs.min.js | 584.772 | 93.758 |180.901 | 34.878 |155.182 | 31.291 |
|sieve.min.js | 0 | 41.316 | 0 | 10.364 | 0 | 9.352 |
|polyfills.min.js | 32.837 | 0 | 11.406 | 0 | 10.175 | 0 |
|TOTAL user |1.217.635 | 281.847 |358.761 | 99.223 |299.485 | 86.443 |
|TOTAL user+sieve |1.217.635 | 323.163 |358.761 |109.587 |299.485 | 95.795 |
|TOTAL admin | 959.099 | 135.170 |292.911 | 49.271 |249.877 | 44.109 |
|TOTAL user |1.217.635 | 281.878 |358.761 | 99.142 |299.485 | 86.429 |
|TOTAL user+sieve |1.217.635 | 323.194 |358.761 |109.506 |299.485 | 95.781 |
|TOTAL admin | 959.099 | 135.125 |292.911 | 49.261 |249.877 | 44.097 |

For a user it is around 69% smaller and faster than traditional RainLoop.

Expand Down Expand Up @@ -188,12 +188,12 @@ For a user it is around 69% smaller and faster than traditional RainLoop.

|css/* |RainLoop |Snappy |RL gzip |SM gzip |SM brotli |
|------------ |-------: |------: |------: |------: |--------: |
|app.css | 340.331 | 84.570 | 46.946 | 17.646 | 15.118 |
|app.min.css | 274.947 | 67.928 | 39.647 | 15.529 | 13.548 |
|app.css | 340.331 | 84.607 | 46.946 | 17.662 | 15.138 |
|app.min.css | 274.947 | 67.961 | 39.647 | 15.550 | 13.570 |
|boot.css | | 1.326 | | 664 | 545 |
|boot.min.css | | 1.071 | | 590 | 474 |
|admin.css | | 30.645 | | 7.024 | 6.117 |
|admin.min.css | | 24.746 | | 6.346 | 5.608 |
|admin.css | | 30.641 | | 7.028 | 6.111 |
|admin.min.css | | 24.742 | | 6.352 | 5.599 |

### PGP
RainLoop uses the old OpenPGP.js v2
Expand Down
16 changes: 13 additions & 3 deletions dev/Model/AttachmentCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,24 @@ export class AttachmentCollectionModel extends AbstractCollectionModel
* @returns {AttachmentCollectionModel}
*/
static reviveFromJson(items) {
return super.reviveFromJson(items, attachment => AttachmentModel.reviveFromJson(attachment));
/*
const attachments = super.reviveFromJson(items, attachment => AttachmentModel.reviveFromJson(attachment));
let collator = new Intl.Collator(undefined, {numeric: true, sensitivity: 'base'});
attachments.sort((a, b) => {
if (a.isInline()) {
if (!b.isInline()) {
return 1;
}
} else if (!b.isInline()) {
return -1;
}
return collator.compare(a.fileName, b.fileName);
});
/*
if (attachments) {
attachments.InlineCount = attachments.reduce((accumulator, a) => accumulator + (a.isInline ? 1 : 0), 0);
}
return attachments;
*/
return attachments;
}

/**
Expand Down
7 changes: 5 additions & 2 deletions dev/Styles/User/Attachments.less
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.attachmentList {
margin: 0;
}

.attachmentItem {

background-color: rgba(128, 128, 128, 0.1);
Expand All @@ -9,8 +13,7 @@
line-height: 20px;
margin: 5px;
min-height: 48px;
max-width: 200px;
min-width: 60px;
width: 16em;
overflow: hidden;
position: relative;

Expand Down
9 changes: 0 additions & 9 deletions dev/Styles/User/MessageView.less
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,6 @@
border-bottom: 1px solid var(--border-color, #bbb);
position: relative;

.attachmentList {
margin: 0;
/*
min-height: 4em;
max-height: 15vh;
overflow: auto;
*/
}

&:not(.selection-mode) {
.checkboxAttachment {
display: none;
Expand Down
8 changes: 7 additions & 1 deletion dev/View/User/MailBox/MessageView.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,13 @@ export class MailMessageView extends AbstractViewRight {

listAttachments: () => currentMessage()?.attachments()
.filter(item => SettingsUserStore.listInlineAttachments() || !item.isLinked()),
hasAttachments: () => this.listAttachments()?.length,
// hasAttachments: () => this.listAttachments()?.length,
hasAttachments: () => currentMessage()?.attachments()
.some(item => SettingsUserStore.listInlineAttachments() || !item.isLinked()),
// listInlines: () => currentMessage()?.attachments()
// .filter(item => item.isLinked()),
// hasInlines: () => currentMessage()?.attachments()
// .some(item => SettingsUserStore.listInlineAttachments() || !item.isLinked()),

canBeRepliedOrForwarded: () => !MessagelistUserStore.isDraftFolder() && this.messageVisible(),

Expand Down

0 comments on commit dd46434

Please sign in to comment.