PM: merge H4 string and path settings controls, live assist settings
Some checks are pending
ci / ci (macos-15) (push) Waiting to run
ci / ci (ubuntu-24.04) (push) Waiting to run
ci / ci (windows-2025) (push) Waiting to run

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-10-25 13:20:26 +01:00
commit e969f6497c
19 changed files with 1149 additions and 41 deletions

View file

@ -91,7 +91,8 @@ fn run(args: &args::Args) -> Result<(), String> {
engine_execute,
engine_execute_waiting,
engine_list_commands,
engine_ready
engine_ready,
pick_file
])
.setup(move |app| {
let setup_host = setup_slot.get().ok_or("the host is not ready")?;
@ -259,6 +260,19 @@ fn engine_ready(host: tauri::State<'_, Arc<Host>>) {
host.replay_to_window();
}
/// IPC: shows the native file picker for a path setting's "Browse…"
/// button and returns the chosen file, or `None` when the user cancels or
/// picks something that is not a local path. `async` keeps the blocking
/// picker off the main thread. The frontend stores the path through
/// `settings.set`, so the setting itself stays an engine command.
#[tauri::command(async)]
fn pick_file(app: tauri::AppHandle, title: String) -> Option<String> {
use tauri_plugin_dialog::DialogExt;
let picked = app.dialog().file().set_title(title).blocking_pick_file()?;
let path = picked.into_path().ok()?;
Some(path.to_string_lossy().into_owned())
}
#[cfg(test)]
mod tests {
use super::*;