Skip to content

Commit 1f452d4

Browse files
committed
Remove LazyVStack
1 parent cd3ff1d commit 1f452d4

2 files changed

Lines changed: 6 additions & 22 deletions

File tree

Core/Sources/SuggestionWidget/SuggestionPanelContent/CodeBlock.swift

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ struct CodeBlock: View {
1010
let firstLinePrecedingSpaceCount: Int
1111
let fontSize: Double
1212

13-
@AppStorage(\.disableLazyVStack) var disableLazyVStack
14-
1513
init(
1614
code: String,
1715
language: String,
@@ -39,21 +37,8 @@ struct CodeBlock: View {
3937
highlightedCode = result.code
4038
}
4139

42-
@ViewBuilder
43-
func vstack(@ViewBuilder content: () -> some View) -> some View {
44-
if disableLazyVStack {
45-
VStack(spacing: 2) {
46-
content()
47-
}
48-
} else {
49-
LazyVStack(spacing: 2) {
50-
content()
51-
}
52-
}
53-
}
54-
5540
var body: some View {
56-
vstack {
41+
VStack(spacing: 2) {
5742
ForEach(0..<highlightedCode.endIndex, id: \.self) { index in
5843
HStack(alignment: .firstTextBaseline, spacing: 4) {
5944
Text("\(index + startLineIndex + 1)")

Core/Sources/SuggestionWidget/SuggestionPanelContent/PromptToCodePanel.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ struct PromptToCodePanelContent: View {
114114
Color.red,
115115
in: RoundedRectangle(cornerRadius: 8, style: .continuous)
116116
)
117-
.scaleEffect(x: -1, y: -1, anchor: .center)
117+
.scaleEffect(x: 1, y: -1, anchor: .center)
118118
}
119119

120120
if !provider.description.isEmpty {
@@ -125,7 +125,7 @@ struct PromptToCodePanelContent: View {
125125
})
126126
.padding()
127127
.frame(maxWidth: .infinity)
128-
.scaleEffect(x: -1, y: -1, anchor: .center)
128+
.scaleEffect(x: 1, y: -1, anchor: .center)
129129
}
130130

131131
if provider.code.isEmpty {
@@ -138,7 +138,7 @@ struct PromptToCodePanelContent: View {
138138
.padding()
139139
.multilineTextAlignment(.center)
140140
.frame(maxWidth: .infinity)
141-
.scaleEffect(x: -1, y: -1, anchor: .center)
141+
.scaleEffect(x: 1, y: -1, anchor: .center)
142142
} else {
143143
CodeBlock(
144144
code: provider.code,
@@ -149,18 +149,17 @@ struct PromptToCodePanelContent: View {
149149
fontSize: fontSize
150150
)
151151
.frame(maxWidth: .infinity)
152-
.scaleEffect(x: -1, y: -1, anchor: .center)
152+
.scaleEffect(x: 1, y: -1, anchor: .center)
153153
}
154154

155155
if let name = provider.name {
156156
Text(name)
157157
.font(.footnote)
158158
.foregroundColor(.secondary)
159159
.padding(.top, 12)
160-
.scaleEffect(x: -1, y: -1, anchor: .center)
160+
.scaleEffect(x: 1, y: -1, anchor: .center)
161161
}
162162
}
163-
.scaleEffect(x: -1, y: 1, anchor: .center)
164163
}
165164
.scaleEffect(x: 1, y: -1, anchor: .center)
166165
}

0 commit comments

Comments
 (0)