fix(ui): preserve draft and effort selections

This commit is contained in:
Iuliia Ivashko
2026-09-03 17:32:24 +03:00
parent 5995802fe3
commit 77d756aebb
12 changed files with 367 additions and 73 deletions
+10 -1
View File
@@ -362,6 +362,15 @@ const SessionRenameForm: React.FC<{
const { t } = useI18n();
const [value, setValue] = React.useState(initialTitle);
// Opens with the whole title selected, so the first keystroke replaces it.
// Stable ref callback: an inline one would re-run on every render and
// re-select the text mid-edit.
const focusRenameInput = React.useCallback((node: HTMLInputElement | null) => {
if (!node) return;
node.focus();
node.select();
}, []);
const commit = () => {
const next = value.trim();
if (!next || next === initialTitle.trim()) {
@@ -385,7 +394,7 @@ const SessionRenameForm: React.FC<{
}}
>
<input
autoFocus
ref={focusRenameInput}
value={value}
onChange={(event) => setValue(event.target.value)}
onKeyDown={(event) => {