Fix edit mode focus stealing (#172)

This commit is contained in:
Abdul Wahab
2026-05-28 20:19:30 -07:00
committed by GitHub
parent 6ef995f8a4
commit d6e392311c
15 changed files with 50 additions and 14 deletions
@@ -6169,7 +6169,9 @@ void main() {
}
function shouldFocusSteerChat() {
return state !== 'CONFIGURING' && !steerLocked;
return state !== 'CONFIGURING'
&& state !== 'EDITING'
&& !steerLocked;
}
function pageHasHostTextSelection() {
@@ -6169,7 +6169,9 @@ void main() {
}
function shouldFocusSteerChat() {
return state !== 'CONFIGURING' && !steerLocked;
return state !== 'CONFIGURING'
&& state !== 'EDITING'
&& !steerLocked;
}
function pageHasHostTextSelection() {
@@ -6169,7 +6169,9 @@ void main() {
}
function shouldFocusSteerChat() {
return state !== 'CONFIGURING' && !steerLocked;
return state !== 'CONFIGURING'
&& state !== 'EDITING'
&& !steerLocked;
}
function pageHasHostTextSelection() {
@@ -6169,7 +6169,9 @@ void main() {
}
function shouldFocusSteerChat() {
return state !== 'CONFIGURING' && !steerLocked;
return state !== 'CONFIGURING'
&& state !== 'EDITING'
&& !steerLocked;
}
function pageHasHostTextSelection() {
@@ -6169,7 +6169,9 @@ void main() {
}
function shouldFocusSteerChat() {
return state !== 'CONFIGURING' && !steerLocked;
return state !== 'CONFIGURING'
&& state !== 'EDITING'
&& !steerLocked;
}
function pageHasHostTextSelection() {
@@ -6169,7 +6169,9 @@ void main() {
}
function shouldFocusSteerChat() {
return state !== 'CONFIGURING' && !steerLocked;
return state !== 'CONFIGURING'
&& state !== 'EDITING'
&& !steerLocked;
}
function pageHasHostTextSelection() {
@@ -6169,7 +6169,9 @@ void main() {
}
function shouldFocusSteerChat() {
return state !== 'CONFIGURING' && !steerLocked;
return state !== 'CONFIGURING'
&& state !== 'EDITING'
&& !steerLocked;
}
function pageHasHostTextSelection() {
@@ -6169,7 +6169,9 @@ void main() {
}
function shouldFocusSteerChat() {
return state !== 'CONFIGURING' && !steerLocked;
return state !== 'CONFIGURING'
&& state !== 'EDITING'
&& !steerLocked;
}
function pageHasHostTextSelection() {
@@ -6169,7 +6169,9 @@ void main() {
}
function shouldFocusSteerChat() {
return state !== 'CONFIGURING' && !steerLocked;
return state !== 'CONFIGURING'
&& state !== 'EDITING'
&& !steerLocked;
}
function pageHasHostTextSelection() {
@@ -6169,7 +6169,9 @@ void main() {
}
function shouldFocusSteerChat() {
return state !== 'CONFIGURING' && !steerLocked;
return state !== 'CONFIGURING'
&& state !== 'EDITING'
&& !steerLocked;
}
function pageHasHostTextSelection() {
@@ -6169,7 +6169,9 @@ void main() {
}
function shouldFocusSteerChat() {
return state !== 'CONFIGURING' && !steerLocked;
return state !== 'CONFIGURING'
&& state !== 'EDITING'
&& !steerLocked;
}
function pageHasHostTextSelection() {
@@ -6169,7 +6169,9 @@ void main() {
}
function shouldFocusSteerChat() {
return state !== 'CONFIGURING' && !steerLocked;
return state !== 'CONFIGURING'
&& state !== 'EDITING'
&& !steerLocked;
}
function pageHasHostTextSelection() {
@@ -6169,7 +6169,9 @@ void main() {
}
function shouldFocusSteerChat() {
return state !== 'CONFIGURING' && !steerLocked;
return state !== 'CONFIGURING'
&& state !== 'EDITING'
&& !steerLocked;
}
function pageHasHostTextSelection() {
+3 -1
View File
@@ -6169,7 +6169,9 @@ void main() {
}
function shouldFocusSteerChat() {
return state !== 'CONFIGURING' && !steerLocked;
return state !== 'CONFIGURING'
&& state !== 'EDITING'
&& !steerLocked;
}
function pageHasHostTextSelection() {
+8
View File
@@ -90,6 +90,14 @@ describe('live-browser.js regression guards', () => {
);
});
it('does not autofocus the steering chat while inline editing', () => {
assert.match(
SOURCE,
/function shouldFocusSteerChat\(\) \{\s*return state !== 'CONFIGURING'\s*&& state !== 'EDITING'\s*&& !steerLocked;\s*\}/,
'edit-mode contenteditable focus must not be stolen by the global steering chat focus recovery',
);
});
it('does not shadow the global live state when storing Apply state', () => {
assert.doesNotMatch(
SOURCE,