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: show and generate notes for meetings in the main window, include them in exports

wqugurucbbb4d1ac78b
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 08d864a..5fd0e23 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,7 @@ the release workflow publishes it as the release notes.
- New: a sound test for the virtual microphone: the app plays a sentence into it, listens back and shows what the room will hear.
- New: a settings window with a sidebar (听 / 我说话也翻译 / 字幕条 / 会议记录) replaces the settings sheet; the virtual microphone is set up from a three-step checklist there and in the first-run guide.
- Changed: hold the right ⌥ key on its own to talk, instead of ⌥ Space (which other apps' launchers often use, and which types a space). Pressing another key while holding it cancels, so ⌥ + letter still types. It needs the "输入监控" permission; the app asks for it.
+- New: meeting records show the notes (纪要 / 文字记录); a meeting recorded without notes gets a "生成纪要" button. Markdown and Word exports start with the notes.
- New: a live notes window, now the default display while listening: notes, the transcript and a caption line in one floating window that can be moved and resized anywhere (a small card under 360 px with "我刚走神了,错过什么?", tabs in between, notes beside the transcript from 760 px), never shows up in screen sharing, and remembers its frame. The menu bar panel and settings choose 实时纪要 / 字幕条 / 不显示; ⌃⌥S now cycles through them.
- New: live meeting notes. With a key, Ling updates the notes about every 45 s while the meeting runs (summary, topics with key points, a fishbone diagram where causes are discussed, conclusions and to-dos with how many lines back them, names and terms with their misrecognised forms) and rewrites them once over the whole transcript when it ends. Notes are saved with the meeting.
- New: with a key, finished sentences and speak-back are translated by Ling (names kept consistent through the notes' glossary); if Ling is busy or fails, that sentence falls back to Google, then to Apple's on-device translation. Partial text while someone is still talking stays on Google.
diff --git a/Sources/LiveSubs/Notes.swift b/Sources/LiveSubs/Notes.swift
index 17003d3..c8e848a 100644
--- a/Sources/LiveSubs/Notes.swift
+++ b/Sources/LiveSubs/Notes.swift
@@ -265,6 +265,7 @@ final class NotesEngine: ObservableObject {
- Add a fishbone only to a topic that discusses causes, reasons or factors (3-5 branches); otherwise null.
- Every topic, point source, branch, conclusion and to-do needs evidence: the ids of the lines that say it. Never state anything the transcript does not say.
- terms: at most 10 people, places or jargon words that matter. name is the correct spelling in the transcript's language (no translation in brackets); heard lists only the wrong forms the transcript used; note is a few words.
+ - Write about what was said, never about the transcript or recognition quality.
- Use empty arrays when there is nothing. No markdown, no text outside the JSON.
"""
return p
diff --git a/Sources/LiveSubs/SessionStore.swift b/Sources/LiveSubs/SessionStore.swift
index db1c13d..51960ff 100644
--- a/Sources/LiveSubs/SessionStore.swift
+++ b/Sources/LiveSubs/SessionStore.swift
@@ -175,8 +175,34 @@ enum TranscriptExport {
return "\(f.string(from: s.startedAt)) · " + (mins < 1 ? "不到 1 分钟" : "\(mins) 分钟")
}
+ /// The notes as Markdown (empty when there are none).
+ static func notesMarkdown(_ n: MeetingNotes?) -> String {
+ guard let n, !n.isEmpty else { return "" }
+ var out = "## 纪要\n\n\(n.summary)\n\n"
+ for t in n.topics {
+ out += "### \(clock(t.start)) \(t.title)\n\n"
+ if !t.summary.isEmpty { out += "\(t.summary)\n\n" }
+ for p in t.points { out += "- \(p)\n" }
+ if let f = t.fishbone {
+ out += "\n**\(f.question)**\n\n"
+ for b in f.branches { out += "- \(b.label):\(b.detail)\n" }
+ }
+ out += "\n"
+ }
+ if !n.conclusions.isEmpty { out += "### 结论\n\n" + n.conclusions.map { "- \($0.text)\n" }.joined() + "\n" }
+ if !n.todos.isEmpty {
+ out += "### 待办\n\n" + n.todos.map { "- [ ] \($0.text)" + ($0.owner.map { "(\($0))" } ?? "") + "\n" }.joined() + "\n"
+ }
+ if !n.terms.isEmpty {
+ out += "### 人名和术语\n\n" + n.terms.map { "- **\($0.name)** \($0.note)\n" }.joined() + "\n"
+ }
+ return out
+ }
+
static func markdown(_ s: Session) -> String {
var out = "# \(s.title)\n\n\(header(s))\n\n"
+ let notes = notesMarkdown(s.notes)
+ if !notes.isEmpty { out += notes + "## 文字记录\n\n" }
for l in s.lines {
out += "**[\(clock(l.t))] \(speakerName(l))** \n\(l.src)\n"
if let d = l.dst, d != l.src { out += "> \(d)\n" }
@@ -214,6 +240,29 @@ enum TranscriptExport {
}
add(s.title, size: 20, weight: .bold, after: 6)
add(header(s), size: 10, color: .darkGray, after: 14)
+ if let n = s.notes, !n.isEmpty {
+ add("纪要", size: 15, weight: .bold, after: 6)
+ add(n.summary, size: 11, after: 10)
+ for t in n.topics {
+ add("\(clock(t.start)) \(t.title)", size: 12, weight: .semibold, after: 3)
+ if !t.summary.isEmpty { add(t.summary, size: 11, color: .darkGray, after: 3) }
+ for p in t.points { add("• \(p)", size: 11, after: 2) }
+ if let f = t.fishbone {
+ add(f.question, size: 11, weight: .semibold, after: 2)
+ for b in f.branches { add(" – \(b.label):\(b.detail)", size: 11, after: 2) }
+ }
+ add("", size: 6, after: 4)
+ }
+ if !n.conclusions.isEmpty {
+ add("结论", size: 12, weight: .semibold, after: 3)
+ for c in n.conclusions { add("• \(c.text)", size: 11, after: 2) }
+ }
+ if !n.todos.isEmpty {
+ add("待办", size: 12, weight: .semibold, after: 3)
+ for t in n.todos { add("☐ \(t.text)" + (t.owner.map { "(\($0))" } ?? ""), size: 11, after: 2) }
+ }
+ add("文字记录", size: 15, weight: .bold, after: 6)
+ }
for l in s.lines {
add("[\(clock(l.t))] \(speakerName(l))", size: 9, weight: .semibold, color: .darkGray, after: 2)
add(l.src, size: 11, after: 2)
diff --git a/Sources/LiveSubs/Views.swift b/Sources/LiveSubs/Views.swift
index d93d985..d4bf80d 100644
--- a/Sources/LiveSubs/Views.swift
+++ b/Sources/LiveSubs/Views.swift
@@ -248,6 +248,8 @@ struct MainWindowView: View {
@State private var query = ""
@State private var view = "both"
@State private var titleDraft = ""
+ @State private var tab = "notes"
+ @State private var jumpTo: Double?
private var filtered: [Session] {
guard !query.isEmpty else { return store.sessions }
@@ -369,12 +371,19 @@ struct MainWindowView: View {
.font(.system(size: 12)).foregroundStyle(Palette.secondary)
}
Spacer()
- Picker("显示", selection: $view) {
- Text("双语").tag("both")
- Text("原文").tag("src")
- Text("译文").tag("dst")
+ Picker("内容", selection: $tab) {
+ Text("纪要").tag("notes")
+ Text("文字记录").tag("transcript")
+ }
+ .pickerStyle(.segmented).labelsHidden().frame(width: 150)
+ if tab == "transcript" {
+ Picker("显示", selection: $view) {
+ Text("双语").tag("both")
+ Text("原文").tag("src")
+ Text("译文").tag("dst")
+ }
+ .pickerStyle(.segmented).labelsHidden().frame(width: 150)
}
- .pickerStyle(.segmented).labelsHidden().frame(width: 170)
Menu {
Button("复制为 Markdown") { model.export(s, kind: "copy") }
Divider()
@@ -396,7 +405,12 @@ struct MainWindowView: View {
Divider().padding(.horizontal, 28)
- if s.lines.isEmpty {
+ if tab == "notes" && !s.lines.isEmpty {
+ SessionNotesView(model: model, engine: model.notes, ling: model.ling, session: s) { t in
+ jumpTo = t
+ tab = "transcript"
+ }
+ } else if s.lines.isEmpty {
VStack(spacing: 8) {
Spacer()
Text(s.id == store.liveID ? "正在听,说话的内容会出现在这里" : "这场会议没有记录到内容")
@@ -420,6 +434,10 @@ struct MainWindowView: View {
withAnimation { proxy.scrollTo(last.id, anchor: .bottom) }
}
}
+ .onAppear {
+ if let t = jumpTo, let l = s.lines.first(where: { $0.t >= t - 1 }) { proxy.scrollTo(l.id, anchor: .top) }
+ jumpTo = nil
+ }
}
}
}
@@ -463,3 +481,53 @@ struct MainWindowView: View {
.padding(.vertical, 12)
}
}
+
+
+/// A meeting's notes in the main window: the same notes view as the live window, or a way to
+/// make them for a meeting recorded without a key.
+struct SessionNotesView: View {
+ @ObservedObject var model: AppModel
+ @ObservedObject var engine: NotesEngine
+ @ObservedObject var ling: LingClient
+ let session: Session
+ let onJump: (Double) -> Void
+
+ private var live: Bool { session.id == model.store.liveID }
+ private var notes: MeetingNotes? { live ? engine.notes : session.notes }
+ private var generating: Bool { engine.state == .updating && engine.shownID == session.id }
+
+ var body: some View {
+ ScrollView {
+ VStack(alignment: .leading, spacing: 0) {
+ if let notes, !notes.isEmpty {
+ NotesContentView(notes: notes, fresh: live ? engine.fresh : [], live: live, onJump: onJump)
+ } else {
+ VStack(alignment: .leading, spacing: 10) {
+ Text(generating ? "正在整理纪要…" : live ? "纪要会在会议进行中自动生成" : "这场会议还没有纪要")
+ .font(.system(size: 15, weight: .bold))
+ Text(ling.hasKey ? "用 Ling 从文字记录整理总结、议题、结论和人名,大约半分钟。"
+ : "在 设置 › AI 服务 填上 Ling 的 API key 后就能生成。")
+ .font(.system(size: 13)).foregroundStyle(Palette.secondary)
+ if !live {
+ HStack(spacing: 8) {
+ if ling.hasKey {
+ SoftButton(generating ? "正在生成…" : "生成纪要", dark: true) {
+ engine.show(session.id)
+ engine.generate(for: session.id)
+ }
+ .disabled(generating)
+ } else {
+ SoftButton("去填 key", dark: true) { model.openSettings(.ai) }
+ }
+ }
+ }
+ }
+ .padding(20).frame(maxWidth: .infinity, alignment: .leading)
+ .background(RoundedRectangle(cornerRadius: 18).fill(Palette.raised))
+ }
+ }
+ .padding(.horizontal, 28).padding(.vertical, 20)
+ .frame(maxWidth: 760, alignment: .leading)
+ }
+ }
+}