Skip to content

Commit 18ab325

Browse files
committed
Add quit confirmation, wire up wrapAsync, remove legacy shim, disable tray unmount when idle
- Confirm before quit (tray, Cmd+Q, sidebar) when a filesystem is mounted - Use wrapAsync/parseError in page components instead of raw String(e) - Remove startPolling/stopPolling shim from status store - Tray "Unmount" item starts disabled, syncs with mount state via effect
1 parent 5c33e6d commit 18ab325

18 files changed

Lines changed: 312 additions & 47 deletions

File tree

src-tauri/Cargo.lock

Lines changed: 67 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ dirs = "6"
2525
portable-pty = "0.9"
2626
tauri-plugin-process = "2.3.1"
2727
tauri-plugin-notification = "2.3.3"
28+
tauri-plugin-dialog = "2"
2829

2930
[target.'cfg(target_os = "macos")'.dependencies]
3031
objc2-app-kit = { version = "0.3", features = ["NSApplication", "NSRunningApplication"] }

src-tauri/capabilities/default.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"autostart:allow-disable",
1717
"autostart:allow-is-enabled",
1818
"process:default",
19-
"notification:default"
19+
"notification:default",
20+
"dialog:default"
2021
]
2122
}

src-tauri/gen/schemas/acl-manifests.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"default":{"identifier":"default","description":"Default capabilities for anylinuxfs-gui","local":true,"windows":["main"],"permissions":["core:default","shell:allow-execute","shell:allow-spawn","core:event:default","core:event:allow-emit","core:event:allow-listen","log:default","shell:allow-open","autostart:allow-enable","autostart:allow-disable","autostart:allow-is-enabled","process:default","notification:default"]}}
1+
{"default":{"identifier":"default","description":"Default capabilities for anylinuxfs-gui","local":true,"windows":["main"],"permissions":["core:default","shell:allow-execute","shell:allow-spawn","core:event:default","core:event:allow-emit","core:event:allow-listen","log:default","shell:allow-open","autostart:allow-enable","autostart:allow-disable","autostart:allow-is-enabled","process:default","notification:default","dialog:default"]}}

src-tauri/gen/schemas/desktop-schema.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2396,6 +2396,72 @@
23962396
"const": "core:window:deny-unminimize",
23972397
"markdownDescription": "Denies the unminimize command without any pre-configured scope."
23982398
},
2399+
{
2400+
"description": "This permission set configures the types of dialogs\navailable from the dialog plugin.\n\n#### Granted Permissions\n\nAll dialog types are enabled.\n\n\n\n#### This default permission set includes:\n\n- `allow-ask`\n- `allow-confirm`\n- `allow-message`\n- `allow-save`\n- `allow-open`",
2401+
"type": "string",
2402+
"const": "dialog:default",
2403+
"markdownDescription": "This permission set configures the types of dialogs\navailable from the dialog plugin.\n\n#### Granted Permissions\n\nAll dialog types are enabled.\n\n\n\n#### This default permission set includes:\n\n- `allow-ask`\n- `allow-confirm`\n- `allow-message`\n- `allow-save`\n- `allow-open`"
2404+
},
2405+
{
2406+
"description": "Enables the ask command without any pre-configured scope.",
2407+
"type": "string",
2408+
"const": "dialog:allow-ask",
2409+
"markdownDescription": "Enables the ask command without any pre-configured scope."
2410+
},
2411+
{
2412+
"description": "Enables the confirm command without any pre-configured scope.",
2413+
"type": "string",
2414+
"const": "dialog:allow-confirm",
2415+
"markdownDescription": "Enables the confirm command without any pre-configured scope."
2416+
},
2417+
{
2418+
"description": "Enables the message command without any pre-configured scope.",
2419+
"type": "string",
2420+
"const": "dialog:allow-message",
2421+
"markdownDescription": "Enables the message command without any pre-configured scope."
2422+
},
2423+
{
2424+
"description": "Enables the open command without any pre-configured scope.",
2425+
"type": "string",
2426+
"const": "dialog:allow-open",
2427+
"markdownDescription": "Enables the open command without any pre-configured scope."
2428+
},
2429+
{
2430+
"description": "Enables the save command without any pre-configured scope.",
2431+
"type": "string",
2432+
"const": "dialog:allow-save",
2433+
"markdownDescription": "Enables the save command without any pre-configured scope."
2434+
},
2435+
{
2436+
"description": "Denies the ask command without any pre-configured scope.",
2437+
"type": "string",
2438+
"const": "dialog:deny-ask",
2439+
"markdownDescription": "Denies the ask command without any pre-configured scope."
2440+
},
2441+
{
2442+
"description": "Denies the confirm command without any pre-configured scope.",
2443+
"type": "string",
2444+
"const": "dialog:deny-confirm",
2445+
"markdownDescription": "Denies the confirm command without any pre-configured scope."
2446+
},
2447+
{
2448+
"description": "Denies the message command without any pre-configured scope.",
2449+
"type": "string",
2450+
"const": "dialog:deny-message",
2451+
"markdownDescription": "Denies the message command without any pre-configured scope."
2452+
},
2453+
{
2454+
"description": "Denies the open command without any pre-configured scope.",
2455+
"type": "string",
2456+
"const": "dialog:deny-open",
2457+
"markdownDescription": "Denies the open command without any pre-configured scope."
2458+
},
2459+
{
2460+
"description": "Denies the save command without any pre-configured scope.",
2461+
"type": "string",
2462+
"const": "dialog:deny-save",
2463+
"markdownDescription": "Denies the save command without any pre-configured scope."
2464+
},
23992465
{
24002466
"description": "Allows the log command\n#### This default permission set includes:\n\n- `allow-log`",
24012467
"type": "string",

src-tauri/gen/schemas/macOS-schema.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2396,6 +2396,72 @@
23962396
"const": "core:window:deny-unminimize",
23972397
"markdownDescription": "Denies the unminimize command without any pre-configured scope."
23982398
},
2399+
{
2400+
"description": "This permission set configures the types of dialogs\navailable from the dialog plugin.\n\n#### Granted Permissions\n\nAll dialog types are enabled.\n\n\n\n#### This default permission set includes:\n\n- `allow-ask`\n- `allow-confirm`\n- `allow-message`\n- `allow-save`\n- `allow-open`",
2401+
"type": "string",
2402+
"const": "dialog:default",
2403+
"markdownDescription": "This permission set configures the types of dialogs\navailable from the dialog plugin.\n\n#### Granted Permissions\n\nAll dialog types are enabled.\n\n\n\n#### This default permission set includes:\n\n- `allow-ask`\n- `allow-confirm`\n- `allow-message`\n- `allow-save`\n- `allow-open`"
2404+
},
2405+
{
2406+
"description": "Enables the ask command without any pre-configured scope.",
2407+
"type": "string",
2408+
"const": "dialog:allow-ask",
2409+
"markdownDescription": "Enables the ask command without any pre-configured scope."
2410+
},
2411+
{
2412+
"description": "Enables the confirm command without any pre-configured scope.",
2413+
"type": "string",
2414+
"const": "dialog:allow-confirm",
2415+
"markdownDescription": "Enables the confirm command without any pre-configured scope."
2416+
},
2417+
{
2418+
"description": "Enables the message command without any pre-configured scope.",
2419+
"type": "string",
2420+
"const": "dialog:allow-message",
2421+
"markdownDescription": "Enables the message command without any pre-configured scope."
2422+
},
2423+
{
2424+
"description": "Enables the open command without any pre-configured scope.",
2425+
"type": "string",
2426+
"const": "dialog:allow-open",
2427+
"markdownDescription": "Enables the open command without any pre-configured scope."
2428+
},
2429+
{
2430+
"description": "Enables the save command without any pre-configured scope.",
2431+
"type": "string",
2432+
"const": "dialog:allow-save",
2433+
"markdownDescription": "Enables the save command without any pre-configured scope."
2434+
},
2435+
{
2436+
"description": "Denies the ask command without any pre-configured scope.",
2437+
"type": "string",
2438+
"const": "dialog:deny-ask",
2439+
"markdownDescription": "Denies the ask command without any pre-configured scope."
2440+
},
2441+
{
2442+
"description": "Denies the confirm command without any pre-configured scope.",
2443+
"type": "string",
2444+
"const": "dialog:deny-confirm",
2445+
"markdownDescription": "Denies the confirm command without any pre-configured scope."
2446+
},
2447+
{
2448+
"description": "Denies the message command without any pre-configured scope.",
2449+
"type": "string",
2450+
"const": "dialog:deny-message",
2451+
"markdownDescription": "Denies the message command without any pre-configured scope."
2452+
},
2453+
{
2454+
"description": "Denies the open command without any pre-configured scope.",
2455+
"type": "string",
2456+
"const": "dialog:deny-open",
2457+
"markdownDescription": "Denies the open command without any pre-configured scope."
2458+
},
2459+
{
2460+
"description": "Denies the save command without any pre-configured scope.",
2461+
"type": "string",
2462+
"const": "dialog:deny-save",
2463+
"markdownDescription": "Denies the save command without any pre-configured scope."
2464+
},
23992465
{
24002466
"description": "Allows the log command\n#### This default permission set includes:\n\n- `allow-log`",
24012467
"type": "string",

src-tauri/src/commands/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub mod apk;
88
pub mod action;
99

1010
pub use disk::*;
11-
pub use status::*;
11+
pub use status::{check_cli, get_mount_status, get_mount_status_sync};
1212
pub use log::{get_log_content, start_log_stream, start_disk_watcher, stop_watchers, WatcherState};
1313
pub use config::*;
1414
pub use shell::{start_shell, write_shell, resize_shell, stop_shell, PtyState};

src-tauri/src/commands/status.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ pub async fn get_mount_status() -> Result<MountInfo, String> {
144144
.map_err(|e| format!("Task error: {}", e))?
145145
}
146146

147-
fn get_mount_status_sync() -> Result<MountInfo, String> {
147+
pub fn get_mount_status_sync() -> Result<MountInfo, String> {
148148
// First, try the socket approach
149149
if let Some(info) = try_socket_status() {
150150
return Ok(info);

0 commit comments

Comments
 (0)