Archived
fix: share private chat files and harden native lifecycle
This commit is contained in:
1 parent
7dcd06c911
commit
ec510b938b
8 files changed
+83
-15
No files matched your search
@@ -211,7 +211,8 @@ struct ChatLibraryView: View {
|
||||
Picker("Kind", selection: $kind) { ForEach(["markdown", "text", "code"], id: \.self) { Text($0.capitalized).tag($0) } }
|
||||
TextEditor(text: $content).frame(minHeight: 220)
|
||||
if let artifact {
|
||||
ShareLink("Export text", item: content)
|
||||
let file = PrivateChatExport(data: Data(content.utf8), filename: "Hope-artifact-\(artifact.id).\(kind == "markdown" ? "md" : "txt")", type: .plainText)
|
||||
ShareLink("Export file", item: file, preview: SharePreview(file.filename))
|
||||
if artifact.revision > 1 { Menu("View earlier revision") { ForEach(1..<artifact.revision, id: \.self) { revision in Button("Revision \(revision)") { Task { if let value = await store.historical(artifact, revision: revision) { content = value.content ?? "" } } } } } }
|
||||
Text("Historical content uses the current title and kind. Saving creates a new revision.").font(.footnote)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user