# Dialogs Helder asks you something in three ways: a confirm dialog before a risky action, a small name prompt for new and renamed entries, and the macOS unsaved-changes alert. This page shows each one, what it says, and which keys answer it. [Guide index](index.md) · Related: [Right-click menu](right-click-menu.md), [Git](git.md), [Explorer](explorer.md), [File view](file-view.md), [Notifications](notifications.md) ## At a glance ```text +----------------------------------------------------------------------------+ |//////////////////////////// dimmed window /////////////////////////////////| |////////// +------------------------------------------------+ ////////////| |////////// | (1) Discard changes to app/Http/User.php? | ////////////| |////////// | | ////////////| |////////// | (2) This reverts the file to the last commit | ////////////| |////////// | and cannot be undone. | ////////////| |////////// | | ////////////| |////////// | (3)[ Cancel esc ] (4)[ Discard enter ] | ////////////| |////////// +------------------------------------------------+ ////////////| |////////////////////////////////////////////////////////////////////////////| +----------------------------------------------------------------------------+ ``` 1. **Title**: the question, often with the path it is about. 2. **Body**: what will happen. Not every confirm dialog has one. 3. **Cancel**: closes the dialog and does nothing. Its key is `Esc`. 4. **Confirm button**: amber-deep, named after the action (Discard, Delete, Stage, Unstage). Its key is `Enter`. ## Features ### Confirm dialog The confirm dialog sits on top of a dimmed window. Nothing else takes keys while it is open. - `Enter` or a click on the confirm button runs the action. - `Esc`, a click on **Cancel**, or a click on the dimmed area outside cancels. Nothing changes. Helder shows a confirm dialog for these actions: | Action | Title | Body | Button | When | |---|---|---|---|---| | Discard changes | `Discard changes to ?` | `This reverts the file to the last commit and cannot be undone.` | Discard | When `git.confirmDiscard` is on (default) | | Stage changes | `Stage ?` | none | Stage | Only when `git.confirmStage` is on | | Unstage changes | `Unstage ?` | none | Unstage | Only when `git.confirmUnstage` is on | | Delete file | `Delete file?` | ` will be permanently deleted.` | Delete | Always | | Delete folder | `Delete folder?` | `/ and everything inside it will be permanently deleted.` | Delete | Always | #### Discard changes Comes from **Discard changes** on a [Git](git.md) row. On confirm, the file goes back to the last commit, both its staged and unstaged changes. A new file is deleted. An open copy in the [File view](file-view.md) reloads. A [notification](notifications.md) says `Discarded changes`. #### Stage and unstage Come from the hover `+` / `−` on a git row, or from the [right-click menu](right-click-menu.md#git-rows), but only when you turned the matching setting on. **Stage all** and **Unstage all** never ask. #### Delete file or folder Comes from **Delete file** or **Delete folder** in the [Explorer](explorer.md). It always asks. On confirm: - The file, or the folder with everything inside it, is deleted for good. It does not go to the Trash. - An open file that was deleted closes in the File view. - A notification says `Deleted file` or `Deleted folder`, or `Delete failed`. ### Name prompt The name prompt is a small panel for **New file**, **New folder**, **Rename file** and **Rename folder**. It opens where the right-click menu stood. The window is not dimmed. ```text +------------------------------------------------+ | (1) [doc] New file (2)esc | | +--------------------------------------------+ | | | (3) file name... | | | +--------------------------------------------+ | | (4) creates [ app/Http/... ] | | (5) enter create file esc cancel | +------------------------------------------------+ ``` 1. **Title**: a file or folder icon in amber, and `New file`, `New folder`, `Rename file` or `Rename folder`. 2. **Esc chip**: a reminder that `Esc` closes the prompt. 3. **Name field**: has the keyboard as soon as the prompt opens. The hint reads `file name…` or `folder name…`. 4. **Preview**: the path that `Enter` will produce, in an amber chip. It reads `creates` for a new entry and `renames to` for a rename. It shows `…` while the name cannot be used. 5. **Footer**: the keys: `↵ create file`, `↵ create folder`, `↵ rename file` or `↵ rename folder`, and `esc cancel`. How it works: - Type a name. The preview follows each key. - `Enter` creates or renames, then closes the prompt. - `Esc`, or a click anywhere outside the panel, cancels. - For a rename, the field starts with the current name. Only the part before the extension is selected, so typing a new name keeps `.php` or `.md`. What happens after `Enter`: - **New file**: the file is created empty and opens in the [File view](file-view.md). Its folders expand in the [Explorer](explorer.md). - **New folder**: the folder is created and expands. - **Rename**: the entry gets its new name. An open file stays open under the new name. - A notification confirms: `Created file`, `Created folder`, `Renamed file` or `Renamed folder`, with the new path. #### Names the prompt accepts There are no error messages inside the prompt. Instead, `Enter` does nothing while the preview shows `…`. That happens when: - The name is empty or only spaces. - For a rename: the name has a `/`, is `.` or `..`, or is the same as the current name. For **New file** and **New folder**, a name with slashes creates the folders on the way. `tests/Unit/MathTest.php` creates `tests/Unit/` when it does not exist yet. Leading and trailing slashes are dropped. Spaces around the name are trimmed. A rename that only changes capitals (`readme.md` to `README.md`) works. When a file or folder with that name already exists, nothing is overwritten. The prompt closes and a notification says `Create failed` or `Rename failed`, with the name. ### Unsaved changes When the open file has unsaved edits and you are about to lose them, Helder shows the standard macOS alert: ```text +------------------------------------------------------+ | (!) Save changes to UserController.php? | | | | app/Http/UserController.php has unsaved edits. | | They are lost if you close without saving. | | | | [ Save ] [ Don't Save ] [ Cancel ] | +------------------------------------------------------+ ``` It appears when you: - open another file, or the same file again, from any place; - close the file with `Cmd+W`; - close the window or switch to another project. Each file with unsaved edits asks in turn. The buttons: - **Save** writes the file, then goes ahead. When the save fails, the file stays open and nothing else happens. - **Don't Save** drops the edits and goes ahead. - **Cancel** keeps the file, its edits and the selection in the [Explorer](explorer.md). Nothing happens. `Enter` picks **Save**, `Esc` picks **Cancel**, as in every macOS alert. With `editor.autoSave` on, opening another file saves the open one silently, without this alert. ## Keyboard | Keys | Action | |---|---| | `Enter` | Confirm dialog: run the action. Name prompt: create or rename. Unsaved alert: Save | | `Esc` | Cancel any of the three | ## Settings | Setting | Default | Effect | |---|---|---| | `git.confirmDiscard` | `true` | Ask before Discard changes | | `git.confirmStage` | `false` | Ask before staging one file | | `git.confirmUnstage` | `false` | Ask before unstaging one file | | `editor.autoSave` | `false` | Save the open file silently instead of asking, when you open another file | ## Related - [Right-click menu](right-click-menu.md): where most of these dialogs start. - [Git](git.md): discard, stage and unstage. - [Explorer](explorer.md): new, rename and delete. - [File view](file-view.md): saving, and the unsaved-edits dot. - [Notifications](notifications.md): the message after each action. - [Configuration](configuration.md): where the settings live.