diff --git a/web/messages/de.json b/web/messages/de.json index a2ffc91..c460e8c 100644 --- a/web/messages/de.json +++ b/web/messages/de.json @@ -60,6 +60,7 @@ "display_preset_workstation": "Workstation", "display_keep_alive": "Nach Trennung aktiv halten", "display_keep_alive_off": "Aus", + "display_keep_alive_keep": "Behalten für", "display_keep_alive_seconds": "Sekunden", "display_topology": "Topologie", "display_topology_auto": "Automatisch", @@ -85,7 +86,7 @@ "display_custom_desc": "Jede Option selbst festlegen.", "display_preset_current": "Aktiv", "display_preset_soon": "in Kürze", - "display_keep_alive_help": "Wie lange eine Anzeige (und bei gamescope ihr Spiel) nach dem Trennen bestehen bleibt. 0 = sofort abbauen.", + "display_keep_alive_help": "„Aus“ baut die Anzeige sofort beim Trennen ab. Halte sie (und bei gamescope ihr Spiel) am Leben, damit ein schnelles Wiederverbinden sofort fortsetzt, statt neu aufzubauen.", "display_topology_help": "Was mit den physischen Monitoren des Hosts während des Streamings geschieht.", "display_conflict": "Wenn ein weiterer Client verbindet", "display_conflict_help": "Was passiert, wenn ein zweiter Client verbindet, während bereits gestreamt wird, und eine andere Auflösung anfragt.", diff --git a/web/messages/en.json b/web/messages/en.json index 0db8281..2cc03d4 100644 --- a/web/messages/en.json +++ b/web/messages/en.json @@ -60,6 +60,7 @@ "display_preset_workstation": "Workstation", "display_keep_alive": "Keep alive after disconnect", "display_keep_alive_off": "Off", + "display_keep_alive_keep": "Keep for", "display_keep_alive_seconds": "seconds", "display_topology": "Topology", "display_topology_auto": "Automatic", @@ -85,7 +86,7 @@ "display_custom_desc": "Set every option yourself.", "display_preset_current": "Active", "display_preset_soon": "coming soon", - "display_keep_alive_help": "How long a display (and, on gamescope, its game) survives after the client disconnects. 0 = tear down immediately.", + "display_keep_alive_help": "Off tears the display down as soon as the client disconnects. Keep it alive (and, on gamescope, its game) so a quick reconnect resumes instantly instead of rebuilding.", "display_topology_help": "What happens to the host's physical monitors while streaming.", "display_conflict": "When another client connects", "display_conflict_help": "What happens if a second client connects while one is already streaming and asks for a different resolution.", diff --git a/web/src/sections/Displays/DisplayCard.tsx b/web/src/sections/Displays/DisplayCard.tsx index cf99afa..2ee0817 100644 --- a/web/src/sections/Displays/DisplayCard.tsx +++ b/web/src/sections/Displays/DisplayCard.tsx @@ -147,10 +147,11 @@ const DisplayForm: FC<{ }; const ka = customFields.keep_alive; - const secondsValue = ka.mode === "duration" ? ka.seconds : 300; + // The duration value, remembered across the Off/Keep toggle so switching back restores it. + const [keepSecs, setKeepSecs] = useState(ka.mode === "duration" ? ka.seconds : 300); return ( -
+
{/* One-click presets — a 2-up grid so each has room to breathe */}
@@ -208,10 +209,10 @@ const DisplayForm: FC<{ {/* Custom: every option by hand */} {isCustom && ( -
-
+
+
-
+
- - setDraft({ - ...draft, - keep_alive: { - mode: "duration", - seconds: Math.max(0, Number(e.target.value) || 0), - }, - }) + onClick={() => + setDraft({ ...draft, keep_alive: { mode: "duration", seconds: keepSecs } }) } - /> - - {m.display_keep_alive_seconds()} - + > + {m.display_keep_alive_keep()} + + {ka.mode === "duration" && ( +
+ { + const n = Math.max(0, Number(e.target.value) || 0); + setKeepSecs(n); + setDraft({ ...draft, keep_alive: { mode: "duration", seconds: n } }); + }} + /> + + {m.display_keep_alive_seconds()} + +
+ )}

{m.display_keep_alive_help()}

@@ -285,7 +296,7 @@ const DisplayForm: FC<{ } /> -
+
- +
+ +
)} @@ -337,7 +350,7 @@ const Choice: FC<{ disabled: boolean; onPick: (v: string) => void; }> = ({ label, help, value, options, labels, disabled, onPick }) => ( -
+
{options.map((o) => (