Skip to content

Commit 54f3ea7

Browse files
authored
Remove scenario title's line limit (#71)
* Remove scenario title's line limit * Use minimumScaleFactor
1 parent 782364d commit 54f3ea7

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

Diff for: Sources/PlaybookUI/Internal/Views/GalleryThumbnail.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ private struct NameLabel: View {
7171
content: data.scenario.title.rawValue,
7272
range: data.highlightRange
7373
)
74-
.textStyle(font: .caption, lineLimit: 3)
74+
.textStyle(font: .caption)
75+
.minimumScaleFactor(0.1)
7576
.padding(.top, 4)
7677
.padding([.bottom, .horizontal], 8)
7778
.frame(maxWidth: .infinity)

Diff for: Tests/GalleryScenarios.swift

+9
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ enum GalleryScenarios: ScenarioProvider {
3333
Scenario("Detail", layout: .fill) { context in
3434
GalleryDetail(data: .stub())
3535
}
36+
37+
Scenario("Thumbnail with long title", layout: .compressed) { context in
38+
GalleryThumbnail(
39+
data: .stub(
40+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
41+
)
42+
)
43+
.environmentObject(ImageLoader())
44+
}
3645
}
3746
}
3847
}

Diff for: Tests/Mocks.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ extension SelectData {
2626
}
2727

2828
extension SearchedData {
29-
static func stub(_ index: Int) -> Self {
29+
static func stub(_ title: ScenarioTitle) -> Self {
3030
SearchedData(
3131
category: "Category",
32-
scenario: .stub("Scenario \(index)"),
32+
scenario: .stub(title),
3333
highlightRange: nil
3434
)
3535
}
3636
}
3737

3838
extension SearchedCategoryData {
3939
static func stub(
40-
scenarios: [SearchedData] = (0..<3).map { .stub($0) }
40+
scenarios: [SearchedData] = (0..<3).map { .stub("Scenario \($0)") }
4141
) -> Self {
4242
SearchedCategoryData(
4343
category: "Category",

0 commit comments

Comments
 (0)