Skip to content

Commit 41c95ff

Browse files
committed
Fix UI glitches created by Xcode 15
1 parent 087a6fb commit 41c95ff

10 files changed

Lines changed: 69 additions & 4 deletions

File tree

Core/Sources/ChatGPTChatTab/ChatPanel.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import AppKit
2-
import OpenAIService
32
import MarkdownUI
3+
import OpenAIService
44
import SharedUIComponents
55
import SwiftUI
66

@@ -68,6 +68,14 @@ struct ChatPanelMessages: View {
6868
Instruction()
6969

7070
Spacer()
71+
72+
}
73+
.modify { view in
74+
if #available(macOS 13.0, *) {
75+
view.listRowSeparator(.hidden).listSectionSeparator(.hidden)
76+
} else {
77+
view
78+
}
7179
}
7280
.scaleEffect(x: -1, y: 1, anchor: .center)
7381
}

Core/Sources/HostApp/AccountSettings/APIKeyManagement/APIKeyManagementView.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import ComposableArchitecture
2+
import SharedUIComponents
23
import SwiftUI
34

45
struct APIKeyManagementView: View {
@@ -49,6 +50,13 @@ struct APIKeyManagementView: View {
4950
.buttonStyle(.plain)
5051
}
5152
}
53+
.modify { view in
54+
if #available(macOS 13.0, *) {
55+
view.listRowSeparator(.hidden).listSectionSeparator(.hidden)
56+
} else {
57+
view
58+
}
59+
}
5260
}
5361
}
5462
.removeBackground()

Core/Sources/HostApp/AccountSettings/ChatModelManagement/ChatModelManagementView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ struct ChatModelManagementView: View {
1212
action: ChatModelManagement.Action.chatModelItem
1313
)) { store in
1414
ChatModelEditView(store: store)
15-
.frame(minWidth: 400)
15+
.frame(width: 800)
1616
}
1717
}
1818
}

Core/Sources/HostApp/AccountSettings/SharedModelManagement/AIModelManagementVIew.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import AIModel
22
import ComposableArchitecture
33
import PlusFeatureFlag
4+
import SharedUIComponents
45
import SwiftUI
56

67
protocol AIModelManagementAction {
@@ -54,7 +55,7 @@ struct AIModelManagementView<Management: AIModelManagement, Model: ManageableAIM
5455
.foregroundColor(.secondary)
5556

5657
let disabled = viewStore.state >= 2
57-
58+
5859
Button(disabled ? "Add More Model (Plus)" : "Add Model") {
5960
store.send(.createModel)
6061
}.disabled(disabled)
@@ -102,6 +103,13 @@ struct AIModelManagementView<Management: AIModelManagement, Model: ManageableAIM
102103
.onMove(perform: { indices, newOffset in
103104
viewStore.send(.moveModel(from: indices, to: newOffset))
104105
})
106+
.modify { view in
107+
if #available(macOS 13.0, *) {
108+
view.listRowSeparator(.hidden).listSectionSeparator(.hidden)
109+
} else {
110+
view
111+
}
112+
}
105113
}
106114
.removeBackground()
107115
.listStyle(.plain)

Core/Sources/HostApp/CustomCommandSettings/CustomCommandView.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import MarkdownUI
33
import PlusFeatureFlag
44
import Preferences
55
import SwiftUI
6+
import SharedUIComponents
67

78
extension List {
89
@ViewBuilder
@@ -56,6 +57,13 @@ struct CustomCommandView: View {
5657
.onMove(perform: { indices, newOffset in
5758
settings.customCommands.move(fromOffsets: indices, toOffset: newOffset)
5859
})
60+
.modify { view in
61+
if #available(macOS 13.0, *) {
62+
view.listRowSeparator(.hidden).listSectionSeparator(.hidden)
63+
} else {
64+
view
65+
}
66+
}
5967
}
6068
.removeBackground()
6169
.padding(.vertical, 4)

Core/Sources/HostApp/FeatureSettings/SuggestionFeatureDisabledLanguageListView.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import SuggestionModel
22
import SwiftUI
3+
import SharedUIComponents
34

45
struct SuggestionFeatureDisabledLanguageListView: View {
56
final class Settings: ObservableObject {
@@ -68,6 +69,13 @@ struct SuggestionFeatureDisabledLanguageListView: View {
6869
.buttonStyle(.plain)
6970
}
7071
}
72+
.modify { view in
73+
if #available(macOS 13.0, *) {
74+
view.listRowSeparator(.hidden).listSectionSeparator(.hidden)
75+
} else {
76+
view
77+
}
78+
}
7179
}
7280
.removeBackground()
7381
.overlay {

Core/Sources/HostApp/FeatureSettings/SuggestionFeatureEnabledProjectListView.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import SharedUIComponents
12
import SwiftUI
23

34
struct SuggestionFeatureEnabledProjectListView: View {
@@ -67,6 +68,13 @@ struct SuggestionFeatureEnabledProjectListView: View {
6768
.buttonStyle(.plain)
6869
}
6970
}
71+
.modify { view in
72+
if #available(macOS 13.0, *) {
73+
view.listRowSeparator(.hidden).listSectionSeparator(.hidden)
74+
} else {
75+
view
76+
}
77+
}
7078
}
7179
.removeBackground()
7280
.overlay {

Pro

Submodule Pro updated from f4d8042 to 326ddb7

Tool/Sources/SharedUIComponents/CustomScrollView.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ public struct CustomScrollView<Content: View>: View {
4343
.modifier(CustomScrollViewUpdateHeightModifier())
4444
}
4545
.listStyle(.plain)
46+
.modify { view in
47+
if #available(macOS 13.0, *) {
48+
view.listRowSeparator(.hidden).listSectionSeparator(.hidden)
49+
} else {
50+
view
51+
}
52+
}
4653
.frame(idealHeight: max(10, height))
4754
.onPreferenceChange(CustomScrollViewHeightPreferenceKey.self) { newHeight in
4855
Task { @MainActor in
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import SwiftUI
2+
3+
public extension View {
4+
@ViewBuilder func modify<Content: View>(@ViewBuilder transform: (Self) -> Content)
5+
-> some View
6+
{
7+
transform(self)
8+
}
9+
}
10+

0 commit comments

Comments
 (0)