Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/images/pr-716/cumulative-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/pr-716/heatmap-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/pr-716/heatmap-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/pr-716/hover-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/pr-716/settings-toggle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/pr-716/weekly-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions openless-all/app/src-tauri/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,9 @@ pub struct UserPreferences {
/// UI theme: follow OS, force light, or force dark. Frontend applies via data-ol-theme.
#[serde(default)]
pub theme_mode: ThemeMode,
/// Whether the Overview page shows the annual activity heatmap. Default true.
#[serde(default = "default_true")]
pub show_overview_activity_heatmap: bool,
/// 流式输入:润色 SSE 一边到达一边逐字模拟键盘事件输出到当前焦点。开启后用户感知到
/// 的处理时延显著降低(润色 LLM 第一个 token 即开始落字)。
///
Expand Down Expand Up @@ -953,6 +956,8 @@ struct UserPreferencesWire {
#[serde(default)]
theme_mode: ThemeMode,
#[serde(default = "default_true")]
show_overview_activity_heatmap: bool,
#[serde(default = "default_true")]
streaming_insert: bool,
#[serde(default)]
streaming_insert_default_migrated: bool,
Expand Down Expand Up @@ -1045,6 +1050,7 @@ impl Default for UserPreferencesWire {
polish_context_window_minutes: prefs.polish_context_window_minutes,
start_minimized: prefs.start_minimized,
theme_mode: prefs.theme_mode,
show_overview_activity_heatmap: prefs.show_overview_activity_heatmap,
streaming_insert: prefs.streaming_insert,
streaming_insert_default_migrated: prefs.streaming_insert_default_migrated,
streaming_insert_save_clipboard: prefs.streaming_insert_save_clipboard,
Expand Down Expand Up @@ -1152,6 +1158,7 @@ impl<'de> Deserialize<'de> for UserPreferences {
polish_context_window_minutes: wire.polish_context_window_minutes,
start_minimized: wire.start_minimized,
theme_mode: wire.theme_mode,
show_overview_activity_heatmap: wire.show_overview_activity_heatmap,
streaming_insert,
streaming_insert_default_migrated: true,
streaming_insert_save_clipboard: wire.streaming_insert_save_clipboard,
Expand Down Expand Up @@ -1887,6 +1894,7 @@ impl Default for UserPreferences {
polish_context_window_minutes: default_polish_context_window_minutes(),
start_minimized: false,
theme_mode: ThemeMode::default(),
show_overview_activity_heatmap: true,
streaming_insert: true,
streaming_insert_default_migrated: true,
streaming_insert_save_clipboard: true,
Expand Down
20 changes: 19 additions & 1 deletion openless-all/app/src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,25 @@ export const en: typeof zhCN = {
metricNoData: 'No data',
historyLoadError: 'History load failed',
metricTotal: 'Total records',
metricTotalTrend: 'Local archive (max 200)',
metricTotalTrend: 'Local archive',
weekTitle: 'Last 7 days',
weekUnit: 'count / day',
activityTitle: 'Annual activity',
activityModeDaily: 'Daily',
activityMode: {
daily: 'Daily',
weekly: 'Weekly',
cumulative: 'Total',
},
activityUnit: 'Past year · {{days}} active days',
activityEmpty: 'No history in the past year.',
activityTooltip: '{{date}} · {{count}} records · {{chars}} chars',
activitySummaryDaily: '{{date}} used {{count}} records / {{chars}} chars',
activitySummaryWeekly: 'Week of {{start}} used {{count}} records / {{chars}} chars',
activitySummaryCumulative: 'Through week of {{start}} used {{count}} records / {{chars}} chars',
activityLegendLow: 'Less',
activityLegendHigh: 'More',
monthNames: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
recentTitle: 'Recent transcripts',
recentAll: 'View all →',
recentEmpty: 'No records yet. Press {{trigger}} to start your first recording.',
Expand Down Expand Up @@ -966,6 +982,8 @@ export const en: typeof zhCN = {
system: 'Follow system',
light: 'Light',
dark: 'Dark',
overviewActivityLabel: 'Show overview activity heatmap',
overviewActivityDesc: 'Show the daily / weekly / cumulative activity heatmap at the bottom of Overview. Turning this off does not delete history.',
},
remoteInput: {
title: 'Remote Input',
Expand Down
20 changes: 19 additions & 1 deletion openless-all/app/src/i18n/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,25 @@ export const ja: typeof zhCN = {
metricNoData: 'データなし',
historyLoadError: '履歴の読み込みに失敗',
metricTotal: '累計記録',
metricTotalTrend: 'ローカル保存(上限 200)',
metricTotalTrend: 'ローカル保存',
weekTitle: '直近 7 日',
weekUnit: '件 / 日',
activityTitle: '年間アクティビティ',
activityModeDaily: '毎日',
activityMode: {
daily: '毎日',
weekly: '毎週',
cumulative: '累計',
},
activityUnit: '過去 1 年 · {{days}} 日に記録',
activityEmpty: '過去 1 年の履歴はまだありません。',
activityTooltip: '{{date}} · {{count}} 件 · {{chars}} 文字',
activitySummaryDaily: '{{date}} に {{count}} 件 / {{chars}} 文字',
activitySummaryWeekly: '{{start}} の週に {{count}} 件 / {{chars}} 文字',
activitySummaryCumulative: '{{start}} の週まで累計 {{count}} 件 / {{chars}} 文字',
activityLegendLow: '少',
activityLegendHigh: '多',
monthNames: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
recentTitle: '最近の認識',
recentAll: 'すべて表示 →',
recentEmpty: '記録がありません。{{trigger}} を押して最初の録音を始めましょう。',
Expand Down Expand Up @@ -934,6 +950,8 @@ export const ja: typeof zhCN = {
system: 'システムに従う',
light: 'ライト',
dark: 'ダーク',
overviewActivityLabel: '概要の活動ヒートマップを表示',
overviewActivityDesc: '今日の概要の下部に日別 / 週別 / 累計の活動ヒートマップを表示します。オフにしても履歴は削除されません。',
},
remoteInput: {
title: 'リモート入力',
Expand Down
20 changes: 19 additions & 1 deletion openless-all/app/src/i18n/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,25 @@ export const ko: typeof zhCN = {
metricNoData: '데이터 없음',
historyLoadError: '기록 로드 실패',
metricTotal: '누적 기록',
metricTotalTrend: '로컬 보관(상한 200)',
metricTotalTrend: '로컬 보관',
weekTitle: '최근 7일',
weekUnit: '건/일',
activityTitle: '연간 활동',
activityModeDaily: '매일',
activityMode: {
daily: '매일',
weekly: '매주',
cumulative: '누적',
},
activityUnit: '지난 1년 · {{days}}일 기록 있음',
activityEmpty: '지난 1년 동안 기록이 없습니다.',
activityTooltip: '{{date}} · {{count}}건 · {{chars}}자',
activitySummaryDaily: '{{date}} 사용 {{count}}건 / {{chars}}자',
activitySummaryWeekly: '{{start}} 주간 사용 {{count}}건 / {{chars}}자',
activitySummaryCumulative: '{{start}} 주까지 누적 사용 {{count}}건 / {{chars}}자',
activityLegendLow: '적음',
activityLegendHigh: '많음',
monthNames: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
recentTitle: '최근 인식',
recentAll: '전체 보기 →',
recentEmpty: '아직 기록이 없습니다. {{trigger}} 를 눌러 첫 녹음을 시작하세요.',
Expand Down Expand Up @@ -934,6 +950,8 @@ export const ko: typeof zhCN = {
system: '시스템 따르기',
light: '라이트',
dark: '다크',
overviewActivityLabel: '개요 활동 히트맵 표시',
overviewActivityDesc: '오늘의 개요 하단에 일별 / 주별 / 누적 활동 히트맵을 표시합니다. 꺼도 기록은 삭제되지 않습니다.',
},
remoteInput: {
title: '원격 입력',
Expand Down
20 changes: 19 additions & 1 deletion openless-all/app/src/i18n/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,25 @@ export const zhCN = {
metricNoData: '暂无数据',
historyLoadError: '历史读取失败',
metricTotal: '累计记录',
metricTotalTrend: '本机存档 (上限 200)',
metricTotalTrend: '本机存档',
weekTitle: '近 7 天',
weekUnit: '条数 / 天',
activityTitle: '年度活动',
activityModeDaily: '每日',
activityMode: {
daily: '每日',
weekly: '每周',
cumulative: '累计',
},
activityUnit: '过去一年 · {{days}} 天有记录',
activityEmpty: '过去一年还没有历史记录。',
activityTooltip: '{{date}} · {{count}} 条 · {{chars}} 字',
activitySummaryDaily: '{{date}} 使用了 {{count}} 条 / {{chars}} 字',
activitySummaryWeekly: '{{start}} 当周使用了 {{count}} 条 / {{chars}} 字',
activitySummaryCumulative: '截至 {{start}} 当周累计使用了 {{count}} 条 / {{chars}} 字',
activityLegendLow: '少',
activityLegendHigh: '多',
monthNames: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
recentTitle: '最近识别',
recentAll: '全部记录 →',
recentEmpty: '还没有记录。按 {{trigger}} 开始第一次录音。',
Expand Down Expand Up @@ -964,6 +980,8 @@ export const zhCN = {
system: '跟随系统',
light: '浅色',
dark: '深色',
overviewActivityLabel: '显示概况活动热图',
overviewActivityDesc: '在今日概况底部显示每日 / 每周 / 累计活动热图;关闭不会删除历史记录。',
},
remoteInput: {
title: '远程输入',
Expand Down
20 changes: 19 additions & 1 deletion openless-all/app/src/i18n/zh-TW.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,25 @@ export const zhTW: typeof zhCN = {
metricNoData: '暫無數據',
historyLoadError: '歷史讀取失敗',
metricTotal: '累計記錄',
metricTotalTrend: '本機存檔 (上限 200)',
metricTotalTrend: '本機存檔',
weekTitle: '近 7 天',
weekUnit: '條數 / 天',
activityTitle: '年度活動',
activityModeDaily: '每日',
activityMode: {
daily: '每日',
weekly: '每週',
cumulative: '累計',
},
activityUnit: '過去一年 · {{days}} 天有記錄',
activityEmpty: '過去一年還沒有歷史記錄。',
activityTooltip: '{{date}} · {{count}} 條 · {{chars}} 字',
activitySummaryDaily: '{{date}} 使用了 {{count}} 條 / {{chars}} 字',
activitySummaryWeekly: '{{start}} 當週使用了 {{count}} 條 / {{chars}} 字',
activitySummaryCumulative: '截至 {{start}} 當週累計使用了 {{count}} 條 / {{chars}} 字',
activityLegendLow: '少',
activityLegendHigh: '多',
monthNames: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
recentTitle: '最近識別',
recentAll: '全部記錄 →',
recentEmpty: '還沒有記錄。按 {{trigger}} 開始第一次錄音。',
Expand Down Expand Up @@ -932,6 +948,8 @@ export const zhTW: typeof zhCN = {
system: '跟隨系統',
light: '淺色',
dark: '深色',
overviewActivityLabel: '顯示概況活動熱圖',
overviewActivityDesc: '在今日概況底部顯示每日 / 每週 / 累計活動熱圖;關閉不會刪除歷史記錄。',
},
remoteInput: {
title: '遠端輸入',
Expand Down
52 changes: 35 additions & 17 deletions openless-all/app/src/lib/ipc/mock-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export let mockSettings: UserPreferences = {
polishContextWindowMinutes: 5,
startMinimized: false,
themeMode: "system",
showOverviewActivityHeatmap: true,
updateChannel: "stable",
streamingInsert: true,
streamingInsertDefaultMigrated: true,
Expand Down Expand Up @@ -431,23 +432,40 @@ export const mockMicrophoneDevices: MicrophoneDevice[] = [
{ name: "USB Microphone", isDefault: false },
]

export const mockHistory: DictationSession[] = OL_DATA.history.map((h, i) => ({
id: `mock-${i}`,
createdAt: new Date().toISOString(),
rawTranscript: h.preview,
finalText: h.preview,
mode: "structured",
stylePackId: "builtin.structured",
translationActive: false,
polishSource: null,
appBundleId: null,
appName: "VS Code",
insertStatus: "inserted",
errorCode: null,
durationMs: 600,
dictionaryEntryCount: 28,
hasAudioRecording: null,
}))
const mockHistoryOffsets = [0, 0, 0, 1, 1, 2, 3, 3, 4, 5, 6, 15, 32, 54, 91, 130, 178, 230, 292, 340]
const mockHistoryModes: PolishMode[] = ["structured", "light", "raw", "formal"]
const mockHistoryApps = ["VS Code", "Obsidian", "Chrome", "微信", "Word"]

function mockCreatedAt(dayOffset: number, index: number): string {
const source = OL_DATA.history[index % OL_DATA.history.length]
const [hours = 12, minutes = 0] = source.time.split(":").map(Number)
const date = new Date()
date.setDate(date.getDate() - dayOffset)
date.setHours(hours, minutes, 0, 0)
return date.toISOString()
}

export const mockHistory: DictationSession[] = mockHistoryOffsets.map((dayOffset, i) => {
const h = OL_DATA.history[i % OL_DATA.history.length]
const mode = mockHistoryModes[i % mockHistoryModes.length]
return {
id: `mock-${dayOffset}-${i}`,
createdAt: mockCreatedAt(dayOffset, i),
rawTranscript: h.preview,
finalText: h.preview,
mode,
stylePackId: `builtin.${mode}`,
translationActive: false,
polishSource: null,
appBundleId: null,
appName: mockHistoryApps[i % mockHistoryApps.length],
insertStatus: "inserted",
errorCode: null,
durationMs: 9000 + (i % 6) * 1800,
dictionaryEntryCount: 12 + (i % 5) * 4,
hasAudioRecording: null,
}
})

export const mockVocab: DictionaryEntry[] = OL_DATA.vocab.map((v, i) => ({
id: `vocab-${i}`,
Expand Down
1 change: 1 addition & 0 deletions openless-all/app/src/lib/stylePrefs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const previousPrefs: UserPreferences = {
polishContextWindowMinutes: 5,
startMinimized: false,
themeMode: 'system',
showOverviewActivityHeatmap: true,
updateChannel: 'stable',
streamingInsert: true,
streamingInsertDefaultMigrated: true,
Expand Down
2 changes: 2 additions & 0 deletions openless-all/app/src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ export interface UserPreferences {
startMinimized: boolean;
/** UI theme preference: follow OS, light, or dark. */
themeMode: ThemeMode;
/** Show the annual activity heatmap on the Overview page. Default true. */
showOverviewActivityHeatmap: boolean;
/** 自动更新渠道。'stable'(默认)= plugin-updater 仅检查正式版;
* 'beta' = Settings → About 出现手动下载 Beta 的入口。 */
updateChannel: UpdateChannel;
Expand Down
Loading