The design language that makes your AI harness better at design.
JavaScript
Fix edit mode focus stealing (#172)
Abdul Wahabd6e392311cc6
diff --git a/.agents/skills/impeccable/scripts/live-browser.js b/.agents/skills/impeccable/scripts/live-browser.jsindex f1e525786..97e65dd3a 100644--- a/.agents/skills/impeccable/scripts/live-browser.js+++ b/.agents/skills/impeccable/scripts/live-browser.js@@ -6169,7 +6169,9 @@ void main() {}function shouldFocusSteerChat() {- return state !== 'CONFIGURING' && !steerLocked;+ return state !== 'CONFIGURING'+ && state !== 'EDITING'+ && !steerLocked;}function pageHasHostTextSelection() {diff --git a/.claude/skills/impeccable/scripts/live-browser.js b/.claude/skills/impeccable/scripts/live-browser.jsindex f1e525786..97e65dd3a 100644--- a/.claude/skills/impeccable/scripts/live-browser.js+++ b/.claude/skills/impeccable/scripts/live-browser.js@@ -6169,7 +6169,9 @@ void main() {}function shouldFocusSteerChat() {- return state !== 'CONFIGURING' && !steerLocked;+ return state !== 'CONFIGURING'+ && state !== 'EDITING'+ && !steerLocked;}function pageHasHostTextSelection() {diff --git a/.cursor/skills/impeccable/scripts/live-browser.js b/.cursor/skills/impeccable/scripts/live-browser.jsindex f1e525786..97e65dd3a 100644--- a/.cursor/skills/impeccable/scripts/live-browser.js+++ b/.cursor/skills/impeccable/scripts/live-browser.js@@ -6169,7 +6169,9 @@ void main() {}function shouldFocusSteerChat() {- return state !== 'CONFIGURING' && !steerLocked;+ return state !== 'CONFIGURING'+ && state !== 'EDITING'+ && !steerLocked;}function pageHasHostTextSelection() {diff --git a/.gemini/skills/impeccable/scripts/live-browser.js b/.gemini/skills/impeccable/scripts/live-browser.jsindex f1e525786..97e65dd3a 100644--- a/.gemini/skills/impeccable/scripts/live-browser.js+++ b/.gemini/skills/impeccable/scripts/live-browser.js@@ -6169,7 +6169,9 @@ void main() {}function shouldFocusSteerChat() {- return state !== 'CONFIGURING' && !steerLocked;+ return state !== 'CONFIGURING'+ && state !== 'EDITING'+ && !steerLocked;}function pageHasHostTextSelection() {diff --git a/.github/skills/impeccable/scripts/live-browser.js b/.github/skills/impeccable/scripts/live-browser.jsindex f1e525786..97e65dd3a 100644--- a/.github/skills/impeccable/scripts/live-browser.js+++ b/.github/skills/impeccable/scripts/live-browser.js@@ -6169,7 +6169,9 @@ void main() {}function shouldFocusSteerChat() {- return state !== 'CONFIGURING' && !steerLocked;+ return state !== 'CONFIGURING'+ && state !== 'EDITING'+ && !steerLocked;}function pageHasHostTextSelection() {diff --git a/.kiro/skills/impeccable/scripts/live-browser.js b/.kiro/skills/impeccable/scripts/live-browser.jsindex f1e525786..97e65dd3a 100644--- a/.kiro/skills/impeccable/scripts/live-browser.js+++ b/.kiro/skills/impeccable/scripts/live-browser.js@@ -6169,7 +6169,9 @@ void main() {}function shouldFocusSteerChat() {- return state !== 'CONFIGURING' && !steerLocked;+ return state !== 'CONFIGURING'+ && state !== 'EDITING'+ && !steerLocked;}function pageHasHostTextSelection() {diff --git a/.opencode/skills/impeccable/scripts/live-browser.js b/.opencode/skills/impeccable/scripts/live-browser.jsindex f1e525786..97e65dd3a 100644--- a/.opencode/skills/impeccable/scripts/live-browser.js+++ b/.opencode/skills/impeccable/scripts/live-browser.js@@ -6169,7 +6169,9 @@ void main() {}function shouldFocusSteerChat() {- return state !== 'CONFIGURING' && !steerLocked;+ return state !== 'CONFIGURING'+ && state !== 'EDITING'+ && !steerLocked;}function pageHasHostTextSelection() {diff --git a/.pi/skills/impeccable/scripts/live-browser.js b/.pi/skills/impeccable/scripts/live-browser.jsindex f1e525786..97e65dd3a 100644--- a/.pi/skills/impeccable/scripts/live-browser.js+++ b/.pi/skills/impeccable/scripts/live-browser.js@@ -6169,7 +6169,9 @@ void main() {}function shouldFocusSteerChat() {- return state !== 'CONFIGURING' && !steerLocked;+ return state !== 'CONFIGURING'+ && state !== 'EDITING'+ && !steerLocked;}function pageHasHostTextSelection() {diff --git a/.qoder/skills/impeccable/scripts/live-browser.js b/.qoder/skills/impeccable/scripts/live-browser.jsindex f1e525786..97e65dd3a 100644--- a/.qoder/skills/impeccable/scripts/live-browser.js+++ b/.qoder/skills/impeccable/scripts/live-browser.js@@ -6169,7 +6169,9 @@ void main() {}function shouldFocusSteerChat() {- return state !== 'CONFIGURING' && !steerLocked;+ return state !== 'CONFIGURING'+ && state !== 'EDITING'+ && !steerLocked;}function pageHasHostTextSelection() {diff --git a/.rovodev/skills/impeccable/scripts/live-browser.js b/.rovodev/skills/impeccable/scripts/live-browser.jsindex f1e525786..97e65dd3a 100644--- a/.rovodev/skills/impeccable/scripts/live-browser.js+++ b/.rovodev/skills/impeccable/scripts/live-browser.js@@ -6169,7 +6169,9 @@ void main() {}function shouldFocusSteerChat() {- return state !== 'CONFIGURING' && !steerLocked;+ return state !== 'CONFIGURING'+ && state !== 'EDITING'+ && !steerLocked;}function pageHasHostTextSelection() {diff --git a/.trae-cn/skills/impeccable/scripts/live-browser.js b/.trae-cn/skills/impeccable/scripts/live-browser.jsindex f1e525786..97e65dd3a 100644--- a/.trae-cn/skills/impeccable/scripts/live-browser.js+++ b/.trae-cn/skills/impeccable/scripts/live-browser.js@@ -6169,7 +6169,9 @@ void main() {}function shouldFocusSteerChat() {- return state !== 'CONFIGURING' && !steerLocked;+ return state !== 'CONFIGURING'+ && state !== 'EDITING'+ && !steerLocked;}function pageHasHostTextSelection() {diff --git a/.trae/skills/impeccable/scripts/live-browser.js b/.trae/skills/impeccable/scripts/live-browser.jsindex f1e525786..97e65dd3a 100644--- a/.trae/skills/impeccable/scripts/live-browser.js+++ b/.trae/skills/impeccable/scripts/live-browser.js@@ -6169,7 +6169,9 @@ void main() {}function shouldFocusSteerChat() {- return state !== 'CONFIGURING' && !steerLocked;+ return state !== 'CONFIGURING'+ && state !== 'EDITING'+ && !steerLocked;}function pageHasHostTextSelection() {diff --git a/plugin/skills/impeccable/scripts/live-browser.js b/plugin/skills/impeccable/scripts/live-browser.jsindex f1e525786..97e65dd3a 100644--- a/plugin/skills/impeccable/scripts/live-browser.js+++ b/plugin/skills/impeccable/scripts/live-browser.js@@ -6169,7 +6169,9 @@ void main() {}function shouldFocusSteerChat() {- return state !== 'CONFIGURING' && !steerLocked;+ return state !== 'CONFIGURING'+ && state !== 'EDITING'+ && !steerLocked;}function pageHasHostTextSelection() {diff --git a/skill/scripts/live-browser.js b/skill/scripts/live-browser.jsindex f1e525786..97e65dd3a 100644--- a/skill/scripts/live-browser.js+++ b/skill/scripts/live-browser.js@@ -6169,7 +6169,9 @@ void main() {}function shouldFocusSteerChat() {- return state !== 'CONFIGURING' && !steerLocked;+ return state !== 'CONFIGURING'+ && state !== 'EDITING'+ && !steerLocked;}function pageHasHostTextSelection() {diff --git a/tests/live-browser-regression.test.mjs b/tests/live-browser-regression.test.mjsindex 0ae70a09f..66de4e0fa 100644--- a/tests/live-browser-regression.test.mjs+++ b/tests/live-browser-regression.test.mjs@@ -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,