add undo all button

This commit is contained in:
Josh Hawkins 2026-02-08 13:58:49 -06:00
parent f0bd84bf63
commit a779016f2c
3 changed files with 36 additions and 14 deletions

View File

@ -158,7 +158,8 @@
"resetToGlobal": "Reset to Global",
"resetToDefault": "Reset to Default",
"saveAll": "Save All",
"savingAll": "Saving All…"
"savingAll": "Saving All…",
"undoAll": "Undo All"
},
"menu": {
"system": "System",

View File

@ -824,7 +824,7 @@ export function ConfigSection({
disabled={isSaving || disabled}
className="flex min-w-36 flex-1 gap-2"
>
{t("undo", { ns: "common", defaultValue: "Undo" })}
{t("button.undo", { ns: "common", defaultValue: "Undo" })}
</Button>
)}
<Button

View File

@ -1048,7 +1048,10 @@ export default function Settings() {
disabled={isSavingAll}
className="flex w-full items-center justify-center gap-2"
>
{t("undo", { ns: "common", defaultValue: "Undo" })}
{t("button.undoAll", {
ns: "common",
defaultValue: "Undo All",
})}
</Button>
<Button
onClick={handleSaveAll}
@ -1164,18 +1167,36 @@ export default function Settings() {
<Heading as="h3" className="mb-0">
{t("menu.settings", { ns: "common" })}
</Heading>
<div className="flex items-center gap-2">
<div className="flex items-center gap-5">
{hasPendingChanges && (
<Button size="sm" onClick={handleSaveAll} disabled={isSavingAll}>
{isSavingAll ? (
<>
<ActivityIndicator className="mr-2" />
{t("button.savingAll", { ns: "common" })}
</>
) : (
t("button.saveAll", { ns: "common" })
)}
</Button>
<div className="flex flex-row gap-2 border-r border-secondary pr-5">
<Button
onClick={handleUndoAll}
variant="outline"
disabled={isSavingAll}
className="flex w-full items-center justify-center gap-2"
>
{t("button.undoAll", {
ns: "common",
defaultValue: "Undo All",
})}
</Button>
<Button
variant="select"
size="sm"
onClick={handleSaveAll}
disabled={isSavingAll}
>
{isSavingAll ? (
<>
<ActivityIndicator className="mr-2" />
{t("button.savingAll", { ns: "common" })}
</>
) : (
t("button.saveAll", { ns: "common" })
)}
</Button>
</div>
)}
{CAMERA_SELECT_BUTTON_PAGES.includes(page) && (
<>