Everything written this session that has not been through the device: rounds 43 to 48 (each patch adversarially verified, 43's transient-notice expectation fixed), a partial round 49, the pipeline scripts, the Android Auto design and the icon comparison mock. Also the two harness changes that were never A/B'd — adaptive waits, which may only shorten a declared wait and never lengthen it, and a ship that runs the mock walk and the deploy at the same time. The A/B and its 255-step baseline are in handoff/tools; main stays at what the phone has actually walked.
34 lines
1.1 KiB
Plaintext
34 lines
1.1 KiB
Plaintext
/// A FILE from the phone: the document picker with the caller's own MIME
|
|
/// filter, answered with a path the Rust side can open. A document already
|
|
/// on this phone's storage is handed over as it lies; one that has no path
|
|
/// is copied into the app's cache under its own name, and only as far as
|
|
/// `max_copy_bytes` allows — zero refuses the copy, which is what a pick
|
|
/// that could be hundreds of megabytes wants.
|
|
#[tauri::command]
|
|
async fn pick_file<R: Runtime>(
|
|
app: tauri::AppHandle<R>,
|
|
mime_types: Option<String>,
|
|
max_copy_bytes: Option<u32>,
|
|
) -> Result<PickedFile, String> {
|
|
#[cfg(mobile)]
|
|
{
|
|
use tauri::Manager;
|
|
let storage = app.state::<Storage<R>>();
|
|
storage
|
|
.0
|
|
.run_mobile_plugin::<PickedFile>(
|
|
"pickFile",
|
|
PickFileArgs {
|
|
mime_types,
|
|
max_copy_bytes: max_copy_bytes.unwrap_or(0),
|
|
},
|
|
)
|
|
.map_err(|e| e.to_string())
|
|
}
|
|
#[cfg(not(mobile))]
|
|
{
|
|
let _ = (app, mime_types, max_copy_bytes);
|
|
Err("the file picker here is the desktop's dialog".into())
|
|
}
|
|
}
|