Skip to content

Commit 657ce29

Browse files
Lee Seongjooclaude
andcommitted
Side-by-side 해설/비전 model pickers; group model list by provider
- Put the 해설 모델 and 비전 모델 selectors on one row (was two rows) and drop the caption; the vision "되돌리기" button sits inline when overridden. - Model dropdown is grouped into Ollama / Gemini sections, sorted by model name within each (item text is just the model name; the section header names the provider). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 94f5df7 commit 657ce29

2 files changed

Lines changed: 23 additions & 8 deletions

File tree

‎Sources/UI/CommentaryView.swift‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,13 @@ struct CommentaryView: View {
130130
Text("해설 생성 중…").font(.caption).foregroundStyle(.secondary)
131131
}
132132
Spacer()
133+
}
134+
HStack(spacing: 16) {
133135
LLMModelPicker(label: "해설 모델",
134136
provider: $app.explainProvider,
135137
geminiModel: $app.explainGeminiModel,
136138
ollamaModel: $app.explainOllamaModel,
137139
onChange: { app.saveSettings() })
138-
}
139-
HStack(spacing: 8) {
140140
LLMModelPicker(label: "비전 모델",
141141
provider: visionProviderBinding,
142142
geminiModel: visionGeminiBinding,
@@ -149,10 +149,6 @@ struct CommentaryView: View {
149149
.controlSize(.small)
150150
.help("비전 모델을 해설 모델로 되돌리기 (추종)")
151151
}
152-
Text(app.visionOverridden
153-
? "이미지→코드 추출용 (해설 모델과 별도 지정됨)"
154-
: "이미지→코드 추출용 (해설 모델 추종)")
155-
.font(.caption2).foregroundStyle(.secondary)
156152
Spacer()
157153
}
158154

‎Sources/UI/LLMModelPicker.swift‎

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,25 @@ struct LLMModelPicker: View {
1919
/// from an offline/unfetched provider still shows.
2020
private var options: [AppState.LLMChoice] {
2121
var m = app.connectedModels
22-
if !current.model.isEmpty && !m.contains(where: { $0.id == current.id }) { m.insert(current, at: 0) }
22+
if !current.model.isEmpty && !m.contains(where: { $0.id == current.id }) { m.append(current) }
2323
return m
2424
}
2525

26+
private struct Group: Identifiable {
27+
let provider: AppState.NormalizeProvider
28+
let models: [AppState.LLMChoice]
29+
var id: String { provider.rawValue }
30+
}
31+
/// Models grouped by provider (Ollama, then Gemini), sorted by name within each.
32+
private var grouped: [Group] {
33+
let providers: [AppState.NormalizeProvider] = [.ollama, .gemini]
34+
return providers.compactMap { prov -> Group? in
35+
let ms = options.filter { $0.provider == prov }
36+
.sorted { $0.model.lowercased() < $1.model.lowercased() }
37+
return ms.isEmpty ? nil : Group(provider: prov, models: ms)
38+
}
39+
}
40+
2641
var body: some View {
2742
HStack(spacing: 6) {
2843
Text(label).font(.caption).foregroundStyle(.secondary)
@@ -38,7 +53,11 @@ struct LLMModelPicker: View {
3853
onChange()
3954
}
4055
)) {
41-
ForEach(options) { Text($0.label).tag($0.id) }
56+
ForEach(grouped) { group in
57+
Section(group.provider == .gemini ? "Gemini" : "Ollama") {
58+
ForEach(group.models) { Text($0.model).tag($0.id) }
59+
}
60+
}
4261
}
4362
.labelsHidden().frame(maxWidth: 260)
4463
}

0 commit comments

Comments
 (0)