知了 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
fix(windows): Generate Notes on a meeting record says it is writing them and can't be clicked twice
wquguru19616354f5c5
diff --git a/site/changelog.json b/site/changelog.jsonindex 4251f82..30081da 100644--- a/site/changelog.json+++ b/site/changelog.json@@ -631,6 +631,14 @@],"title": "Windows 下载新版本时,进度显示成“39%”,不再是“39%%”。","text": "托盘面板和 设置 › 关于 里的下载进度多了一个百分号。"+ },+ {+ "kind": "fixed",+ "platforms": [+ "windows"+ ],+ "title": "Windows 会议记录里点“生成纪要”后,会显示“正在整理纪要…”,按钮也不能再点。",+ "text": "长会议的纪要要整理半分钟以上,原来页面一直没动静,还写着“生成纪要”;现在和 Mac 一样,没有纪要时写“这场会议还没有纪要”。"}]},diff --git a/windows/src/Cicada.Core/Notes.cs b/windows/src/Cicada.Core/Notes.csindex 74ac67b..1bd577f 100644--- a/windows/src/Cicada.Core/Notes.cs+++ b/windows/src/Cicada.Core/Notes.cs@@ -77,8 +77,22 @@ public sealed class NotesEngineChanged?.Invoke();}+ /// The finished meeting whose notes 生成纪要 is writing now (Notes.swift › generatingID): its+ /// page says so and the button waits, as a long meeting's notes take half a minute and more.+ public string? GeneratingId { get; private set; }+/// Notes for a finished meeting that has none.- public Task Generate(string id) => Update(id, final: true);+ public async Task Generate(string id)+ {+ lock (gate) { if (GeneratingId is not null) return; GeneratingId = id; }+ Changed?.Invoke();+ try { await Update(id, final: true); }+ finally+ {+ lock (gate) GeneratingId = null;+ Changed?.Invoke();+ }+ }void Tick(){diff --git a/windows/src/Cicada/MainWindow.cs b/windows/src/Cicada/MainWindow.csindex 33bf7bf..6cda6c0 100644--- a/windows/src/Cicada/MainWindow.cs+++ b/windows/src/Cicada/MainWindow.cs@@ -387,7 +387,7 @@ sealed class MainWindow : Window/// What the open page shows; a store change that leaves it the same doesn't redraw it.string? PageKey() => selected is not null && app.Store.Get(selected) is { } cur- ? $"{selected}|{tab}|{SessionStore.DisplayTitle(cur)}|{cur.Lines.Count}|{cur.Notes?.Covered}|{cur.Notes?.Final}|{app.Listen.Listening}"+ ? $"{selected}|{tab}|{SessionStore.DisplayTitle(cur)}|{cur.Lines.Count}|{cur.Notes?.Covered}|{cur.Notes?.Final}|{app.Listen.Listening}|{app.Notes.GeneratingId == selected}": null;void ShowDetail()@@ -476,7 +476,13 @@ sealed class MainWindow : Window{var tools = new StackPanel { Orientation = Orientation.Horizontal, VerticalAlignment = VerticalAlignment.Top };var hasNotes = s.Notes is { IsEmpty: false };- if (!hasNotes && !live) tools.Children.Add(Small(Ui.Button(L("生成纪要"), () => _ = app.Notes.Generate(s.Id), Ui.Kind.Primary, height: 32)));+ if (!hasNotes && !live)+ {+ var generating = app.Notes.GeneratingId == s.Id;+ var make = Small(Ui.Button(generating ? L("正在生成…") : L("生成纪要"), () => _ = app.Notes.Generate(s.Id), Ui.Kind.Primary, height: 32));+ make.IsEnabled = !generating;+ tools.Children.Add(make);+ }else{Button? copy = null;@@ -511,7 +517,7 @@ sealed class MainWindow : WindowFrameworkElement Notes(Session s, bool live){if (s.Notes is not { IsEmpty: false } n)- return Empty(live ? L("纪要会在会议进行中自动生成") : L("生成纪要"), "");+ return Empty(app.Notes.GeneratingId == s.Id ? L("正在整理纪要…") : live ? L("纪要会在会议进行中自动生成") : L("这场会议还没有纪要"), "");var article = new StackPanel();void Jump(double t) { tab = "transcript"; jumpTo = t; ShowDetail(); }