Skip to content

Commit ed3cc1e

Browse files
jkuriclaude
andcommitted
feat(captions): replace model popover with segment picker and add sizes to descriptions
Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent 43cc373 commit ed3cc1e

2 files changed

Lines changed: 16 additions & 41 deletions

File tree

Reframed/Editor/PropertiesPanel+CaptionsTab.swift

Lines changed: 12 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -18,48 +18,27 @@ extension PropertiesPanel {
1818
VStack(alignment: .leading, spacing: Layout.itemSpacing) {
1919
SectionHeader(icon: "waveform", title: "Generate")
2020

21-
HStack(spacing: 8) {
21+
VStack(alignment: .leading, spacing: Layout.compactSpacing) {
2222
Text("Model")
2323
.font(.system(size: 12))
2424
.foregroundStyle(ReframedColors.secondaryText)
25-
.frame(width: captionLabelWidth, alignment: .leading)
26-
SelectButton(label: selectedModelLabel) { dismiss in
27-
VStack(spacing: 2) {
28-
ForEach(WhisperModel.allCases) { model in
29-
let downloaded = WhisperModelManager.shared.isDownloaded(model)
30-
Button {
31-
editorState.captionModel = model.rawValue
32-
dismiss()
33-
} label: {
34-
HStack {
35-
Text(model.label)
36-
.font(.system(size: 12))
37-
Spacer()
38-
if editorState.captionModel == model.rawValue {
39-
Image(systemName: "checkmark")
40-
.font(.system(size: 10, weight: .semibold))
41-
} else if !downloaded {
42-
Image(systemName: "arrow.down.circle")
43-
.font(.system(size: 10))
44-
.foregroundStyle(ReframedColors.dimLabel)
45-
}
46-
}
47-
.padding(.horizontal, 8)
48-
.padding(.vertical, 6)
49-
.contentShape(Rectangle())
50-
}
51-
.buttonStyle(.plain)
52-
}
53-
}
54-
.padding(4)
55-
.frame(width: 220)
56-
}
25+
SegmentPicker(
26+
items: WhisperModel.allCases,
27+
label: { $0.shortLabel },
28+
selection: Binding(
29+
get: { WhisperModel(rawValue: editorState.captionModel) ?? .base },
30+
set: { editorState.captionModel = $0.rawValue }
31+
)
32+
)
5733
}
5834

5935
if let model = WhisperModel(rawValue: editorState.captionModel) {
6036
Text(model.description)
6137
.font(.system(size: 11))
6238
.foregroundStyle(ReframedColors.dimLabel)
39+
.lineLimit(2)
40+
.fixedSize(horizontal: false, vertical: true)
41+
.frame(minHeight: 28, alignment: .top)
6342
}
6443

6544
HStack(spacing: 8) {
@@ -144,10 +123,6 @@ extension PropertiesPanel {
144123
}
145124
}
146125

147-
private var selectedModelLabel: String {
148-
WhisperModel(rawValue: editorState.captionModel)?.shortLabel ?? "Base"
149-
}
150-
151126
private var transcriptionStatusText: String {
152127
let pct = Int(editorState.transcriptionProgress * 100)
153128
if editorState.transcriptionProgress < 0.15 {

Reframed/Utilities/WhisperModelManager.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ enum WhisperModel: String, CaseIterable, Identifiable, Sendable {
2929

3030
var description: String {
3131
switch self {
32-
case .base: "Fast, lower accuracy. Good for clear English audio."
33-
case .small: "Balanced speed and accuracy. Good for most use cases."
34-
case .medium: "High accuracy, slower. Recommended for multilingual."
35-
case .large: "Best accuracy, slowest. Best for difficult audio."
32+
case .base: "~140 MB. Fast, lower accuracy. Good for clear English audio."
33+
case .small: "~460 MB. Balanced speed and accuracy. Good for most use cases."
34+
case .medium: "~1.5 GB. High accuracy, slower. Recommended for multilingual."
35+
case .large: "~3 GB. Best accuracy, slowest. Best for difficult audio."
3636
}
3737
}
3838
}

0 commit comments

Comments
 (0)