Skip to content

Commit b8b9a41

Browse files
committed
Remove Recent Dictations section and strip trailing wake punctuation
1. Remove "Recent Dictations" from sidebar and welcome page — all sessions are already visible in the time-grouped history. 2. Fix stray "." appearing at start of dictation text. Voxtral outputs tokens incrementally, so "." from "Torch." can arrive after stripLeadingWakePhrase already ran. Add a 200ms settle delay then strip any leading punctuation/whitespace that leaked. Made-with: Cursor
1 parent 9f6354f commit b8b9a41

4 files changed

Lines changed: 9 additions & 47 deletions

File tree

voxtral_realtime/macos/VoxtralRealtime/Models/TranscriptStore.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ final class TranscriptStore {
4343
var isPaused: Bool { sessionState == .paused }
4444
var isLoading: Bool { sessionState == .loading }
4545
var isModelReady: Bool { modelState == .ready }
46-
var recentDictationSessions: [Session] {
47-
sessions.filter { $0.source == .dictation }.prefix(5).map { $0 }
48-
}
4946

5047
private let runner = RunnerBridge()
5148
private let preferences: Preferences
@@ -359,6 +356,12 @@ final class TranscriptStore {
359356
textPipeline.normalizeForWakePhrase(text)
360357
}
361358

359+
func stripLeadingPunctuation() {
360+
dictationText = dictationText.drop(while: {
361+
$0.isPunctuation || $0.isWhitespace || $0.isNewline
362+
}).description
363+
}
364+
362365
func stripLeadingWakePhrase(_ wakePhrase: String) {
363366
guard !dictationText.isEmpty, !wakePhrase.isEmpty else { return }
364367

voxtral_realtime/macos/VoxtralRealtime/Services/DictationManager.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ final class DictationManager {
357357
self.dictationStartedAt = .now
358358
self.state = .listening
359359
self.store.stripLeadingWakePhrase(self.preferences.wakePhrase)
360+
try? await Task.sleep(for: .milliseconds(200))
361+
self.store.stripLeadingPunctuation()
360362
self.store.wakeState = .active
361363
self.showPanel()
362364
self.startSilenceMonitor()

voxtral_realtime/macos/VoxtralRealtime/Views/SidebarView.swift

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,6 @@ struct SidebarView: View {
5353
}
5454
}
5555

56-
if !recentDictations.isEmpty {
57-
Section("Recent Dictations") {
58-
ForEach(recentDictations) { session in
59-
sessionRow(session)
60-
.tag(SidebarPage.session(session.id))
61-
.contextMenu { sessionContextMenu(session) }
62-
}
63-
}
64-
}
65-
6656
ForEach(historySections) { section in
6757
Section(section.title) {
6858
ForEach(section.sessions) { session in
@@ -115,15 +105,8 @@ struct SidebarView: View {
115105
visibleSessions.filter(\.pinned)
116106
}
117107

118-
private var recentDictations: [Session] {
119-
visibleSessions
120-
.filter { !$0.pinned && $0.source == .dictation }
121-
.prefix(5)
122-
.map { $0 }
123-
}
124-
125108
private var historySections: [SessionSection] {
126-
let hiddenIDs = Set(pinnedSessions.map(\.id) + recentDictations.map(\.id))
109+
let hiddenIDs = Set(pinnedSessions.map(\.id))
127110
let remainder = visibleSessions.filter { !hiddenIDs.contains($0.id) }
128111
let calendar = Calendar.current
129112
let grouped = Dictionary(grouping: remainder) { session -> String in

voxtral_realtime/macos/VoxtralRealtime/Views/WelcomeView.swift

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ struct WelcomeView: View {
4141
}
4242

4343
shortcutHints
44-
45-
if !store.recentDictationSessions.isEmpty {
46-
recentDictationsSection
47-
}
4844
}
4945
.padding(40)
5046
.frame(maxWidth: 560)
@@ -105,28 +101,6 @@ struct WelcomeView: View {
105101
.padding(.top, 8)
106102
}
107103

108-
private var recentDictationsSection: some View {
109-
VStack(alignment: .leading, spacing: 10) {
110-
Divider()
111-
Text("Recent Dictations")
112-
.font(.headline)
113-
ForEach(store.recentDictationSessions.prefix(3)) { session in
114-
VStack(alignment: .leading, spacing: 4) {
115-
Text(session.displayTitle)
116-
.font(.caption.weight(.semibold))
117-
.foregroundStyle(.secondary)
118-
Text(session.previewText.prefix(120).description)
119-
.font(.callout)
120-
.lineLimit(2)
121-
}
122-
.frame(maxWidth: .infinity, alignment: .leading)
123-
.padding(12)
124-
.background(.background.secondary, in: RoundedRectangle(cornerRadius: 12))
125-
}
126-
}
127-
.frame(maxWidth: .infinity, alignment: .leading)
128-
}
129-
130104
private func shortcutBadge(_ shortcut: String, label: String) -> some View {
131105
VStack(spacing: 4) {
132106
Text(shortcut)

0 commit comments

Comments
 (0)