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: one white page for the records window, with the logo as the listening switch

wquguru41095cdbdc63
diff --git a/AGENTS.md b/AGENTS.md
index b4bf060..9cc5f97 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -20,7 +20,7 @@ Cicada (知了, formerly Live Subs): a macOS menu bar app that turns what the Ma
## Design
-- Ground `#F3F4F6`, white cards, ink `#15171C`, one accent `#E8552B` for "live", greys `#5A5F6B` / `#6B7080`. Design canvases on claude.ai and the app itself are the source of truth.
+- Ground `#F3F4F6`, white cards (the main window is one white sheet, no cards), ink `#15171C`, one accent `#E8552B` for "live", greys `#5A5F6B` / `#6B7080`. Design canvases on claude.ai and the app itself are the source of truth.
- Copy is Chinese and short, at most one grey helper line. Chinese text is the localization key; `Resources/{en,ja,ko}.lproj` translate it. SwiftUI literals localize themselves; other UI strings use `L("…")`; never `L()` prompts, logs or stored values. After changing UI text run `python3 scripts/strings.py` (`--write` adds TODOs), and check the English UI, which runs wider.
- The logo geometry is kept in step in `CicadaLogo` (`Onboarding.swift`), `Sources/LiveSubsIcon` and `site/icon.svg`; then rerun `scripts/site-images.sh`.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 177317a..44c9cd9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,7 +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.
+- Changed: the records window is one white page. The title bar holds the switch, led by the logo: grey with 知了 · 开始听 (⌘R) when idle; while listening an ink pill where the logo breathes, bars follow the sound and the time runs, with 结束; when a meeting is about to end, a countdown ring around the logo with 继续记录. The window buttons sit on the same line. The list is one line per meeting (title and time; 未命名会议 for untitled ones, without the date the notes title starts with); the page has no card or toolbar: a grey line of facts, the title, then 纪要 / 文字记录 and 导出… (which also has 在 Finder 中显示). In a wide window the original and translation sit beside the notes, and a topic's time scrolls them there. While recording, 此刻 pins the sentence being heard under the page. 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/Resources/en.lproj/Localizable.strings b/Resources/en.lproj/Localizable.strings
index 4c9364c..101612c 100644
--- a/Resources/en.lproj/Localizable.strings
+++ b/Resources/en.lproj/Localizable.strings
@@ -710,14 +710,14 @@
"同声传译设置…" = "Interpreting Settings…";
"系统麦克风换成 %@" = "Switch System Mic to %@";
"还原系统麦克风" = "Restore System Mic";
-"搜索标题和原话" = "Search titles and transcripts";
+"搜索" = "Search";
+"导出…" = "Export…";
"开启字幕后,每场会议都会自动保存在这里。" = "Once subtitles are on, every meeting is saved here.";
"没有找到“%@”" = "Nothing found for “%@”";
"今天" = "Today";
"昨天" = "Yesterday";
"本周" = "This Week";
"未命名会议" = "Untitled meeting";
-"正在记录 · %@ 起 · %lld 句" = "Recording · since %@ · %lld lines";
"在 Finder 中显示" = "Show in Finder";
"恢复自动标题" = "Restore Automatic Title";
"删除" = "Delete";
diff --git a/Resources/en.lproj/Localizable.stringsdict b/Resources/en.lproj/Localizable.stringsdict
index e5a3ce2..839343d 100644
--- a/Resources/en.lproj/Localizable.stringsdict
+++ b/Resources/en.lproj/Localizable.stringsdict
@@ -114,21 +114,5 @@
<string>%lld lines</string>
</dict>
</dict>
- <key>正在记录 · %@ 起 · %lld 句</key>
- <dict>
- <key>NSStringLocalizedFormatKey</key>
- <string>Recording · since %1$@ · %2$#@n@</string>
- <key>n</key>
- <dict>
- <key>NSStringFormatSpecTypeKey</key>
- <string>NSStringPluralRuleType</string>
- <key>NSStringFormatValueTypeKey</key>
- <string>lld</string>
- <key>one</key>
- <string>%lld line</string>
- <key>other</key>
- <string>%lld lines</string>
- </dict>
- </dict>
</dict>
</plist>
diff --git a/Resources/ja.lproj/Localizable.strings b/Resources/ja.lproj/Localizable.strings
index 147d3ac..0e6b5c7 100644
--- a/Resources/ja.lproj/Localizable.strings
+++ b/Resources/ja.lproj/Localizable.strings
@@ -710,14 +710,14 @@
"同声传译设置…" = "同時通訳の設定…";
"系统麦克风换成 %@" = "システムのマイクを %@ にする";
"还原系统麦克风" = "システムのマイクを戻す";
-"搜索标题和原话" = "タイトルと発言を検索";
+"搜索" = "検索";
+"导出…" = "書き出す…";
"开启字幕后,每场会议都会自动保存在这里。" = "字幕をオンにすると、すべての会議がここに自動保存されます。";
"没有找到“%@”" = "「%@」は見つかりません";
"今天" = "今日";
"昨天" = "昨日";
"本周" = "今週";
"未命名会议" = "無題の会議";
-"正在记录 · %@ 起 · %lld 句" = "記録中 · %@から · %lld文";
"在 Finder 中显示" = "Finder で表示";
"恢复自动标题" = "自動タイトルに戻す";
"删除" = "削除";
diff --git a/Resources/ko.lproj/Localizable.strings b/Resources/ko.lproj/Localizable.strings
index 6c27f78..bf19413 100644
--- a/Resources/ko.lproj/Localizable.strings
+++ b/Resources/ko.lproj/Localizable.strings
@@ -710,14 +710,14 @@
"同声传译设置…" = "동시통역 설정…";
"系统麦克风换成 %@" = "시스템 마이크를 %@(으)로";
"还原系统麦克风" = "시스템 마이크 되돌리기";
-"搜索标题和原话" = "제목과 원문 검색";
+"搜索" = "검색";
+"导出…" = "내보내기…";
"开启字幕后,每场会议都会自动保存在这里。" = "자막을 켜면 모든 회의가 자동으로 여기에 저장됩니다.";
"没有找到“%@”" = "“%@” 검색 결과 없음";
"今天" = "오늘";
"昨天" = "어제";
"本周" = "이번 주";
"未命名会议" = "제목 없는 회의";
-"正在记录 · %@ 起 · %lld 句" = "기록 중 · %@부터 · %lld문장";
"在 Finder 中显示" = "Finder에서 보기";
"恢复自动标题" = "자동 제목으로 복원";
"删除" = "삭제";
diff --git a/Resources/zh-Hans.lproj/Localizable.strings b/Resources/zh-Hans.lproj/Localizable.strings
index e1b5033..2c59fca 100644
--- a/Resources/zh-Hans.lproj/Localizable.strings
+++ b/Resources/zh-Hans.lproj/Localizable.strings
@@ -710,14 +710,14 @@
"同声传译设置…" = "同声传译设置…";
"系统麦克风换成 %@" = "系统麦克风换成 %@";
"还原系统麦克风" = "还原系统麦克风";
-"搜索标题和原话" = "搜索标题和原话";
+"搜索" = "搜索";
+"导出…" = "导出…";
"开启字幕后,每场会议都会自动保存在这里。" = "开启字幕后,每场会议都会自动保存在这里。";
"没有找到“%@”" = "没有找到“%@”";
"今天" = "今天";
"昨天" = "昨天";
"本周" = "本周";
"未命名会议" = "未命名会议";
-"正在记录 · %@ 起 · %lld 句" = "正在记录 · %@ 起 · %lld 句";
"在 Finder 中显示" = "在 Finder 中显示";
"恢复自动标题" = "恢复自动标题";
"删除" = "删除";
diff --git a/Sources/LiveSubs/AppModel.swift b/Sources/LiveSubs/AppModel.swift
index 1f2c729..79b027e 100644
--- a/Sources/LiveSubs/AppModel.swift
+++ b/Sources/LiveSubs/AppModel.swift
@@ -1141,6 +1141,8 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate {
private var pollTimer: Timer?
private var runningObserver: Any?
private lazy var menu = AppMenu(model: model)
+ /// Held here: a toolbar keeps only a weak reference to its delegate.
+ private lazy var mainToolbar = MainToolbar(model: model)
func applicationDidFinishLaunching(_ notification: Notification) {
NSApp.setActivationPolicy(.accessory)
@@ -1260,6 +1262,9 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate {
w.minSize = NSSize(width: 760, height: 480)
w.delegate = self
w.contentView = NSHostingView(rootView: MainWindowView(model: model, store: model.store, settings: model.settings))
+ w.toolbar = mainToolbar.make()
+ w.toolbarStyle = .unified
+ w.titlebarSeparatorStyle = .none
w.center()
w.setFrameAutosaveName("LiveSubsMain")
mainWindow = w
diff --git a/Sources/LiveSubs/ListenPill.swift b/Sources/LiveSubs/ListenPill.swift
index 4b296c8..c57ff9f 100644
--- a/Sources/LiveSubs/ListenPill.swift
+++ b/Sources/LiveSubs/ListenPill.swift
@@ -1,10 +1,63 @@
+import AppKit
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.
+/// The main window's toolbar: the listening pill centred, settings on the right. A real toolbar,
+/// so macOS centres the window buttons on the same line instead of leaving them above it.
+@MainActor final class MainToolbar: NSObject, NSToolbarDelegate {
+ static let pill = NSToolbarItem.Identifier("cicada.pill")
+ static let settings = NSToolbarItem.Identifier("cicada.settings")
+ let model: AppModel
+
+ init(model: AppModel) { self.model = model }
+
+ func make() -> NSToolbar {
+ let t = NSToolbar(identifier: "cicada.main")
+ t.delegate = self
+ t.displayMode = .iconOnly
+ t.allowsUserCustomization = false
+ t.centeredItemIdentifiers = [Self.pill]
+ return t
+ }
+
+ func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] {
+ [.flexibleSpace, Self.pill, .flexibleSpace, Self.settings]
+ }
+
+ func toolbarAllowedItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] {
+ toolbarDefaultItemIdentifiers(toolbar)
+ }
+
+ func toolbar(_ toolbar: NSToolbar, itemForItemIdentifier id: NSToolbarItem.Identifier,
+ willBeInsertedIntoToolbar flag: Bool) -> NSToolbarItem? {
+ let item = NSToolbarItem(itemIdentifier: id)
+ let root: AnyView
+ if id == Self.pill {
+ root = AnyView(ListenPill(model: model, store: model.store))
+ item.label = L("开始听")
+ } else {
+ root = AnyView(
+ Button { [model] in model.openSettings() } label: {
+ Image(systemName: "slider.horizontal.3").font(.system(size: 14))
+ .frame(width: 30, height: 30).contentShape(Rectangle())
+ }
+ .buttonStyle(.plain).foregroundStyle(Palette.secondary).help("设置")
+ )
+ item.label = L("设置")
+ }
+ let host = NSHostingView(rootView: root)
+ host.sizingOptions = .intrinsicContentSize
+ item.view = host
+ item.isBordered = false
+ return item
+ }
+}
+
+/// The listening switch, led by the logo: grey and still while idle, in colour and breathing while
+/// listening, ringed by a countdown when the meeting is about to end. The brand is the switch.
struct ListenPill: View {
@ObservedObject var model: AppModel
@ObservedObject var store: SessionStore
+ @State private var endingTotal: Double = 30
var body: some View {
Group {
@@ -18,24 +71,28 @@ struct ListenPill: View {
}
.animation(.spring(duration: 0.35), value: model.running)
.animation(.spring(duration: 0.35), value: model.ending)
+ .onChange(of: model.ending) { _, p in
+ if let p { endingTotal = max(1, p.deadline.timeIntervalSinceNow) }
+ }
+ .padding(.vertical, 2)
+ // A toolbar item keeps the width it was first laid out at: a fixed slot, wide enough for
+ // the longest state (the English countdown), with the pill centred in it.
+ .frame(width: 420)
}
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)
- }
+ BrandMark(size: 22).saturation(0).opacity(0.55)
+ Text(L("知了")).font(.system(size: 13, weight: .heavy)).foregroundStyle(Palette.ink)
+ Rectangle().fill(Palette.line).frame(width: 1, height: 14)
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))
+ Text("⌘R").font(.system(size: 11)).foregroundStyle(Palette.secondary)
}
- .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))
+ .padding(.leading, 6).padding(.trailing, 12).frame(height: 32)
+ .background(Capsule().fill(Color.white))
+ .overlay(Capsule().stroke(Palette.line, lineWidth: 1))
.contentShape(Capsule())
}
.buttonStyle(.plain)
@@ -43,21 +100,20 @@ struct ListenPill: View {
}
private var listening: some View {
- HStack(spacing: 11) {
- BreathingDot(size: 8)
+ HStack(spacing: 10) {
+ Button { model.requestStop() } label: { BreathingMark(size: 22) }
+ .buttonStyle(.plain).accessibilityLabel(L("结束会议"))
Text("正在听").font(.system(size: 13, weight: .semibold))
- LevelMeter(model: model, bars: 9, height: 16, color: Palette.accent)
+ LevelMeter(model: model, bars: 8, height: 15, 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)
+ .padding(.horizontal, 12).frame(height: 24)
.background(Capsule().fill(Color(red: 0.184, green: 0.196, blue: 0.227)))
.contentShape(Capsule())
}
@@ -65,29 +121,72 @@ struct ListenPill: View {
.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))
+ .padding(.leading, 5).padding(.trailing, 4).frame(height: 32)
+ .background(Capsule().fill(Palette.ink))
+ // The languages stay one hover away; the pill keeps to state, level and time.
+ .help(model.summary)
}
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()))) 秒后结束"))
+ TimelineView(.periodic(from: .now, by: 1)) { ctx in
+ let left = max(0, p.deadline.timeIntervalSince(ctx.date))
+ HStack(spacing: 10) {
+ ZStack {
+ Circle().stroke(Color(red: 0.227, green: 0.239, blue: 0.27), lineWidth: 2.5)
+ Circle().trim(from: 0, to: min(1, left / endingTotal))
+ .stroke(Palette.accent, style: StrokeStyle(lineWidth: 2.5, lineCap: .round))
+ .rotationEffect(.degrees(-90))
+ BrandMark(size: 16)
+ }
+ .frame(width: 26, height: 26)
+ Text(model.endingTitle(p)).font(.system(size: 13, weight: .semibold)).lineLimit(1)
+ Text(L("\(Int(left.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: 24)
+ .background(Capsule().fill(Color.white))
+ .contentShape(Capsule())
+ }
+ .buttonStyle(.plain)
}
- 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())
+ .foregroundStyle(.white)
+ .padding(.leading, 4).padding(.trailing, 4).frame(height: 32)
+ .background(Capsule().fill(Palette.ink))
+ }
+ }
+}
+
+/// The logo with accent rings swelling out of it while Cicada listens.
+struct BreathingMark: View {
+ var size: CGFloat = 22
+ @Environment(\.accessibilityReduceMotion) private var reduceMotion
+
+ var body: some View {
+ BrandMark(size: size)
+ .background {
+ if !reduceMotion {
+ ZStack {
+ Ring(size: size, delay: 0)
+ Ring(size: size, delay: 1.1)
+ }
+ }
}
- .buttonStyle(.plain)
+ .accessibilityHidden(true)
+ }
+
+ private struct Ring: View {
+ let size: CGFloat
+ let delay: Double
+ @State private var out = false
+ var body: some View {
+ RoundedRectangle(cornerRadius: size * 0.28).fill(Palette.accent)
+ .scaleEffect(out ? 1.7 : 1).opacity(out ? 0 : 0.55)
+ .onAppear {
+ withAnimation(.easeOut(duration: 2.2).repeatForever(autoreverses: false).delay(delay)) { out = true }
+ }
}
- .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))
}
}
diff --git a/Sources/LiveSubs/Views.swift b/Sources/LiveSubs/Views.swift
index 6485f22..4f38757 100644
--- a/Sources/LiveSubs/Views.swift
+++ b/Sources/LiveSubs/Views.swift
@@ -471,21 +471,17 @@ struct MainWindowView: View {
private var current: Session? { store.session(selection ?? store.sessions.first?.id) }
var body: some View {
- 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)
- }
+ // One white sheet: no ground, no card, one hairline between the list and the page.
+ // The listening pill lives in the window's toolbar (`MainToolbar`).
+ HStack(spacing: 0) {
+ sidebar
+ .frame(width: 240)
+ Rectangle().fill(Self.hairline).frame(width: 1)
+ detail
+ .frame(maxWidth: .infinity, maxHeight: .infinity)
+ .onGeometryChange(for: CGFloat.self) { $0.size.width } action: { detailWidth = $0 }
}
- .background(Palette.ground)
+ .background(Color.white.ignoresSafeArea())
.background(Button("") { searchFocused = true }.keyboardShortcut("f").opacity(0))
.onChange(of: model.mainShow) { _, show in
guard let parts = show?.split(separator: ",").map(String.init), let id = parts.first else { return }
@@ -495,30 +491,15 @@ 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)
- }
+ static let hairline = Color(red: 0.941, green: 0.945, blue: 0.957)
// MARK: Sidebar
private var sidebar: some View {
- VStack(alignment: .leading, spacing: 12) {
- // Greys on the grey ground are `secondary`: `tertiary` falls under 4.5:1 there.
+ VStack(alignment: .leading, spacing: 8) {
HStack(spacing: 8) {
Image(systemName: "magnifyingglass").foregroundStyle(Palette.secondary)
- TextField("搜索标题和原话", text: $query).textFieldStyle(.plain).focused($searchFocused)
+ TextField("搜索", text: $query).textFieldStyle(.plain).focused($searchFocused)
if query.isEmpty {
Text("⌘F").font(.system(size: 11)).foregroundStyle(Palette.secondary)
} else {
@@ -527,11 +508,10 @@ struct MainWindowView: View {
}
}
.font(.system(size: 13))
- .padding(.horizontal, 10).frame(height: 32)
- .background(RoundedRectangle(cornerRadius: 9).fill(Color(red: 0.914, green: 0.922, blue: 0.937)))
+ .padding(.horizontal, 10).frame(height: 30)
ScrollView {
- LazyVStack(alignment: .leading, spacing: 2) {
+ LazyVStack(alignment: .leading, spacing: 1) {
ForEach(groups, id: \.title) { g in
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)
@@ -549,7 +529,7 @@ struct MainWindowView: View {
}
.scrollIndicators(.never)
}
- .padding(.leading, 14).padding(.trailing, 12).padding(.bottom, 14)
+ .padding(.leading, 12).padding(.trailing, 10).padding(.top, 6).padding(.bottom, 14)
}
/// 今天 / 昨天 / 本周 / then one group per month, newest first.
@@ -576,26 +556,22 @@ struct MainWindowView: View {
selection = s.id
titleDraft = ""
} label: {
- VStack(alignment: .leading, spacing: 3) {
- HStack(spacing: 7) {
- 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)
- }
+ // One line: the title and when. Length and languages are on the meeting's page.
+ HStack(alignment: .firstTextBaseline, spacing: 8) {
+ if live { BreathingDot(size: 6).alignmentGuide(.firstTextBaseline) { $0[.bottom] - 1 } }
+ if Self.untitled(s) {
+ // The default title only repeats the time beside it.
+ Text("未命名会议").font(.system(size: 13)).foregroundStyle(Palette.secondary)
+ } else {
+ Text(Self.listTitle(s)).font(.system(size: 13, weight: selected ? .semibold : .regular))
+ .foregroundStyle(Palette.ink).lineLimit(1)
}
- Text(meta(s, live: live)).font(.system(size: 11))
- .foregroundStyle(live ? Palette.accentInk : Palette.secondary).lineLimit(1)
- .padding(.leading, live ? 14 : 0)
+ Spacer(minLength: 4)
+ Text(live ? L("正在记录") : when(s)).font(.system(size: 12).monospacedDigit())
+ .foregroundStyle(live ? Palette.accentInk : Palette.secondary).lineLimit(1).fixedSize()
}
- .frame(maxWidth: .infinity, alignment: .leading)
- .padding(.horizontal, 10).padding(.vertical, 9)
- .background(RoundedRectangle(cornerRadius: 9).fill(selected ? Color.white : Color.clear)
- .shadow(color: selected ? Palette.ink.opacity(0.06) : .clear, radius: 1, y: 1))
- .overlay(RoundedRectangle(cornerRadius: 9).stroke(selected ? Palette.line : Color.clear, lineWidth: 1))
+ .padding(.horizontal, 10).padding(.vertical, 8)
+ .background(RoundedRectangle(cornerRadius: 8).fill(selected ? Palette.fill : Color.clear))
.contentShape(Rectangle())
}
.buttonStyle(.plain)
@@ -608,12 +584,21 @@ struct MainWindowView: View {
}
}
- private func meta(_ s: Session, live: Bool) -> String {
+ private func when(_ s: Session) -> String {
let cal = Calendar.current
- let when = dateText(s.startedAt, cal.isDateInToday(s.startedAt) || cal.isDateInYesterday(s.startedAt) ? "HHmm"
- : cal.isDate(s.startedAt, equalTo: Date(), toGranularity: .weekOfYear) ? "EEEHHmm" : "MMMdHHmm")
- if live { return L("正在记录 · \(when) 起 · \(s.lines.count) 句") }
- return [when, Self.length(s), Self.pair(s, short: true)].compactMap { $0 }.joined(separator: " · ")
+ return dateText(s.startedAt, cal.isDateInToday(s.startedAt) || cal.isDateInYesterday(s.startedAt) ? "HHmm"
+ : cal.isDate(s.startedAt, equalTo: Date(), toGranularity: .weekOfYear) ? "EEE" : "MMMd")
+ }
+
+ /// Notes titles often start with the day ("11月2日 产品周会"); under a 今天 heading that only
+ /// pushes the real title out of the row.
+ static func listTitle(_ s: Session) -> String {
+ let title = s.displayTitle
+ for prefix in [dateText(s.startedAt, "MMMd"), dateText(s.startedAt, "MMMMd")] where title.hasPrefix(prefix) {
+ let rest = title.dropFirst(prefix.count).trimmingCharacters(in: .whitespaces)
+ if !rest.isEmpty { return rest }
+ }
+ return title
}
/// Still on the stored "会议 <date>" title: not renamed, and no notes title to show.
@@ -654,11 +639,9 @@ struct MainWindowView: View {
private var detail: some View {
if let s = current {
VStack(spacing: 0) {
- toolbar(s)
- Divider()
if s.lines.isEmpty {
ScrollView {
- header(s).frame(maxWidth: 680).padding(.horizontal, 32).padding(.vertical, 36)
+ header(s).frame(maxWidth: 680).padding(.horizontal, 44).padding(.vertical, 36)
.frame(maxWidth: .infinity)
}
.overlay {
@@ -673,8 +656,7 @@ struct MainWindowView: View {
if sideBySide { quoteJump = t } else { jumpTo = t; tab = "transcript" }
}
if sideBySide {
- Rectangle().fill(Palette.line).frame(width: 1)
- quotes(s).frame(width: 340)
+ quotes(s).frame(width: 300).padding(.trailing, 24)
}
}
} else {
@@ -721,45 +703,29 @@ struct MainWindowView: View {
}
}
- private func toolbar(_ s: Session) -> some View {
- HStack(spacing: 4) {
- HStack(spacing: 2) {
- tabButton(L("纪要"), id: "notes")
- tabButton(L("文字记录"), id: "transcript", count: s.lines.count)
- }
- .padding(3)
- .background(RoundedRectangle(cornerRadius: 9).fill(Palette.fill))
+ /// Text tabs, the transcript's language choice and 导出…, under the title: no toolbar band.
+ private func tabsRow(_ s: Session) -> some View {
+ HStack(alignment: .center, spacing: 22) {
+ tabButton(L("纪要"), id: "notes")
+ tabButton(L("文字记录"), id: "transcript", count: s.lines.count)
Spacer()
if tab == "transcript" {
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())
- }
- .buttonStyle(.plain).foregroundStyle(Palette.secondary).help("在 Finder 中显示")
Menu {
Button("复制为 Markdown") { model.export(s, kind: "copy") }
Divider()
Button("导出 Markdown…") { model.export(s, kind: "md") }
Button("导出 Word…") { model.export(s, kind: "word") }
Button("导出字幕 SRT…") { model.export(s, kind: "srt") }
+ Divider()
+ Button("在 Finder 中显示") { NSWorkspace.shared.activateFileViewerSelecting([store.folder(s.id)]) }
} label: {
- // Outlined, not filled: exporting is a side task, not the page's main action.
- HStack(spacing: 6) {
- Text("导出").font(.system(size: 13, weight: .medium))
- Image(systemName: "chevron.down").font(.system(size: 9, weight: .bold))
- }
- .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))
+ Text("导出…").font(.system(size: 13)).foregroundStyle(Palette.secondary)
}
.menuStyle(.button).buttonStyle(.plain).menuIndicator(.hidden).fixedSize()
.disabled(s.lines.isEmpty)
}
- .padding(.leading, 16).padding(.trailing, 14)
- .frame(height: 52)
}
private func tabButton(_ title: String, id: String, count: Int? = nil) -> some View {
@@ -770,45 +736,37 @@ struct MainWindowView: View {
.foregroundStyle(on ? Palette.ink : Palette.secondary)
if let count { Text("\(count)").font(.system(size: 12).monospacedDigit()).foregroundStyle(Palette.secondary) }
}
- .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))
+ .padding(.bottom, 6)
+ .overlay(alignment: .bottom) { Rectangle().fill(on ? Palette.ink : .clear).frame(height: 2) }
.contentShape(Rectangle())
}
.buttonStyle(.plain)
}
- /// Date, the editable title and a row of facts: the top of the page, scrolling with it.
+ /// One grey line of facts, the editable title, then the tabs: 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: 10) {
- Text(dateLine(s, live: live)).font(.system(size: 12).monospacedDigit()).foregroundStyle(Palette.secondary)
+ let notes = live ? model.notes.notes : s.notes
+ let facts = [dateLine(s, live: live), Self.length(s), Self.pair(s, short: false),
+ notes.flatMap { $0.isEmpty ? nil : ($0.final ? L("完整版纪要") : L("速记版纪要")) }]
+ return VStack(alignment: .leading, spacing: 0) {
+ HStack(spacing: 8) {
+ if live { Tag(L("正在记录"), live: true) }
+ Text(facts.compactMap { $0 }.joined(separator: " · "))
+ .font(.system(size: 12).monospacedDigit()).foregroundStyle(Palette.secondary).lineLimit(1)
+ }
TextField("标题", text: Binding(
get: { titleDraft.isEmpty ? s.displayTitle : titleDraft },
set: { titleDraft = $0 }
), axis: .vertical)
.textFieldStyle(.plain)
- .font(.system(size: 26, weight: .bold))
+ .font(.system(size: 28, weight: .bold))
+ .padding(.top, 8)
.onSubmit {
if !titleDraft.isEmpty { store.rename(s.id, to: titleDraft) }
titleDraft = ""
}
- // Facts as one grey line, not a row of chips; accent stays for "recording now".
- HStack(spacing: 10) {
- if live { Tag(L("正在记录"), live: true) }
- 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 {
- 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()
- }
- }
+ tabsRow(s).padding(.top, 20)
}
.frame(maxWidth: .infinity, alignment: .leading)
}
@@ -819,20 +777,19 @@ struct MainWindowView: View {
ScrollView {
LazyVStack(alignment: .leading, spacing: 0) {
HStack {
- Text("原话").font(.system(size: 12, weight: .semibold)).foregroundStyle(Palette.secondary)
+ Text("原话").font(.system(size: 12)).foregroundStyle(Palette.secondary)
Spacer()
Button(L("全部 \(s.lines.count) 句")) { tab = "transcript" }
.buttonStyle(.plain).font(.system(size: 12)).foregroundStyle(Palette.secondary)
}
- .padding(.bottom, 6)
+ .padding(.bottom, 8)
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)
+ .padding(.vertical, 40)
}
.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) }
@@ -850,24 +807,20 @@ struct MainWindowView: View {
s.lines.first(where: { $0.t >= t - 1 }) ?? s.lines.last
}
+ /// Whitespace between lines, no rules; the picked line gets a soft fill.
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)
+ VStack(alignment: .leading, spacing: 2) {
+ 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)
}
- .padding(.vertical, 10).padding(.horizontal, 8)
- .background(RoundedRectangle(cornerRadius: 8).fill(picked ? Color.white : .clear))
+ .frame(maxWidth: .infinity, alignment: .leading)
+ .padding(.vertical, 8).padding(.horizontal, 8)
+ .background(RoundedRectangle(cornerRadius: 8).fill(picked ? Palette.fill : .clear))
.padding(.horizontal, -8)
- .overlay(alignment: .bottom) { Rectangle().fill(Palette.line).frame(height: 1).opacity(picked ? 0 : 1) }
+ .help(TranscriptExport.clock(l.t))
}
private func dateLine(_ s: Session, live: Bool) -> String {
@@ -880,14 +833,11 @@ struct MainWindowView: View {
ScrollViewReader { proxy in
ScrollView {
LazyVStack(alignment: .leading, spacing: 0) {
- header(s).padding(.bottom, 20)
- ForEach(s.lines) { l in
- Divider()
- lineRow(l).id(l.id)
- }
+ header(s).padding(.bottom, 16)
+ ForEach(s.lines) { l in lineRow(l).id(l.id) }
}
.frame(maxWidth: 680)
- .padding(.horizontal, 32).padding(.vertical, 36)
+ .padding(.horizontal, 40).padding(.vertical, 36)
.frame(maxWidth: .infinity)
}
.onChange(of: s.lines.count) { _, _ in
@@ -927,7 +877,7 @@ struct MainWindowView: View {
}
Spacer(minLength: 0)
}
- .padding(.vertical, 14)
+ .padding(.vertical, 12)
}
}
@@ -981,7 +931,7 @@ struct SessionNotesView: View {
}
}
.frame(maxWidth: 680, alignment: .leading)
- .padding(.horizontal, 32).padding(.vertical, 36)
+ .padding(.horizontal, 44).padding(.vertical, 36)
.frame(maxWidth: .infinity)
}
}
diff --git a/site/changelog.json b/site/changelog.json
index 7c2d844..03c8c8e 100644
--- a/site/changelog.json
+++ b/site/changelog.json
@@ -13,8 +13,8 @@
},
{
"kind": "changed",
- "title": "会议记录窗口更清爽,原话和译文并排。",
- "text": "开始听变成列表顶部的一个圆形按钮,不再是左下角的小开关;会议页铺满窗口,导出改成描边按钮,时长、句数和语言合成一行灰字,橙色只用来表示正在记录。窗口够宽时,纪要右边并排显示双语原话,点议题的时间就滚到那里;还没起名的会议显示为未命名会议。"
+ "title": "会议记录窗口变成一张白纸,开关就是知了。",
+ "text": "标题栏中间是知了开关:没在听时是灰色的知了和“开始听”(⌘R);听的时候变成深色胶囊,知了在呼吸,声音条跟着声音跳,旁边是计时和结束;会议快自动结束时,知了外圈变成倒数环,可以点继续记录。左边列表每场会议一行,只有标题和时间;会议页去掉了卡片和工具栏,标题下面就是纪要、文字记录和导出。窗口够宽时,纪要右边并排显示原话和译文,点议题的时间就滚到那里;正在记录时,页面底部的“此刻”显示正在说的这句话。"
},
{
"kind": "new",