feat(trust): let users add trusted folders from settings (#1812)

* feat(trust): let users add trusted folders from settings

The trusted-locations check already matches projects by path prefix, but
the only way to populate it was the "Trust projects in…" checkbox on the
first-open dialog — a folder could never be trusted ahead of time.

Add a project_trust_add_location command that canonicalizes the picked
directory, rejects non-directories, and deduplicates, plus an "Add
folder…" button on the Project Trust settings page backed by the native
directory picker.

Fixes #1743

* fix(trust): translate the trusted-location additions into Chinese

The zh source-text catalog must cover every literal UI text; the three
new strings in the trusted-locations settings page were missing.
Цей коміт міститься в:
arookieofc authored and GitHub committed 2026-11-06 22:08:10 +08:00
1 джерело 954ad354a1
коміт b54a745d6d
9 files changed
+115 -4

No files matched your search

+7
Переглянути файл
@@ -314,6 +314,13 @@ pub async fn project_trust_set(
Ok(())
}
#[tauri::command]
#[specta::specta]
pub async fn project_trust_add_location(state: State<'_, AppState>, path: PathBuf) -> IdeResult<()> {
state.trust.add_location(&path)?;
state.host.refresh_project_trust().await
}
#[tauri::command]
#[specta::specta]
pub async fn project_trust_remove_location(state: State<'_, AppState>, path: PathBuf) -> IdeResult<()> {
+1
Переглянути файл
@@ -75,6 +75,7 @@ pub fn builder() -> tauri_specta::Builder<tauri::Wry> {
app::project_trust_status,
app::project_trust_list,
app::project_trust_set,
app::project_trust_add_location,
app::project_trust_remove_location,
workspace::workspace_create,
workspace::workspace_attach,