知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.
Swift androidlinuxlive-captionsmacosmeeting-notesmenubar-appsimultaneous-interpretationspeech-recognitionsubtitlesswiftswiftuitranslationwindows
feat: Keep the "show when sharing screen" lamp in the notes window so one click turns it on or off
wquguru10cd9f0401ec
diff --git a/Resources/en.lproj/Localizable.strings b/Resources/en.lproj/Localizable.stringsindex de9cd4f..512e7d7 100644--- a/Resources/en.lproj/Localizable.strings+++ b/Resources/en.lproj/Localizable.strings@@ -305,8 +305,10 @@"刚刚更新" = "Updated just now";"%lld 秒前更新" = "Updated %lld s ago";"%lld 分钟前更新" = "Updated %lld min ago";-"录屏可见" = "Visible in recordings";-"录屏和共享屏幕都看得到纪要窗口,点一下关闭" = "Recordings and screen sharing can see the notes window. Click to turn off";+"对方可见" = "Visible to others";+"仅自己可见" = "Only you";+"对方可见 · 点击关闭" = "Visible to others · Click to hide";+"仅自己可见 · 点击共享" = "Only you · Click to share";"文字记录 · %lld" = "Transcript · %lld";"文字记录" = "Transcript";"在文字记录中搜索 ⌘F" = "Search transcript ⌘F";diff --git a/Resources/ja.lproj/Localizable.strings b/Resources/ja.lproj/Localizable.stringsindex fd65418..ff935e1 100644--- a/Resources/ja.lproj/Localizable.strings+++ b/Resources/ja.lproj/Localizable.strings@@ -305,8 +305,10 @@"刚刚更新" = "たった今更新";"%lld 秒前更新" = "%lld秒前に更新";"%lld 分钟前更新" = "%lld分前に更新";-"录屏可见" = "録画に表示中";-"录屏和共享屏幕都看得到纪要窗口,点一下关闭" = "録画と画面共有に議事メモのウインドウが映ります。クリックでオフ";+"对方可见" = "相手に表示中";+"仅自己可见" = "自分だけ";+"对方可见 · 点击关闭" = "相手に表示中 · クリックでオフ";+"仅自己可见 · 点击共享" = "自分だけ · クリックで共有";"文字记录 · %lld" = "文字起こし · %lld";"文字记录" = "文字起こし";"在文字记录中搜索 ⌘F" = "文字起こしを検索 ⌘F";diff --git a/Resources/ko.lproj/Localizable.strings b/Resources/ko.lproj/Localizable.stringsindex 4a61fd9..d06571c 100644--- a/Resources/ko.lproj/Localizable.strings+++ b/Resources/ko.lproj/Localizable.strings@@ -305,8 +305,10 @@"刚刚更新" = "방금 업데이트됨";"%lld 秒前更新" = "%lld초 전 업데이트됨";"%lld 分钟前更新" = "%lld분 전 업데이트됨";-"录屏可见" = "녹화에 표시 중";-"录屏和共享屏幕都看得到纪要窗口,点一下关闭" = "녹화와 화면 공유에 회의록 창이 보입니다. 클릭하면 끕니다";+"对方可见" = "상대에게 보임";+"仅自己可见" = "나만 보기";+"对方可见 · 点击关闭" = "상대에게 보임 · 클릭해 끄기";+"仅自己可见 · 点击共享" = "나만 보기 · 클릭해 공유";"文字记录 · %lld" = "대화 기록 · %lld";"文字记录" = "대화 기록";"在文字记录中搜索 ⌘F" = "대화 기록에서 검색 ⌘F";diff --git a/Resources/zh-Hans.lproj/Localizable.strings b/Resources/zh-Hans.lproj/Localizable.stringsindex 5d034d3..fcb67ef 100644--- a/Resources/zh-Hans.lproj/Localizable.strings+++ b/Resources/zh-Hans.lproj/Localizable.strings@@ -305,8 +305,10 @@"刚刚更新" = "刚刚更新";"%lld 秒前更新" = "%lld 秒前更新";"%lld 分钟前更新" = "%lld 分钟前更新";-"录屏可见" = "录屏可见";-"录屏和共享屏幕都看得到纪要窗口,点一下关闭" = "录屏和共享屏幕都看得到纪要窗口,点一下关闭";+"对方可见" = "对方可见";+"仅自己可见" = "仅自己可见";+"对方可见 · 点击关闭" = "对方可见 · 点击关闭";+"仅自己可见 · 点击共享" = "仅自己可见 · 点击共享";"文字记录 · %lld" = "文字记录 · %lld";"文字记录" = "文字记录";"在文字记录中搜索 ⌘F" = "在文字记录中搜索 ⌘F";diff --git a/Sources/LiveSubs/AppModel.swift b/Sources/LiveSubs/AppModel.swiftindex 6336144..aa2739f 100644--- a/Sources/LiveSubs/AppModel.swift+++ b/Sources/LiveSubs/AppModel.swift@@ -1126,6 +1126,7 @@ final class AppModel: ObservableObject {case "notesReplay": Task { await notes.replay(arg) }case "notesShow": notes.show(arg)case "notesCapturable": notesWindow.setCapturable(arg != "off")+ case "notesShare": setNotesCapturable(arg != "off") // the setting itself, as its badge or switch doescase "notesClose": notesWindow.performClose()case "closeWindow":// closeWindow:<main|settings|onboarding>: what the window's close button does.diff --git a/Sources/LiveSubs/NotesViews.swift b/Sources/LiveSubs/NotesViews.swiftindex 5debee4..8066735 100644--- a/Sources/LiveSubs/NotesViews.swift+++ b/Sources/LiveSubs/NotesViews.swift@@ -1002,6 +1002,45 @@ struct AnimatedDots: View {}/// The live dot beside "正在记录", breathing slowly.+/// 共享屏幕时让对方看到 as a lamp. On: an orange dot whose halo breathes outward, the first+/// breath a wider ring so turning it on is seen without any words (words would show in the+/// shared screen). Off: a small hollow grey ring, quiet. Reduce Motion holds the halo still.+struct CapturableMark: View {+ let on: Bool+ /// The dot's diameter; the halo spills past it, so leave room around the mark.+ var size: CGFloat = 8+ @Environment(\.accessibilityReduceMotion) private var reduceMotion+ @State private var since = Date()++ private static let off = Color(red: 0.663, green: 0.682, blue: 0.722) // #A9AEB8++ var body: some View {+ Group {+ if !on {+ Circle().strokeBorder(Self.off, lineWidth: 1.5)+ } else if reduceMotion {+ Circle().fill(Palette.accent).background(Circle().fill(Palette.accent).opacity(0.25).scaleEffect(1.6))+ } else {+ TimelineView(.animation(minimumInterval: 1 / 30)) { ctx in+ let age = ctx.date.timeIntervalSince(since)+ // Starts expanding the moment it turns on: 0 → 1 → 0 over 2.4 s.+ let t = 0.5 - 0.5 * cos(phase(ctx.date, period: 2.4, delay: since.timeIntervalSinceReferenceDate) * 2 * .pi)+ let first = min(1, age / 0.7)+ ZStack {+ Circle().fill(Palette.accent).scaleEffect(1 + 0.9 * t).opacity(0.5 * (1 - t))+ if first < 1 {+ Circle().stroke(Palette.accent, lineWidth: 1.5).scaleEffect(1 + 1.6 * first).opacity(0.7 * (1 - first))+ }+ Circle().fill(Palette.accent)+ }+ }+ }+ }+ .frame(width: size, height: size)+ .onChange(of: on) { _, now in if now { since = Date() } }+ }+}+struct LiveDot: View {var body: some View {TimelineView(.animation(minimumInterval: 1 / 15)) { ctx indiff --git a/Sources/LiveSubs/NotesWindow.swift b/Sources/LiveSubs/NotesWindow.swiftindex 4424861..b0cd8bf 100644--- a/Sources/LiveSubs/NotesWindow.swift+++ b/Sources/LiveSubs/NotesWindow.swift@@ -137,6 +137,8 @@ struct NotesWindowView: View {@State private var catchUp = false@State private var matchIndex = 0@State private var now = Date()+ @State private var badgeHover = false+ @State private var badgeHint = false@State private var width: CGFloat = 460/// "结束" was clicked during a meeting with lines: the confirmation strip is showing.@State private var confirmEnd = false@@ -265,7 +267,9 @@ struct NotesWindowView: View {if live { LiveDot() }Text(statusLine).font(.system(size: 12)).foregroundStyle(Palette.tertiary).lineLimit(2).fixedSize(horizontal: false, vertical: true)- if settings.notesCapturable { capturableBadge }+ // Apart on the right, so turning it on or off doesn't move the text.+ Spacer(minLength: 0)+ capturableBadge}.frame(minHeight: 22)}@@ -284,25 +288,39 @@ struct NotesWindowView: View {.padding(.horizontal, 24).padding(.top, 34).padding(.bottom, 12)}- /// Shown while 录屏时可见 is on, so it isn't left on into a shared screen: a record mark (ring- /// around a dot, like the menu bar's while recording) whose ring breathes. No words, since- /// recordings and screen sharing both see the window. A click turns it off.+ /// 共享屏幕时让对方看到, always here so it can be turned back on: an orange lamp while shared+ /// screens and recordings see the window, a hollow grey one while only you do (the window+ /// isn't captured then, so nobody else sees it). No words beside it except a hint while the+ /// pointer rests on it: once on, words would show in the shared screen; the lamp's first wide+ /// breath confirms the click instead.private var capturableBadge: some View {- Button { model.setNotesCapturable(false) } label: {- TimelineView(.animation(minimumInterval: 1 / 15)) { ctx in- let t = 0.5 + 0.5 * cos(phase(ctx.date, period: 2.4) * 2 * .pi)- ZStack {- Circle().stroke(Palette.accent, lineWidth: 1.5).frame(width: 13, height: 13)- .opacity(0.35 + 0.65 * t)- Circle().fill(Palette.accent).frame(width: 6, height: 6)- }+ let on = settings.notesCapturable+ return Button { model.setNotesCapturable(!on) } label: {+ CapturableMark(on: on).frame(width: 22, height: 22)- }- .contentShape(Circle())+ .background(Circle().fill(badgeHover ? Palette.fill : .clear))+ .contentShape(Circle())}.buttonStyle(.plain)- .help("录屏和共享屏幕都看得到纪要窗口,点一下关闭")- .accessibilityLabel(Text("录屏可见"))+ // Drawn here rather than .help: the window never activates the app, and macOS doesn't+ // show tooltips for an app in the background.+ .onHover { inside in+ badgeHover = inside+ if !inside { badgeHint = false; return }+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { if badgeHover { badgeHint = true } }+ }+ .overlay(alignment: .trailing) {+ if badgeHint {+ Text(on ? L("对方可见 · 点击关闭") : L("仅自己可见 · 点击共享"))+ .font(.system(size: 11)).foregroundStyle(.white).lineLimit(1).fixedSize()+ .padding(.horizontal, 8).frame(height: 20)+ .background(Capsule().fill(Palette.ink.opacity(0.88)))+ .offset(x: -28).allowsHitTesting(false).transition(.opacity)+ }+ }+ .animation(.easeOut(duration: 0.12), value: badgeHint)+ .accessibilityLabel(Text("共享屏幕时让对方看到"))+ .accessibilityValue(on ? Text("对方可见") : Text("仅自己可见"))}private var searchField: some View {@@ -717,7 +735,7 @@ struct NotesWindowView: View {.font(.system(size: 12)).foregroundStyle(Palette.tertiary)}Spacer()- if settings.notesCapturable { capturableBadge }+ capturableBadgeiconButton("arrow.up.left.and.arrow.down.right", help: L("展开纪要")) { setWidth(460, 760) }}if live, let p = model.ending {diff --git a/Sources/LiveSubs/SettingsWindow.swift b/Sources/LiveSubs/SettingsWindow.swiftindex 7e6c202..82298bd 100644--- a/Sources/LiveSubs/SettingsWindow.swift+++ b/Sources/LiveSubs/SettingsWindow.swift@@ -43,10 +43,13 @@ struct SettingsRow<Trailing: View>: View {let title: Stringvar detail: String? = nilvar divider = true+ /// A small state mark before the title, e.g. 共享屏幕时让对方看到's.+ var mark: AnyView? = nil@ViewBuilder var trailing: Trailingvar body: some View {VStack(spacing: 0) {HStack(spacing: 12) {+ if let mark { mark }VStack(alignment: .leading, spacing: 2) {Text(title).font(.system(size: 13)).foregroundStyle(Palette.ink)if let detail {@@ -688,7 +691,8 @@ struct SettingsView: View {}Text("实时纪要").font(.system(size: 13, weight: .semibold)).foregroundStyle(Palette.secondary).padding(.top, 4)SettingsCard {- SettingsRow(title: L("共享屏幕时让对方看到"), detail: L("录屏也一样;关着时只有你看得到纪要窗口"), divider: false) {+ SettingsRow(title: L("共享屏幕时让对方看到"), detail: L("录屏也一样;关着时只有你看得到纪要窗口"), divider: false,+ mark: AnyView(CapturableMark(on: settings.notesCapturable, size: 8).frame(width: 16, height: 16))) {Toggle("共享屏幕时让对方看到", isOn: Binding(get: { settings.notesCapturable }, set: { model.setNotesCapturable($0) })).toggleStyle(.switch).labelsHidden().tint(Palette.accent)}diff --git a/tools/README.md b/tools/README.mdindex 78c5531..f2ae94a 100644--- a/tools/README.md+++ b/tools/README.md@@ -19,7 +19,7 @@- 导出:`export:<目录>`- 新手引导与窗口:`onboarding:<步骤>[,skip|ask|setup]`(1–5,5 是收尾页;skip 是第 3 步点了“先不接”,ask / setup 是第 4 步的二选一 / 清单)、`samplePlay`、`speakers:<on|off>`(实验功能“说话人识别”)、`speakerGuess:<会议 id>`(马上让 Ling 认一遍名字)、`speakersRender:<会议 id>=<png>`、`voiceprintFile:<音频>=<json>`(用 app 里的声纹模型算整个文件的声纹,和参考模型对比)、`closeWindow:<main|settings|onboarding>`、`settings:<overlay|language|speak|records|ai|diagnostics>`、`about`- 显示与字幕:`display:<notes|bar|none>`、`subtitles:<both|translation|original>`、`meetingSubtitles:<…>`、`overlayState`、`overlayToggle`、`overlayAuto[:off]`、`hideAfter:<秒>`- - 纪要:`notesLang:<mine|source>`、`meetingNotesLang:<…>`、`notesRegenerate:<id>=<mine|source>`、`notesWindow[:x,y,w,h]`、`notesClose`、`notesFrame`、`notesNow`、`notesState`、`notesShow:<id>`、`notesReplay:<id>`、`notesCapturable[:off]`+ - 纪要:`notesLang:<mine|source>`、`meetingNotesLang:<…>`、`notesRegenerate:<id>=<mine|source>`、`notesWindow[:x,y,w,h]`、`notesClose`、`notesFrame`、`notesNow`、`notesState`、`notesShow:<id>`、`notesReplay:<id>`、`notesCapturable[:off]`(只改窗口能否被截屏)、`notesShare:<on|off>`(改“共享屏幕时让对方看到”这个设置,等于点图标或开关)- 结束会议:`endSim:<应用名>[,…]` 假装这些会议应用在通话(`endSim:` 全部挂断,`endSim:off` 回到真实情况),`endTimes:<静默秒>,<倒计时秒>,<挂断宽限秒>` 缩短等待(`endTimes:` 回到设置),`endKeep` 等于点“继续记录”,`endState` 写进日志- 渲染(不需要录屏权限):`panelRender:<png>`(菜单栏面板,离屏画)、`windowsRender:<目录>`、`settingsRender:<栏目>=<png>`、`notesRender:<png>`、`mainShow:<id>[,transcript]`、`mainRender:<png>`、`speakTestRender:<png>`- AI:`aiKeyFile:<路径>`(从 0600 文件读 key,不经过日志;测完就删掉文件)、`aiCheck`、`aiRemove`、`aiHide:<on|off>`(只在内存里当作没有 key,文件不动;用于截图)、`aiState`、`lingSimulate:<429|hijack|timeout|off>`、`translateFail:<n>`(接下来 n 句在所有翻译来源都失败,用来测重试)