Skip to content

Commit 5f2b16f

Browse files
committed
learn more links and UI tidy up
1 parent b51e7f6 commit 5f2b16f

File tree

6 files changed

+30
-9
lines changed

6 files changed

+30
-9
lines changed

LlamaChat/ui/settings/tabs/sources/SourcesSettingsListView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct SourcesSettingsListView: View {
2727
}
2828
.frame(maxWidth: .infinity)
2929
Divider()
30-
.foregroundColor(Color(NSColor.separatorColor.cgColor))
30+
.foregroundColor(Color(nsColor: NSColor.separatorColor))
3131
}
3232
}
3333

LlamaChat/ui/sources/AddSourceContentView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ struct AddSourceContentView: View {
2929
}
3030
}
3131
}
32-
.frame(width: 600, height: 400)
32+
.frame(width: 620, height: 430)
3333
}
3434
}

LlamaChat/ui/sources/configure/components/ConfigureLocalModelSelectFormatView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct ConfigureLocalModelSelectFormatView: View {
1818
Section {
1919
Picker("Format", selection: sourceTypeBinding) {
2020
Text("Select Format")
21-
.foregroundColor(Color(NSColor.disabledControlTextColor.cgColor))
21+
.foregroundColor(Color(nsColor: NSColor.disabledControlTextColor))
2222
.tag(ConfigureLocalModelSourceType?(nil))
2323
ForEach(ConfigureLocalModelSourceType.allCases) { source in
2424
Text(source.label).tag(ConfigureLocalModelSourceType?(source))

LlamaChat/ui/sources/configure/components/ConfigureLocalModelSizePickerView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct ConfigureLocalModelSizePickerView: View {
4242
)
4343
Picker("Model Size", selection: modelTypeBinding) {
4444
Text(viewModel.label(for: .unknown))
45-
.foregroundColor(unknownModelSizeAppearance.isDisabled ? Color(NSColor.disabledControlTextColor.cgColor) : nil)
45+
.foregroundColor(unknownModelSizeAppearance.isDisabled ? Color(nsColor: NSColor.disabledControlTextColor) : nil)
4646
.tag(ModelSize.unknown)
4747
if !unknownModelSizeAppearance.isDisabled {
4848
Divider()

LlamaChat/ui/sources/type/SourceTypeSelectionView.swift

+17
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,23 @@ struct SourceTypeSelectionRow: View {
1919
Text(source.name)
2020
.fontWeight(.bold)
2121
Text(source.description)
22+
if let learnMoreLink = source.learnMoreLink {
23+
Text("Learn More")
24+
.font(.footnote)
25+
.foregroundColor(.blue)
26+
.underline()
27+
.onHover { isHovered in
28+
// TODO: Use cursor rects to make this more robust.
29+
if isHovered {
30+
NSCursor.pointingHand.set()
31+
} else {
32+
NSCursor.arrow.set()
33+
}
34+
}
35+
.onTapGesture {
36+
NSWorkspace.shared.open(learnMoreLink)
37+
}
38+
}
2239
}
2340
.padding()
2441
Spacer()

LlamaChat/viewmodel/sources/SelectSourceTypeViewModel.swift

+9-5
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ import Foundation
1010
class SelectSourceTypeViewModel: ObservableObject {
1111
typealias SelectSourceHandler = (ChatSourceType) -> Void
1212

13-
struct Source: Equatable {
13+
struct Source {
1414
let id: String
1515
let type: ChatSourceType
1616
let name: String
1717
let description: String
18+
let learnMoreLink: URL?
1819
}
1920

2021
@Published var sources: [Source]
@@ -32,22 +33,25 @@ class SelectSourceTypeViewModel: ObservableObject {
3233
return Source(
3334
id: type.rawValue,
3435
type: type,
35-
name: "Llama",
36-
description: "The OG Facebook LLaMA model"
36+
name: "LLaMA",
37+
description: "The original Facebook LLaMA Large Language Model",
38+
learnMoreLink: URL(string: "https://github.com/facebookresearch/llama")
3739
)
3840
case .alpaca:
3941
return Source(
4042
id: type.rawValue,
4143
type: type,
4244
name: "Alpaca",
43-
description: "Stanford's Alpaca model: a fine-tuned instruction-following LLaMA model"
45+
description: "Stanford's Alpaca model: a fine-tuned instruction-following LLaMA model",
46+
learnMoreLink: URL(string: "https://github.com/tatsu-lab/stanford_alpaca")
4447
)
4548
case .gpt4All:
4649
return Source(
4750
id: type.rawValue,
4851
type: type,
4952
name: "GPT4All",
50-
description: "Nomic AI's assistant-style LLM based on LLaMA"
53+
description: "Nomic AI's assistant-style LLM based on LLaMA",
54+
learnMoreLink: URL(string: "https://github.com/nomic-ai/gpt4all")
5155
)
5256
}
5357
}

0 commit comments

Comments
 (0)