commit 6f4941561951a1023db2685f0b68b2432ab25f00
parent 81627c97567c4485c1fb772bca6d0135eef5c53e
Author: Michael Camilleri <[email protected]>
Date: Fri, 17 Jul 2026 12:10:34 +0900
Preserve the diagnostics filename in messaging apps
Sharing the log to Signal dropped the suggested filename: a plain-text
item is classified as message text, so Signal loads the string and — the
log being far too large for a message body — packages it as an
oversize-text attachment under a name of its own. That path never
consults suggestedName.
This commit registers the promised data as generic .data instead.
Messaging apps then route the item through their document path, where
the file the system materialises keeps the suggested name. The '.txt' in
suggestedName still types the file at its destination.
Co-Authored-By: Claude Fable 5 <[email protected]>
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/Crossmate/Views/Settings/DiagnosticsView.swift b/Crossmate/Views/Settings/DiagnosticsView.swift
@@ -285,7 +285,13 @@ private enum DiagnosticsShareItem {
static func configuration(for dump: DiagnosticsDump) -> UIActivityItemsConfiguration {
let provider = NSItemProvider()
provider.suggestedName = fileName
- provider.registerDataRepresentation(for: .plainText, visibility: .all) { completion in
+ // Registered as generic data, not .plainText: messaging apps classify
+ // a plain-text item as message text — Signal loads it as a string and
+ // packages an oversize-text attachment under its own name, ignoring
+ // suggestedName. A generic-data item routes through their file path,
+ // where the materialised file keeps the suggested name. The .txt in
+ // suggestedName still types the file at its destination.
+ provider.registerDataRepresentation(for: .data, visibility: .all) { completion in
completion(Data(dump.rendered().utf8), nil)
return nil
}