onboarding: Suggest first post during onboarding

Testing of standard flow
------------------------

PASS

Device: iPhone 14 Pro simulator
iOS: 17.0
Damus: This commit
Steps:
1. Delete and reinstall Damus
2. Go through onboarding until suggested users appear
3. Click "continue". Should slide into the post view. PASS
4. Post view should look similar to the Figma design file, but with examples as placeholders. PASS
5. Examples should switch every 3 seconds. PASS
6. Typing a first character causes the #introductions hashtag to be automatically added. PASS
7. Uploading an image makes progress view show up and not break layout. PASS
8. Clicking on "post" should post this note and dismiss onboarding view. PASS

Testing of other flows
----------------------

PASS

Device: iPhone 14 Pro simulator
iOS: 17.0
Damus: This commit
Special remark: Made local change to always show the onboarding suggestions, and speed up testing
Coverage:

1. Clicking "skip" on suggested users view will skip into the post view. PASS
2. Clicking "cancel" on post view and then going to the normal post view reveals a blank draft. PASS
3. Clicking "cancel" dismisses onboarding view and does not post anything. PASS
4. Normal post view looks normal (not broken). PASS
5. Changing initial suggested post during onboarding, cancelling the post, and then re-entering normal post view reveals the draft with user modifications. PASS

Changelog-Added: Suggest first post during onboarding
Closes: https://github.com/damus-io/damus/issues/1338
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
Daniel D’Aquino
2023-10-20 18:15:58 +00:00
committed by William Casarin
parent 7c98489904
commit bf43842590
8 changed files with 236 additions and 122 deletions

View File

@@ -7,7 +7,7 @@
import Foundation
class DraftArtifacts {
class DraftArtifacts: Equatable {
var content: NSMutableAttributedString
var media: [UploadedMedia]
@@ -15,6 +15,13 @@ class DraftArtifacts {
self.content = content
self.media = media
}
static func == (lhs: DraftArtifacts, rhs: DraftArtifacts) -> Bool {
return (
lhs.media == rhs.media &&
lhs.content.string == rhs.content.string // Comparing the text content is not perfect but acceptable in this case because attributes for our post editor are determined purely from text content
)
}
}
class Drafts: ObservableObject {