Skip to content

Commit ac80b7b

Browse files
committed
feat(help): include hashed Device ID in ‘Copy System Info’ via new get_device_id Tauri command; hide mic/accessibility permission lines on Windows to avoid confusion
1 parent b2664f8 commit ac80b7b

File tree

4 files changed

+30
-9
lines changed

4 files changed

+30
-9
lines changed

src-tauri/src/commands/device.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
use crate::license::device;
2+
3+
/// Returns the stable, privacy-preserving device identifier used for licensing
4+
#[tauri::command]
5+
pub async fn get_device_id() -> Result<String, String> {
6+
device::get_device_hash()
7+
}

src-tauri/src/commands/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ pub mod ai;
22
pub mod audio;
33
pub mod clipboard;
44
pub mod debug;
5+
pub mod device;
56
pub mod key_normalizer;
67
pub mod keyring;
78
pub mod license;

src-tauri/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ use commands::{
4545
cancel_download, delete_model, download_model, get_model_status, list_downloaded_models,
4646
preload_model, verify_model,
4747
},
48+
device::get_device_id,
4849
permissions::{
4950
check_accessibility_permission, check_microphone_permission,
5051
request_accessibility_permission, request_microphone_permission,
@@ -1497,6 +1498,7 @@ pub fn run() -> Result<(), Box<dyn std::error::Error>> {
14971498
keyring_has,
14981499
get_log_directory,
14991500
open_logs_folder,
1501+
get_device_id,
15001502
])
15011503
.on_window_event(|window, event| {
15021504
match event {

src/components/sections/HelpSection.tsx

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,33 @@ export function HelpSection() {
5858
useEffect(() => {
5959
const fetchSystemInfo = async () => {
6060
try {
61-
const [appVer, os, osVer] = await Promise.all([
61+
const [appVer, os, osVer, deviceId] = await Promise.all([
6262
getVersion(),
6363
platform(),
64-
osVersion()
64+
osVersion(),
65+
// Best-effort: if backend not ready, ignore and continue
66+
invoke<string>('get_device_id').catch(() => 'Unknown')
6567
]);
6668
setAppVersion(appVer);
6769
setPlatformName(`${os} ${osVer}`);
6870

6971
// Prepare diagnostics info
70-
const diag = `
71-
App Version: ${appVer}
72-
OS: ${os} ${osVer}
73-
Model: ${settings?.current_model || 'None selected'}
74-
Microphone Permission: ${canRecord ? 'Granted' : 'Not granted'}
75-
Accessibility Permission: ${canAutoInsert ? 'Granted' : 'Not granted'}
76-
`.trim();
72+
const lines: string[] = [
73+
`App Version: ${appVer}`,
74+
`OS: ${os} ${osVer}`,
75+
`Device ID: ${deviceId}`,
76+
`Model: ${settings?.current_model || 'None selected'}`,
77+
];
78+
79+
// Hide permission lines on Windows (not required there)
80+
if (os !== 'windows') {
81+
lines.push(
82+
`Microphone Permission: ${canRecord ? 'Granted' : 'Not granted'}`,
83+
`Accessibility Permission: ${canAutoInsert ? 'Granted' : 'Not granted'}`
84+
);
85+
}
86+
87+
const diag = lines.join('\n');
7788
setDiagnostics(diag);
7889
} catch (error) {
7990
console.error('Failed to get system info:', error);

0 commit comments

Comments
 (0)