Skip to main content

Module UserInterfaceProvider

Module UserInterfaceProvider 

Source
Expand description

UserInterfaceProvider: drives quick-pick, input-box, and notification UI.

§UserInterfaceProvider (Environment)

Implements the UserInterfaceProvider trait for MountainEnvironment, orchestrating all modal UI interactions (dialogs, messages, quick picks) by communicating with the Sky frontend.

§Request-response pattern

Every blocking UI operation follows the same flow:

  1. Generate a UUID request ID.
  2. Insert a tokio::sync::oneshot::Sender in ApplicationState.UI.PendingUserInterfaceRequest.
  3. Emit a Tauri event to Sky with the ID and payload.
  4. Await the oneshot (timeout: 300 s); DispatchLogic::ResolveUIRequest resolves it when the user responds.

The shared helper SendUserInterfaceRequest (pub-crate) is also used by effect creators (applyEdit, showTextDocument, Task.Execute) that need the same request-ID / oneshot pattern instead of fire-and-forget emits.

§Operations

  • ShowMessage - modal message box (Info / Warning / Error)
  • ShowOpenDialog - native file/folder picker (via tauri-plugin-dialog; supports multi-select, folder-only, and file-type filters)
  • ShowSaveDialog - native save-file picker
  • ShowQuickPick - Sky sky://quickpick/show (camelCase wire shape)
  • ShowInputBox - Sky sky://input-box/show (camelCase wire shape)

§VS Code reference

  • vs/platform/dialogs/common/dialogs.ts
  • vs/platform/prompt/common/prompt.ts

Structs§

UserInterfaceRequest 🔒

Functions§

SendUserInterfaceRequest 🔒
A generic helper function to send a request to the Sky UI and wait for a response.