diff --git a/src/settings/SwitchesSection.tsx b/src/settings/SwitchesSection.tsx index ef000331..368d5852 100644 --- a/src/settings/SwitchesSection.tsx +++ b/src/settings/SwitchesSection.tsx @@ -410,6 +410,7 @@ export function SwitchesSection({ controller, onDraftChange, suspended = false, const remoteRows = slots .map((slot, index) => ({ slot, index })) .filter(({ slot }) => slot.pressAction !== null); + const hasSwitches = settings.bindings.length > 0 || remoteRows.length > 0; const freeSlots = slots .map((slot, index) => (slot.pressAction === null ? index : -1)) .filter((index) => index >= 0); @@ -673,11 +674,10 @@ export function SwitchesSection({ controller, onDraftChange, suspended = false, /> )} - {!draft && } - +

{pending || remote.pending ? "Saving switches..." @@ -685,6 +685,9 @@ export function SwitchesSection({ controller, onDraftChange, suspended = false, ? "Switch assignments have unsaved changes." : "Saved automatically."}

+ {/* One fixed place in every state, so focus survives switches loading. */} + {!draft && } +
{remote.error && (
{remote.error} @@ -713,13 +716,14 @@ export function SwitchesSection({ controller, onDraftChange, suspended = false, )}
)} - {!settings.bindings.length && !remoteRows.length && !draft ? ( + {!hasSwitches && !draft ? (