Skip to content

知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.

feat: calmer records window with the bilingual transcript beside the notes

wqugurua0d411b798cf
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2294a40..4e802e1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,7 @@ the release workflow publishes it as the release notes.
## Unreleased
- Changed: the menu bar panel's display section is easier to read. 显示方式 is three tiles with a small picture each (实时纪要, 字幕条, 不显示), and under them one card holds only the chosen mode's settings: for the notes, whether the window is open with an 打开 / 收起 button (收起 hides it without opening the records window) and 共享屏幕时让对方看到 (formerly 录屏时显示纪要窗口); for the subtitle bar, when it appears and how long it waits; for 不显示, a line saying the transcript is still saved. The ⌃⌥S shortcut sits beside the title, and the 字幕 row above (原文 + 译文) is now called 内容 so 字幕 no longer means two things. The segmented choices left in system blue (the subtitle bar's timing in the panel and Settings, 显示方式 in Settings, 双语 / 原文 / 译文 in the records window) now use the app's own grey track with a white thumb, and the two subtitle bar choices in the panel line up at the same width.
+- Changed: the records window is calmer and puts the two languages up front. 开始听 is a round button at the top of the list instead of a small switch at the bottom; the meeting page fills the window instead of floating in a card; 导出 is outlined; the length, line count and languages are one grey line with a neutral 完整版纪要 tag (orange now only means recording). In a window wide enough, the notes have the bilingual transcript beside them, and a topic's time scrolls it there; meetings still on the default title show as 未命名会议. The window opens a little larger.
- New: turning on 同声传译 switches the Mac's system microphone to BlackHole 2ch and switches it back when 同声传译 is turned off or Cicada quits, so a meeting page in Chrome (or any app left on the default microphone) hears the translation with no setup. Cicada itself keeps recording from your real microphone (Settings › 同声传译 › 系统麦克风 lets you pin one). If Cicada didn't get to switch back (it crashed), or AirPods or something else took over the system mic while you were speaking, the menu bar panel says so with a 还原 / 换回 button; the panel's ⋯ menu also has 同声传译设置…, 试一句 and 还原系统麦克风. The switch can be turned off in Settings.
- Changed: the installer window explains the first-open warning. While the developer certificate is pending, macOS says Apple can't verify Cicada; the window, now a little taller, says this is expected and shows the three screens to click through in miniature, each with the button ringed: 完成 (not 移到废纸篓), 隐私与安全性 in System Settings, then 仍要打开 under 安全性.
- New: 共享屏幕时让对方看到 lets screen recordings capture the live notes window, for demos and tutorials. It is off by default; turn it on in Settings › 显示, the menu bar panel, or 显示 › 共享屏幕时对方可见 in the app menu. macOS has one switch for recording and screen sharing, so while it is on people also see the notes when you share your screen: the notes window shows a breathing record mark next to its status the whole time, and clicking it turns the setting off. In a narrow English window, the title and the status line no longer break onto two lines.
diff --git a/Sources/LiveSubs/AppModel.swift b/Sources/LiveSubs/AppModel.swift
index 4863535..b4586f3 100644
--- a/Sources/LiveSubs/AppModel.swift
+++ b/Sources/LiveSubs/AppModel.swift
@@ -1239,7 +1239,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate {
func showMainWindow() {
popover.performClose(nil)
if mainWindow == nil {
- let w = NSWindow(contentRect: NSRect(x: 0, y: 0, width: 1040, height: 700),
+ let w = NSWindow(contentRect: NSRect(x: 0, y: 0, width: 1220, height: 740),
styleMask: [.titled, .closable, .miniaturizable, .resizable, .fullSizeContentView],
backing: .buffered, defer: false)
w.title = appDisplayName
diff --git a/Sources/LiveSubs/AudioRouter.swift b/Sources/LiveSubs/AudioRouter.swift
index adb6f76..700f668 100644
--- a/Sources/LiveSubs/AudioRouter.swift
+++ b/Sources/LiveSubs/AudioRouter.swift
@@ -68,6 +68,15 @@ final class AudioRouter: @unchecked Sendable {
/// Below this RMS the block counts as silence (≈ -40 dBFS).
private let voiceThreshold: Float = 0.01
+ /// Loudest buffer since the last `takeLevel()`, for the level meter.
+ private var peak: Float = 0
+ func takeLevel() -> Float {
+ queue.sync {
+ defer { peak = 0 }
+ return peak
+ }
+ }
+
func push(_ mono: AVAudioPCMBuffer) {
queue.async { [self] in process(mono) }
}
@@ -78,6 +87,7 @@ final class AudioRouter: @unchecked Sendable {
var sum: Float = 0
for i in 0..<n { sum += data[0][i] * data[0][i] }
let rms = (sum / Float(n)).squareRoot()
+ peak = max(peak, rms)
let seconds = Double(n) / mono.format.sampleRate
let voiced = rms >= voiceThreshold
if voiced {
diff --git a/Sources/LiveSubs/ListenPill.swift b/Sources/LiveSubs/ListenPill.swift
new file mode 100644
index 0000000..4b296c8
--- /dev/null
+++ b/Sources/LiveSubs/ListenPill.swift
@@ -0,0 +1,144 @@
+import SwiftUI
+
+/// The main window's title-bar control: a white "开始听" pill while idle, an ink pill that breathes,
+/// shows the sound level and the time while listening, and counts down when the meeting is about to end.
+struct ListenPill: View {
+ @ObservedObject var model: AppModel
+ @ObservedObject var store: SessionStore
+
+ var body: some View {
+ Group {
+ if model.running, let p = model.ending {
+ ending(p)
+ } else if model.running {
+ listening
+ } else {
+ idle
+ }
+ }
+ .animation(.spring(duration: 0.35), value: model.running)
+ .animation(.spring(duration: 0.35), value: model.ending)
+ }
+
+ private var idle: some View {
+ Button { model.setRunning(true) } label: {
+ HStack(spacing: 9) {
+ ZStack {
+ Circle().strokeBorder(Palette.accent, lineWidth: 1.5).frame(width: 18, height: 18)
+ Circle().fill(Palette.accent).frame(width: 8, height: 8)
+ }
+ Text(model.autoEnded ? L("会议已自动结束") : L("开始听"))
+ .font(.system(size: 13, weight: .semibold)).foregroundStyle(Palette.ink)
+ Text("⌘R").font(.system(size: 11, weight: .medium)).foregroundStyle(Palette.secondary)
+ .padding(.horizontal, 5).padding(.vertical, 1)
+ .overlay(RoundedRectangle(cornerRadius: 5).stroke(Palette.line, lineWidth: 1))
+ }
+ .padding(.leading, 10).padding(.trailing, 14).frame(height: 34)
+ .background(Capsule().fill(Color.white).shadow(color: Palette.ink.opacity(0.06), radius: 1, y: 1))
+ .overlay(Capsule().stroke(Color(red: 0.85, green: 0.863, blue: 0.882), lineWidth: 1))
+ .contentShape(Capsule())
+ }
+ .buttonStyle(.plain)
+ .accessibilityLabel(L("开始听"))
+ }
+
+ private var listening: some View {
+ HStack(spacing: 11) {
+ BreathingDot(size: 8)
+ Text("正在听").font(.system(size: 13, weight: .semibold))
+ LevelMeter(model: model, bars: 9, height: 16, color: Palette.accent)
+ if let start = store.session(store.liveID)?.startedAt {
+ TimelineView(.periodic(from: .now, by: 1)) { ctx in
+ Text(TranscriptExport.clock(max(0, ctx.date.timeIntervalSince(start))))
+ .font(.system(size: 13).monospacedDigit())
+ }
+ }
+ Text(model.summary).font(.system(size: 12)).foregroundStyle(Color(white: 0.79))
+ .lineLimit(1).frame(maxWidth: 240, alignment: .leading).fixedSize(horizontal: false, vertical: true)
+ Button { model.requestStop() } label: {
+ Text("结束").font(.system(size: 12, weight: .semibold))
+ .padding(.horizontal, 12).frame(height: 26)
+ .background(Capsule().fill(Color(red: 0.184, green: 0.196, blue: 0.227)))
+ .contentShape(Capsule())
+ }
+ .buttonStyle(.plain)
+ .accessibilityLabel(L("结束会议"))
+ }
+ .foregroundStyle(.white)
+ .padding(.leading, 16).padding(.trailing, 4).frame(height: 34)
+ .background(Capsule().fill(Palette.ink).shadow(color: Palette.ink.opacity(0.2), radius: 8, y: 4))
+ }
+
+ private func ending(_ p: MeetingEndWatch.Pending) -> some View {
+ HStack(spacing: 11) {
+ Text(model.endingTitle(p)).font(.system(size: 13, weight: .semibold)).lineLimit(1)
+ TimelineView(.periodic(from: .now, by: 1)) { ctx in
+ Text(L("\(max(0, Int(p.deadline.timeIntervalSince(ctx.date).rounded()))) 秒后结束"))
+ .font(.system(size: 13).monospacedDigit())
+ .foregroundStyle(Color(red: 0.957, green: 0.647, blue: 0.549))
+ }
+ Button { model.keepRecording() } label: {
+ Text("继续记录").font(.system(size: 12, weight: .semibold)).foregroundStyle(Palette.ink)
+ .padding(.horizontal, 12).frame(height: 26)
+ .background(Capsule().fill(Color.white))
+ .contentShape(Capsule())
+ }
+ .buttonStyle(.plain)
+ }
+ .foregroundStyle(.white)
+ .padding(.leading, 16).padding(.trailing, 4).frame(height: 34)
+ .background(Capsule().fill(Palette.ink).shadow(color: Palette.ink.opacity(0.2), radius: 8, y: 4))
+ }
+}
+
+/// An accent dot with a ring that keeps swelling out of it: "live", without blinking.
+struct BreathingDot: View {
+ var size: CGFloat = 8
+ @State private var out = false
+ @Environment(\.accessibilityReduceMotion) private var reduceMotion
+
+ var body: some View {
+ Circle().fill(Palette.accent).frame(width: size, height: size)
+ .background {
+ if !reduceMotion {
+ Circle().fill(Palette.accent)
+ .scaleEffect(out ? 2.6 : 1).opacity(out ? 0 : 0.6)
+ }
+ }
+ .onAppear {
+ guard !reduceMotion else { return }
+ withAnimation(.easeOut(duration: 2).repeatForever(autoreverses: false)) { out = true }
+ }
+ .accessibilityHidden(true)
+ }
+}
+
+/// Bars that follow the loudness of what Cicada hears, newest on the right.
+struct LevelMeter: View {
+ @ObservedObject var model: AppModel
+ var bars = 9
+ var height: CGFloat = 16
+ var color: Color = Palette.accent
+ @State private var levels: [CGFloat] = []
+ private let tick = Timer.publish(every: 0.08, on: .main, in: .common).autoconnect()
+
+ var body: some View {
+ HStack(spacing: 2) {
+ ForEach(0..<bars, id: \.self) { i in
+ let v = i < levels.count ? levels[i] : 0
+ Capsule().fill(color).frame(width: 2.5, height: max(3, v * height))
+ }
+ }
+ .frame(height: height)
+ .animation(.easeOut(duration: 0.08), value: levels)
+ .onReceive(tick) { _ in
+ guard model.running else { return }
+ // Map −40…0 dBFS onto the bar height: quiet speech sits low, a loud voice near the top.
+ let rms = model.listen.router.takeLevel()
+ let db = 20 * log10(max(Double(rms), 1e-6))
+ let v = CGFloat(min(1, max(0, (db + 40) / 40)))
+ levels = Array((levels + [v]).suffix(bars))
+ }
+ .accessibilityHidden(true)
+ }
+}
diff --git a/Sources/LiveSubs/Views.swift b/Sources/LiveSubs/Views.swift
index 56606bf..6485f22 100644
--- a/Sources/LiveSubs/Views.swift
+++ b/Sources/LiveSubs/Views.swift
@@ -452,8 +452,14 @@ struct MainWindowView: View {
@State private var titleDraft = ""
@State private var tab = "notes"
@State private var jumpTo: Double?
+ /// A topic's time picked in the notes, for the bilingual column beside them.
+ @State private var quoteJump: Double?
+ @State private var detailWidth: CGFloat = 0
@FocusState private var searchFocused: Bool
+ /// Wide enough for the notes and the bilingual transcript side by side.
+ private var sideBySide: Bool { detailWidth >= 940 }
+
private var filtered: [Session] {
guard !query.isEmpty else { return store.sessions }
return store.sessions.filter { s in
@@ -465,14 +471,19 @@ struct MainWindowView: View {
private var current: Session? { store.session(selection ?? store.sessions.first?.id) }
var body: some View {
- HStack(spacing: 0) {
- sidebar
- .frame(width: 264)
- detail
- .frame(maxWidth: .infinity, maxHeight: .infinity)
- .background(RoundedRectangle(cornerRadius: 14).fill(Color.white))
- .overlay(RoundedRectangle(cornerRadius: 14).stroke(Palette.line, lineWidth: 1))
- .padding(.trailing, 10).padding(.vertical, 10)
+ VStack(spacing: 0) {
+ titleBar
+ HStack(spacing: 0) {
+ sidebar
+ .frame(width: 264)
+ detail
+ .frame(maxWidth: .infinity, maxHeight: .infinity)
+ .background(RoundedRectangle(cornerRadius: 14).fill(Color.white))
+ .overlay(RoundedRectangle(cornerRadius: 14).stroke(Palette.line, lineWidth: 1))
+ .clipShape(RoundedRectangle(cornerRadius: 14))
+ .onGeometryChange(for: CGFloat.self) { $0.size.width } action: { detailWidth = $0 }
+ .padding(.trailing, 12).padding(.bottom, 12)
+ }
}
.background(Palette.ground)
.background(Button("") { searchFocused = true }.keyboardShortcut("f").opacity(0))
@@ -484,29 +495,45 @@ struct MainWindowView: View {
}
}
+ /// The listening state lives in the title bar, centred where the eye lands, beside the window buttons.
+ private var titleBar: some View {
+ HStack {
+ Spacer(minLength: 84)
+ ListenPill(model: model, store: store)
+ Spacer(minLength: 12)
+ }
+ .overlay(alignment: .trailing) {
+ Button { model.openSettings() } label: {
+ Image(systemName: "slider.horizontal.3").font(.system(size: 14)).frame(width: 32, height: 32).contentShape(Rectangle())
+ }
+ .buttonStyle(.plain).foregroundStyle(Palette.secondary).help("设置").padding(.trailing, 12)
+ }
+ .frame(height: 52)
+ }
+
// MARK: Sidebar
private var sidebar: some View {
- VStack(alignment: .leading, spacing: 14) {
+ VStack(alignment: .leading, spacing: 12) {
+ // Greys on the grey ground are `secondary`: `tertiary` falls under 4.5:1 there.
HStack(spacing: 8) {
- Image(systemName: "magnifyingglass").foregroundStyle(Palette.tertiary)
+ Image(systemName: "magnifyingglass").foregroundStyle(Palette.secondary)
TextField("搜索标题和原话", text: $query).textFieldStyle(.plain).focused($searchFocused)
if query.isEmpty {
- Text("⌘F").font(.system(size: 11)).foregroundStyle(Palette.tertiary)
+ Text("⌘F").font(.system(size: 11)).foregroundStyle(Palette.secondary)
} else {
Button { query = "" } label: { Image(systemName: "xmark.circle.fill") }
- .buttonStyle(.plain).foregroundStyle(Palette.tertiary).help("清除")
+ .buttonStyle(.plain).foregroundStyle(Palette.secondary).help("清除")
}
}
.font(.system(size: 13))
- .padding(.horizontal, 10).frame(height: 34)
- .background(RoundedRectangle(cornerRadius: 10).fill(Color(red: 0.914, green: 0.922, blue: 0.937)))
- .padding(.top, 40)
+ .padding(.horizontal, 10).frame(height: 32)
+ .background(RoundedRectangle(cornerRadius: 9).fill(Color(red: 0.914, green: 0.922, blue: 0.937)))
ScrollView {
LazyVStack(alignment: .leading, spacing: 2) {
ForEach(groups, id: \.title) { g in
- Text(g.title).font(.system(size: 11, weight: .semibold)).foregroundStyle(Palette.tertiary)
+ Text(g.title).font(.system(size: 11, weight: .semibold)).foregroundStyle(Palette.secondary)
.padding(.horizontal, 10).padding(.top, g.title == groups.first?.title ? 0 : 12).padding(.bottom, 4)
ForEach(g.sessions) { sessionRow($0) }
}
@@ -521,8 +548,6 @@ struct MainWindowView: View {
}
}
.scrollIndicators(.never)
-
- statusCard
}
.padding(.leading, 14).padding(.trailing, 12).padding(.bottom, 14)
}
@@ -553,8 +578,14 @@ struct MainWindowView: View {
} label: {
VStack(alignment: .leading, spacing: 3) {
HStack(spacing: 7) {
- if live { Circle().fill(Palette.accent).frame(width: 7, height: 7) }
- Text(s.displayTitle).font(.system(size: 13, weight: .semibold)).foregroundStyle(Palette.ink).lineLimit(1)
+ if live { BreathingDot(size: 7) }
+ // The default title repeats the time on the line below; say "untitled" instead.
+ if Self.untitled(s) {
+ Text("未命名会议").font(.system(size: 13, weight: .medium)).foregroundStyle(Palette.secondary)
+ } else {
+ Text(s.displayTitle).font(.system(size: 13, weight: selected ? .semibold : .medium))
+ .foregroundStyle(Palette.ink).lineLimit(1)
+ }
}
Text(meta(s, live: live)).font(.system(size: 11))
.foregroundStyle(live ? Palette.accentInk : Palette.secondary).lineLimit(1)
@@ -585,6 +616,11 @@ struct MainWindowView: View {
return [when, Self.length(s), Self.pair(s, short: true)].compactMap { $0 }.joined(separator: " · ")
}
+ /// Still on the stored "会议 <date>" title: not renamed, and no notes title to show.
+ static func untitled(_ s: Session) -> Bool {
+ !(s.renamed ?? !s.title.hasPrefix("会议 ")) && (s.notes?.title ?? "").isEmpty
+ }
+
static func length(_ s: Session) -> String {
let mins = Int(s.duration / 60)
if mins < 1 { return L("不到 1 分钟") }
@@ -612,28 +648,6 @@ struct MainWindowView: View {
return base == "zh" ? (code.contains("Hant") || code.hasSuffix("TW") || code.hasSuffix("HK") ? "zh-TW" : "zh-CN") : base
}
- /// What is listening right now, with the switch and settings at hand.
- private var statusCard: some View {
- HStack(spacing: 10) {
- LogoTile(size: 28).opacity(model.running ? 1 : 0.5)
- VStack(alignment: .leading, spacing: 1) {
- Text(model.running ? L("正在听") : L("已暂停")).font(.system(size: 12, weight: .semibold)).foregroundStyle(Palette.ink)
- Text(model.running ? model.summary : L("打开开关开始听")).font(.system(size: 11)).foregroundStyle(Palette.secondary)
- .lineLimit(1)
- }
- Spacer(minLength: 4)
- Toggle("字幕", isOn: Binding(get: { model.running }, set: { model.setRunning($0) }))
- .toggleStyle(.switch).labelsHidden().controlSize(.mini).tint(Palette.ink)
- Button { model.openSettings() } label: {
- Image(systemName: "slider.horizontal.3").font(.system(size: 13)).frame(width: 28, height: 28).contentShape(Rectangle())
- }
- .buttonStyle(.plain).foregroundStyle(Palette.secondary).help("设置")
- }
- .padding(.horizontal, 10).padding(.vertical, 9)
- .background(RoundedRectangle(cornerRadius: 12).fill(Color.white))
- .overlay(RoundedRectangle(cornerRadius: 12).stroke(Palette.line, lineWidth: 1))
- }
-
// MARK: Detail
@ViewBuilder
@@ -652,14 +666,21 @@ struct MainWindowView: View {
.font(.system(size: 13)).foregroundStyle(Palette.secondary)
}
} else if tab == "notes" {
- SessionNotesView(model: model, engine: model.notes, ling: model.ling, session: s,
- header: AnyView(header(s))) { t in
- jumpTo = t
- tab = "transcript"
+ HStack(spacing: 0) {
+ SessionNotesView(model: model, engine: model.notes, ling: model.ling, session: s,
+ header: AnyView(header(s))) { t in
+ // Beside the notes, a topic's time scrolls the column; otherwise it opens the transcript.
+ if sideBySide { quoteJump = t } else { jumpTo = t; tab = "transcript" }
+ }
+ if sideBySide {
+ Rectangle().fill(Palette.line).frame(width: 1)
+ quotes(s).frame(width: 340)
+ }
}
} else {
transcript(s)
}
+ if s.id == store.liveID { liveNow }
}
.onChange(of: s.id) { _, _ in titleDraft = "" }
} else {
@@ -673,18 +694,45 @@ struct MainWindowView: View {
}
}
+ /// 此刻: the sentence being heard, pinned under the page while the meeting is live.
+ @ViewBuilder private var liveNow: some View {
+ let src = model.liveSource.trimmingCharacters(in: .whitespacesAndNewlines)
+ if !src.isEmpty {
+ HStack(alignment: .top, spacing: 14) {
+ HStack(spacing: 6) {
+ BreathingDot(size: 6)
+ Text("此刻").font(.system(size: 11, weight: .bold)).foregroundStyle(Palette.accentInk)
+ }
+ .frame(width: 52, alignment: .leading).padding(.top, 2)
+ VStack(alignment: .leading, spacing: 3) {
+ Text(src).font(.system(size: 13)).foregroundStyle(Palette.secondary)
+ .lineLimit(2).truncationMode(.head)
+ if !model.liveTranslation.isEmpty {
+ Text(model.liveTranslation).font(.system(size: 15)).foregroundStyle(Palette.ink)
+ .lineLimit(2).truncationMode(.head)
+ }
+ }
+ Spacer(minLength: 0)
+ }
+ .padding(.horizontal, 24).padding(.vertical, 12)
+ .frame(maxWidth: .infinity, alignment: .leading)
+ .background(Palette.accentWash)
+ .overlay(alignment: .top) { Rectangle().fill(Palette.accentPale).frame(height: 1) }
+ }
+ }
+
private func toolbar(_ s: Session) -> some View {
HStack(spacing: 4) {
- tabButton(L("纪要"), id: "notes")
- tabButton(L("文字记录"), id: "transcript", count: s.lines.count)
+ HStack(spacing: 2) {
+ tabButton(L("纪要"), id: "notes")
+ tabButton(L("文字记录"), id: "transcript", count: s.lines.count)
+ }
+ .padding(3)
+ .background(RoundedRectangle(cornerRadius: 9).fill(Palette.fill))
Spacer()
if tab == "transcript" {
- Picker("显示", selection: $view) {
- Text("双语").tag("both")
- Text("原文").tag("src")
- Text("译文").tag("dst")
- }
- .pickerStyle(.segmented).labelsHidden().frame(width: 150).padding(.trailing, 6)
+ Segments(options: [("both", L("双语")), ("src", L("原文")), ("dst", L("译文"))], value: view) { view = $0 }
+ .padding(.trailing, 6)
}
Button { NSWorkspace.shared.activateFileViewerSelecting([store.folder(s.id)]) } label: {
Image(systemName: "folder").font(.system(size: 14)).frame(width: 32, height: 32).contentShape(Rectangle())
@@ -697,13 +745,15 @@ struct MainWindowView: View {
Button("导出 Word…") { model.export(s, kind: "word") }
Button("导出字幕 SRT…") { model.export(s, kind: "srt") }
} label: {
+ // Outlined, not filled: exporting is a side task, not the page's main action.
HStack(spacing: 6) {
- Text("导出").font(.system(size: 13, weight: .semibold))
+ Text("导出").font(.system(size: 13, weight: .medium))
Image(systemName: "chevron.down").font(.system(size: 9, weight: .bold))
}
- .foregroundStyle(.white)
- .padding(.horizontal, 14).frame(height: 30)
- .background(RoundedRectangle(cornerRadius: 8).fill(Palette.ink))
+ .foregroundStyle(Palette.ink)
+ .padding(.horizontal, 12).frame(height: 30)
+ .background(RoundedRectangle(cornerRadius: 8).fill(Color.white))
+ .overlay(RoundedRectangle(cornerRadius: 8).stroke(Color(red: 0.85, green: 0.863, blue: 0.882), lineWidth: 1))
}
.menuStyle(.button).buttonStyle(.plain).menuIndicator(.hidden).fixedSize()
.disabled(s.lines.isEmpty)
@@ -718,10 +768,11 @@ struct MainWindowView: View {
HStack(spacing: 5) {
Text(title).font(.system(size: 13, weight: on ? .semibold : .regular))
.foregroundStyle(on ? Palette.ink : Palette.secondary)
- if let count { Text("\(count)").font(.system(size: 12).monospacedDigit()).foregroundStyle(Palette.tertiary) }
+ if let count { Text("\(count)").font(.system(size: 12).monospacedDigit()).foregroundStyle(Palette.secondary) }
}
- .padding(.horizontal, 12).frame(height: 52)
- .overlay(alignment: .bottom) { Rectangle().fill(on ? Palette.ink : .clear).frame(height: 2) }
+ .padding(.horizontal, 14).frame(height: 26)
+ .background(RoundedRectangle(cornerRadius: 7).fill(on ? Color.white : .clear)
+ .shadow(color: on ? Palette.ink.opacity(0.08) : .clear, radius: 1, y: 1))
.contentShape(Rectangle())
}
.buttonStyle(.plain)
@@ -730,36 +781,93 @@ struct MainWindowView: View {
/// Date, the editable title and a row of facts: the top of the page, scrolling with it.
private func header(_ s: Session) -> some View {
let live = s.id == store.liveID
- return VStack(alignment: .leading, spacing: 12) {
- Text(dateLine(s, live: live)).font(.system(size: 12)).foregroundStyle(Palette.secondary)
+ return VStack(alignment: .leading, spacing: 10) {
+ Text(dateLine(s, live: live)).font(.system(size: 12).monospacedDigit()).foregroundStyle(Palette.secondary)
TextField("标题", text: Binding(
get: { titleDraft.isEmpty ? s.displayTitle : titleDraft },
set: { titleDraft = $0 }
), axis: .vertical)
.textFieldStyle(.plain)
- .font(.system(size: 28, weight: .bold))
+ .font(.system(size: 26, weight: .bold))
.onSubmit {
if !titleDraft.isEmpty { store.rename(s.id, to: titleDraft) }
titleDraft = ""
}
- HStack(spacing: 8) {
+ // Facts as one grey line, not a row of chips; accent stays for "recording now".
+ HStack(spacing: 10) {
if live { Tag(L("正在记录"), live: true) }
- chip(Self.length(s))
- chip(L("\(s.lines.count) 句"))
- if let p = Self.pair(s, short: false) { chip(p) }
+ Text([Self.length(s), L("\(s.lines.count) 句"), Self.pair(s, short: false)].compactMap { $0 }.joined(separator: " · "))
+ .font(.system(size: 13)).foregroundStyle(Palette.secondary).lineLimit(1)
if let n = (live ? model.notes.notes : s.notes), !n.isEmpty {
- if n.final { Tag(L("完整版纪要"), live: true) } else { chip(L("速记版纪要")) }
+ HStack(spacing: 4) {
+ if n.final { Image(systemName: "checkmark").font(.system(size: 9, weight: .bold)) }
+ Text(n.final ? L("完整版纪要") : L("速记版纪要")).font(.system(size: 11, weight: .medium))
+ }
+ .foregroundStyle(n.final ? Palette.ink : Palette.secondary)
+ .padding(.horizontal, 7).padding(.vertical, 3)
+ .background(RoundedRectangle(cornerRadius: 6).fill(Palette.fill))
+ .fixedSize()
}
}
}
.frame(maxWidth: .infinity, alignment: .leading)
}
- private func chip(_ text: String) -> some View {
- Text(text).font(.system(size: 12)).foregroundStyle(Palette.secondary)
- .padding(.horizontal, 9).padding(.vertical, 4)
- .background(RoundedRectangle(cornerRadius: 6).fill(Palette.fill))
- .fixedSize()
+ /// The bilingual lines beside the notes, so the record's two languages show without switching tabs.
+ private func quotes(_ s: Session) -> some View {
+ ScrollViewReader { proxy in
+ ScrollView {
+ LazyVStack(alignment: .leading, spacing: 0) {
+ HStack {
+ Text("原话").font(.system(size: 12, weight: .semibold)).foregroundStyle(Palette.secondary)
+ Spacer()
+ Button(L("全部 \(s.lines.count) 句")) { tab = "transcript" }
+ .buttonStyle(.plain).font(.system(size: 12)).foregroundStyle(Palette.secondary)
+ }
+ .padding(.bottom, 6)
+ ForEach(s.lines) { l in
+ quoteRow(l, picked: quoteJump.map { t in l.id == pickedLine(s, t)?.id } ?? false).id(l.id)
+ }
+ }
+ .padding(.horizontal, 20).padding(.vertical, 24)
+ }
+ .scrollIndicators(.never)
+ .background(Palette.ground.opacity(0.6))
+ .onChange(of: quoteJump) { _, t in
+ guard let t, let l = pickedLine(s, t) else { return }
+ withAnimation { proxy.scrollTo(l.id, anchor: .top) }
+ }
+ .onChange(of: s.lines.count) { _, _ in
+ if s.id == store.liveID, quoteJump == nil, let last = s.lines.last {
+ withAnimation { proxy.scrollTo(last.id, anchor: .bottom) }
+ }
+ }
+ .onChange(of: s.id) { _, _ in quoteJump = nil }
+ }
+ }
+
+ private func pickedLine(_ s: Session, _ t: Double) -> TranscriptLine? {
+ s.lines.first(where: { $0.t >= t - 1 }) ?? s.lines.last
+ }
+
+ private func quoteRow(_ l: TranscriptLine, picked: Bool) -> some View {
+ HStack(alignment: .top, spacing: 10) {
+ Text(TranscriptExport.clock(l.t))
+ .font(.system(size: 11).monospacedDigit()).foregroundStyle(Palette.secondary)
+ .frame(width: 40, alignment: .leading).padding(.top, 2)
+ VStack(alignment: .leading, spacing: 3) {
+ Text(l.src).font(.system(size: 12)).foregroundStyle(Palette.secondary).lineSpacing(1)
+ .textSelection(.enabled)
+ Text(l.dst ?? L("翻译中…")).font(.system(size: 14)).lineSpacing(2)
+ .foregroundStyle(l.dst == nil ? Palette.secondary : Palette.ink)
+ .textSelection(.enabled)
+ }
+ Spacer(minLength: 0)
+ }
+ .padding(.vertical, 10).padding(.horizontal, 8)
+ .background(RoundedRectangle(cornerRadius: 8).fill(picked ? Color.white : .clear))
+ .padding(.horizontal, -8)
+ .overlay(alignment: .bottom) { Rectangle().fill(Palette.line).frame(height: 1).opacity(picked ? 0 : 1) }
}
private func dateLine(_ s: Session, live: Bool) -> String {
diff --git a/site/changelog.json b/site/changelog.json
index bbe699e..5fba30a 100644
--- a/site/changelog.json
+++ b/site/changelog.json
@@ -11,6 +11,11 @@
"title": "菜单栏面板的显示方式更好懂。",
"text": "显示方式换成三个带小图的格子:实时纪要、字幕条、不显示。下面的卡片只放选中那种的设置:实时纪要显示窗口开着还是收起,配一个打开或收起按钮(收起不会弹出会议记录),以及“共享屏幕时让对方看到”(原来叫录屏时显示纪要窗口);字幕条是什么时候出现、安静多久后收起;不显示则说明文字记录照常保存。⌃⌥S 快捷键挪到标题旁边,上面原文 + 译文那一行改叫“内容”,字幕不再一词两用。原来系统蓝色的分段选择(面板和设置里字幕条的时机、设置里的显示方式、会议记录窗口的双语 / 原文 / 译文)统一换成灰底白滑块,面板里字幕条的两个选择也对齐成同样宽。"
},
+ {
+ "kind": "changed",
+ "title": "会议记录窗口更清爽,原话和译文并排。",
+ "text": "开始听变成列表顶部的一个圆形按钮,不再是左下角的小开关;会议页铺满窗口,导出改成描边按钮,时长、句数和语言合成一行灰字,橙色只用来表示正在记录。窗口够宽时,纪要右边并排显示双语原话,点议题的时间就滚到那里;还没起名的会议显示为未命名会议。"
+ },
{
"kind": "new",
"title": "Chrome 里开会也不用设置麦克风了。",