Skip to content

Commit 5ee3a0d

Browse files
committed
feat: make buttons have unique tones in snapshot before replacing queue prompt
1 parent db921a0 commit 5ee3a0d

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
This documents the user-facing changes for each version
44

5+
## 0.4.2
6+
7+
- Make buttons have unique tones in snapshot before replacing queue prompt
8+
59
## 0.4.1
610

711
- Show a progress bar on toasts

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "queue-manager",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"private": true,
55
"scripts": {
66
"build": "spicetify-creator",

src/dialogs.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
import { ButtonTone } from "./types";
22

33
type ConfirmDialogOptions = {
4-
title?: string;
4+
title: string;
55
message: string;
66
confirmLabel?: string;
77
cancelLabel?: string;
8-
tone?: ButtonTone;
8+
tone: ButtonTone;
99
extraLabel?: string;
1010
extraTone?: ButtonTone;
1111
};
1212

1313
type PromptDialogOptions = {
14-
title?: string;
15-
message?: string;
14+
title: string;
15+
message: string;
1616
confirmLabel?: string;
1717
cancelLabel?: string;
18-
tone?: ButtonTone;
18+
tone: ButtonTone;
1919
defaultValue?: string;
2020
placeholder?: string;
2121
};
@@ -45,7 +45,7 @@ type ConfirmDialogResult = "confirm" | "cancel" | "extra";
4545
export function showConfirmDialog(options: ConfirmDialogOptions): Promise<ConfirmDialogResult> {
4646
if (dialogOpen) return Promise.resolve("cancel");
4747
dialogOpen = true;
48-
const { title, message, confirmLabel = "Confirm", cancelLabel = "Cancel", tone, extraLabel, extraTone } = options;
48+
const { title, message, confirmLabel = "Confirm", cancelLabel = "Cancel", tone, extraLabel, extraTone = "subtle" } = options;
4949

5050
return new Promise(resolve => {
5151
const backdrop = createBackdrop();
@@ -86,8 +86,8 @@ export function showConfirmDialog(options: ConfirmDialogOptions): Promise<Confir
8686
extraBtn.type = "button";
8787
const extraToneClass = getToneClass(extraTone);
8888
const extraClasses = ["qs-btn"];
89-
if (extraToneClass === "default") extraClasses.push("subtle");
90-
else extraClasses.push(extraToneClass);
89+
if (extraToneClass !== "default") extraClasses.push(extraToneClass);
90+
else extraClasses.push("primary");
9191
extraBtn.className = extraClasses.join(" ");
9292
extraBtn.textContent = extraLabel;
9393
}

src/ui.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ export function openManagerModal(ui: UIHandlers): void {
504504
confirmLabel: "Save snapshot",
505505
cancelLabel: "Skip",
506506
extraLabel: "Cancel",
507-
extraTone: "subtle",
507+
extraTone: "danger",
508508
tone: "primary",
509509
});
510510
if (shouldSave === "extra") {

0 commit comments

Comments
 (0)