Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Attachment title will be used to populate Draft Subject #1227

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

adrien-coye
Copy link
Contributor

*** conditions may apply, depends on type of underlying NSItemProvider.

@adrien-coye adrien-coye self-assigned this Jan 16, 2024
@adrien-coye adrien-coye requested a review from a team as a code owner January 16, 2024 15:49
Copy link

sonarcloud bot commented Jan 16, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud


if disposition == .inline,
Copy link
Contributor Author

@adrien-coye adrien-coye Jan 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was dead code, so removed it. I now return the title instead

@adrien-coye adrien-coye marked this pull request as draft January 16, 2024 15:58
@@ -38,27 +38,32 @@ extension NSItemProvider: Attachable {
return UTType(preferredIdentifier)
}

public func writeToTemporaryURL() async throws -> URL {
public func writeToTemporaryURL() async throws -> (url: URL, title: String?) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe a marginal improvement using a typealias for this (url: URL, title: String?)

@@ -88,6 +88,25 @@ public final class AttachmentsManagerWorker {
liveAttachments.map { $0.detached() }
}

var attachmentsTitles: [String?]? {
Copy link
Contributor Author

@adrien-coye adrien-coye Jan 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe some doc about the DB modified on side effect

@adrien-coye
Copy link
Contributor Author

I tested the feature on iPhone8 iOS16.7 all good. Removing draft status.

@adrien-coye adrien-coye marked this pull request as ready for review January 17, 2024 08:38
@PhilippeWeidmann
Copy link
Member

I think users were expecting something more like this:
https://stackoverflow.com/a/33139355/9066648
However this is requires a lot more code so I'm okay to first merge this.

@PhilippeWeidmann PhilippeWeidmann merged commit 6a71b1b into master Jan 18, 2024
6 checks passed
@PhilippeWeidmann PhilippeWeidmann deleted the prefillDraftObject branch January 18, 2024 13:02
@adrien-coye
Copy link
Contributor Author

I tried to match the behaviour of Android that does not just work for webpages, therefore I did what was to me the most pragmatic first step. The good thing is that what you are sharing can be added later @PhilippeWeidmann

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants