fix(ui): space quotes in thread context
Sources/Oldsky/BlueskyService.swift+4−0
| @@ -301,6 +301,10 @@ struct MockBlueskyService: BlueskyService { | ||
Post(id: "post-2", author: authors[1], text: "A small reminder to take breaks and look away from the screen.", likeCount: 42, repostCount: 8, isLiked: false, isReposted: false, imageURLs: [], replyRootURI: "post-1", replyRootCID: "", replyParentURI: "post-1", replyParentCID: "", replyIDs: []), | ||
Post(id: "post-3", author: authors[2], text: "This is a quote post. Open the link to read the original.", likeCount: 7, repostCount: 1, isLiked: false, isReposted: false, imageURLs: [], quote: Post.Quote(postID: "post-2"), replyIDs: []) | ||
] | ||
if ProcessInfo.processInfo.arguments.contains("-ui-testing-context-quote") { | ||
posts[0].text = "A thread starts here with enough text to wrap across several lines. This text must stay above the quoted post." | ||
posts[0].quote = Post.Quote(postID: "post-3", author: authors[2], text: "The quoted post.") | ||
} | ||
if ProcessInfo.processInfo.arguments.contains("-ui-testing-facets") { | ||
let rootText = "Root context: @alex.example shared https://oldsky.app/post?uri=post-2 and https://example.com/reply." | ||
posts[0].text = rootText | ||
Sources/Oldsky/OldskyApp.swift+1−0
| @@ -1116,6 +1116,7 @@ struct ReplyContextPosts: View { | ||
openPost(quote.postID) | ||
} | ||
.padding(.leading, 12) | ||
.padding(.top, 8) | ||
} | ||
} | ||
.overlay(alignment: .leading) { | ||
Tests/OldskyUITests/OldskyUITests.swift+20−0
| @@ -300,6 +300,26 @@ final class OldskyUITests: XCTestCase { | ||
XCTAssertTrue(app.navigationBars["Post"].waitForExistence(timeout: 5)) | ||
} | ||
| ||
func testThreadContextQuoteFollowsText() { | ||
let app = XCUIApplication() | ||
app.launchArguments = ["-ui-testing", "-ui-testing-signed-in", "-ui-testing-context-quote"] | ||
app.launch() | ||
let context = app.descendants(matching: .any)["replyPostContext-post-1"].firstMatch | ||
for _ in 0..<5 { | ||
if context.exists && context.isHittable { break } | ||
app.swipeUp() | ||
} | ||
XCTAssertTrue(context.waitForExistence(timeout: 5)) | ||
let text = context.buttons["replyContext-post-1"] | ||
let quote = context.buttons["quotedPostLink"] | ||
XCTAssertTrue(text.exists) | ||
XCTAssertTrue(quote.exists) | ||
XCTAssertGreaterThanOrEqual(quote.frame.minY - text.frame.maxY, 15) | ||
quote.tap() | ||
XCTAssertTrue(app.navigationBars["Post"].waitForExistence(timeout: 5)) | ||
XCTAssertTrue(app.buttons["postText-post-3"].waitForExistence(timeout: 5)) | ||
} | ||
| ||
func testHideQuotedPostsSetting() { | ||
let app = XCUIApplication() | ||
app.launchArguments = ["-ui-testing"] | ||