fix: default logs off, suppress webview context menu, sort queue rows, defer keychain access to user action

- Disable log capture by default in both backend (LOG_PAUSED=true) and
  frontend (isPaused=true) to avoid unnecessary disk I/O and battery drain.
- Add a global contextmenu listener that prevents the webview's default
  right-click menu (Reload, etc.) so the app behaves like a native macOS
  window. Custom context menus in DownloadItem, LogsView, and Sidebar
  still work because their handlers preventDefault() before the document
  listener fires.
- Sort the download table by queuePosition when viewing a specific queue
  so the move-up/down controls produce a visible reorder instead of a
  silent position swap with no UI feedback.
- Rework the keychain access flow to eliminate the OS credential prompt
  that appeared before the app's own KeychainPermissionModal after every
  binary update. hydrate_extension_pairing_token now always skips the
  keychain; only the explicit Grant Access button (grant_keychain_access)
  triggers the OS prompt, which is user-initiated and therefore acceptable
  even when macOS trust resets after a code-signature change.
This commit is contained in:
NimBold
2026-06-25 02:03:19 +03:30
parent 47373b4565
commit 0a647cd612
6 changed files with 38 additions and 16 deletions
+1
View File
@@ -553,6 +553,7 @@ pub fn load_settings(connection: &Connection) -> Result<Option<String>, String>
.map_err(|error| format!("failed to load settings: {error}"))
}
#[allow(dead_code)]
pub fn is_keychain_access_granted(connection: &Connection) -> Result<bool, String> {
let Some(settings) = load_settings(connection)? else {
return Ok(false);
+7 -2
View File
@@ -3435,7 +3435,12 @@ fn hydrate_extension_pairing_token(
app_state: tauri::State<'_, AppState>,
) -> Result<PairingTokenHydration, String> {
let mut connection = database.lock()?;
let skip_keychain = !crate::db::is_keychain_access_granted(&connection).unwrap_or(false);
// Always skip the keychain during automatic hydration so the operating
// system never presents a credential-access prompt before the app's own
// modal is visible. The frontend will display the KeychainPermissionModal
// and only call grant_keychain_access — which touches the keychain — after
// the user explicitly clicks "Grant Access".
let skip_keychain = true;
match crate::db::hydrate_pairing_token(&mut connection, skip_keychain) {
Ok((token, token_changed)) => {
if let Ok(mut pairing_token) = app_state.extension_pairing_token.write() {
@@ -4210,7 +4215,7 @@ mod tests {
}
}
static LOG_PAUSED: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
static LOG_PAUSED: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(true);
#[tauri::command]
fn toggle_log_pause(pause: bool) {