Skip to content

Commit 5d57f90

Browse files
committed
Fix the UI of reference list
1 parent 774216b commit 5d57f90

1 file changed

Lines changed: 13 additions & 16 deletions

File tree

Core/Sources/ChatGPTChatTab/Views/BotMessage.swift

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,13 @@ struct ReferenceList: View {
109109
}) {
110110
HStack(spacing: 8) {
111111
Text(reference.title)
112+
.truncationMode(.middle)
113+
.lineLimit(1)
112114
Text(reference.subtitle)
113-
.foregroundStyle(.secondary)
115+
.lineLimit(1)
116+
.truncationMode(.middle)
117+
.layoutPriority(/*@START_MENU_TOKEN@*/0/*@END_MENU_TOKEN@*/)
118+
.foregroundStyle(.tertiary)
114119
}
115120
.padding(.vertical, 6)
116121
.padding(.horizontal, 8)
@@ -124,8 +129,8 @@ struct ReferenceList: View {
124129
}
125130
}
126131
.padding()
127-
.frame(maxHeight: 500)
128132
}
133+
.frame(maxWidth: 500, maxHeight: 500)
129134
}
130135
}
131136

@@ -138,20 +143,12 @@ struct ReferenceList: View {
138143
func foo() {}
139144
```
140145
""",
141-
references: [
142-
.init(
143-
title: "ReferenceList",
144-
subtitle: "/Core/Sources/ChatGPTChatTab/Views/BotMessage.swift:100",
145-
uri: "https://google.com",
146-
startLine: nil
147-
),
148-
.init(
149-
title: "BotMessage.swift:100-102",
150-
subtitle: "/Core/Sources/ChatGPTChatTab/Views",
151-
uri: "https://google.com",
152-
startLine: nil
153-
),
154-
],
146+
references: .init(repeating: .init(
147+
title: "ReferenceList",
148+
subtitle: "/Core/Sources/ChatGPTChatTab/Views/BotMessage.swift:100",
149+
uri: "https://google.com",
150+
startLine: nil
151+
), count: 20),
155152
chat: .init(initialState: .init(), reducer: Chat(service: .init()))
156153
)
157154
.padding()

0 commit comments

Comments
 (0)