Skip to content

Desktop export shows "Exporting..." while the save dialog is still open #338

Closed

Description

@thcp

Split out of #337, which fixed the export busy state to track real completion instead of a fixed 1200 ms timer.

Problem

save_audio_file does two things in one command:

  1. blocking_save_file() - shows the native picker and waits for the user to choose a destination.
  2. Streams the response to a temp file and renames it.

The frontend awaits the whole command, so the button reads "Exporting..." from the moment it is clicked, including the entire time the file picker is open. Nothing is being exported yet during that phase, and if the user spends a while choosing a folder the label is simply wrong.

Cancelling the dialog is handled correctly (the command returns Ok(()), the state resets), so this is a labelling problem, not a stuck state.

Why it was accepted in #337

The alternative was keeping the old fixed timer, which was worse: it could not tell success from failure at all. Waiting on the real promise is right; it just makes the dialog phase visible.

Impact is limited because the picker is app-modal, so the user cannot interact with the export button while it is open.

Suggested fix

Split the Rust command in two:

  • pick_export_destination(filename) -> Option<PathBuf> - just the dialog.
  • download_to_path(url, path) - just the transfer.

The frontend then enters the busy state only after a destination comes back, and can show a genuine "Exporting..." for the transfer alone. That also opens the door to real progress reporting, since the streaming loop already knows the byte count and could emit progress events.

Files

  • desktop/src-tauri/src/main.rs - save_audio_file
  • static/js/player.js - _triggerDownload
  • static/js/main.js - flashBusy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions