Сhange title of emails in sent folder#1087
Conversation
|
@sosnovsky please have a look as it may be related to what you're working on |
|
I tested app but it still doesn't show recipients on For example, I sent 3 different emails to 3 different recipients - app will show 3 messages with If I open Gmail app and go to I checked your discussion #1015 (comment) and it seems you decided to do it this way, but it's opposite to original task description. Comment from link above says that Gmail app shows @tomholub do updated |
|
@sosnovsky my bad. It should be done the same or similar like Gmail app, which means I was wrong in the linked discussion. Does it make sense to adjust in this PR, or does it make sense to redo this when doing #921 ? It's related. |
|
ok. I marked it as draft. @ekievsky please follow Gmail functionality here as Roma suggests, it sounds better than what we discussed earlier. |
|
I will update PR to your requirements @sosnovsky |
Thanks! |
3617562 to
9afd7a6
Compare
sosnovsky
left a comment
There was a problem hiding this comment.
Works well now, just some code comments
| self.wrappedType = .thread(thread) | ||
| } | ||
|
|
||
| @MainActor func hideErrorLabel() { |
| let identifier: Identifier | ||
| let date: Date | ||
| let sender: String? | ||
| let receiver: String? |
There was a problem hiding this comment.
For consistency it'll be better to rename receiver to recipient, as we already have recipient in other parts of the app
| emails.remove(at: i) | ||
| } | ||
| } | ||
| let receivers = emails |
|
|
||
| // for now its not exactly clear how titles on other folders should looks like | ||
| // so in scope of this PR we are applying this title presentation only for "sent" folder | ||
| if folderPath == sentPath { |
There was a problem hiding this comment.
I think we can use MessageLabelType.sent.value here instead of just string SENT, as we already have all message labels/folders stored in MessageLabelType.
| } | ||
| } | ||
| let receivers = emails | ||
| .compactMap { $0.components(separatedBy: "@").first ?? "" } |
There was a problem hiding this comment.
?? "" isn't needed here, as compactMap will automatically delete all nil values
There was a problem hiding this comment.
It's not only not needed, but actively harmful - now we have to also handle empty strings, instead of only nils which get filetered with compactMap.
| } else { | ||
| return thread.messages | ||
| .compactMap(\.sender) | ||
| .compactMap { $0.components(separatedBy: "@").first ?? "" } |
9afd7a6 to
d43ae16
Compare
|
@sosnovsky please re-review |
sosnovsky
left a comment
There was a problem hiding this comment.
Looks good for me now 👍
|
@ekievsky when you address a PR comment, please click "Resolve conversation" on each of the comments you believe you fixed. That way, it's easier to see at a glance what have you done so far and what is still left to do. Thanks! |
|
@ekievsky there's one failed test (at least) please try to run it locally and debug it |
This PR is about applying gmail style title for SENT tab.
if we need same logic for all folders I can apply it to other tabs as well.
close #1015
Tests (delete all except exactly one):
To be filled by reviewers
I have reviewed that this PR... (tick whichever items you personally focused on during this review):