Doubao-powered voice input for Linux, Wayland and Omarchy
fix(ci): stabilize onboarding and update Midscene to 1.15.3 (#81)
Leyangb697be35bf74
diff --git a/src/doubao_input/ui/control_window.py b/src/doubao_input/ui/control_window.pyindex a355746..806ce34 100644--- a/src/doubao_input/ui/control_window.py+++ b/src/doubao_input/ui/control_window.py@@ -586,12 +586,14 @@ class ControlWindow:self._actions.save_asr(key)except (ValueError, OSError) as error:self._asr_status.set_text(str(error))+ self.set_feedback(str(error))return Falseself._asr_key.set_text("")self._asr_key.set_placeholder_text(tr("Saved — leave blank to keep", "已保存,留空则保持不变"))- self._asr_status.set_text(tr(- "API key saved automatically.", "API Key 已自动保存。"))+ message = tr("API key saved automatically.", "API Key 已自动保存。")+ self._asr_status.set_text(message)+ self.set_feedback(message)return Truedef _flush_asr_key(self):@@ -629,9 +631,11 @@ class ControlWindow:self._asr_provider.set_sensitive(True)self._asr_test_button.set_sensitive(True)self._asr_test_button.set_label(tr("Test API key", "测试 API Key"))- self._asr_status.set_text(+ message = (tr("Test failed: ", "测试失败:") + error if error else(result or tr("API key accepted.", "API Key 可用。")))+ self._asr_status.set_text(message)+ self.set_feedback(message)return GLib.SOURCE_REMOVEdef _continue_from_trigger(self):diff --git a/tests/e2e/cases/onboarding-regressions.yaml b/tests/e2e/cases/onboarding-regressions.yamlindex 4f70e4a..955783b 100644--- a/tests/e2e/cases/onboarding-regressions.yaml+++ b/tests/e2e/cases/onboarding-regressions.yaml@@ -203,7 +203,7 @@ cases:prompt: The page title is Recognition and the empty API Key field is visible.options: { timeoutMs: 30000, checkIntervalMs: 1000 }- aiAssert: Open Doubao sign-in is hidden, and both Test API key and right-arrow Next are disabled while the API Key is empty.- - aiAct: Enter synthetic-ci-key in the API Key field.+ - aiAct: Enter synthetic-ci-key in the API Key field. Then scroll down within the Recognition page until the Test API key button and the credential status below it are fully visible.- aiWaitFor:prompt: The API Key field is empty with the Saved — leave blank to keep placeholder, API key saved automatically is visible, and Test API key is enabled.options: { timeoutMs: 30000, checkIntervalMs: 1000 }@@ -228,7 +228,7 @@ cases:- computer.inputText:target: The empty masked text entry to the right of API Key, with placeholder Enter speech API keyvalue: synthetic-deepgram-key- - aiAct: Test the saved Deepgram API key. Scroll within the page if the Test API key button is below the visible area.+ - aiAct: Click Test API key to test the saved Deepgram key, scrolling within the Recognition page if needed. After the test completes, scroll down within the page to bring the result message below the button into view.- aiWaitFor:prompt: The API key is accepted by the synthetic endpoint and the speech API is ready.options: { timeoutMs: 30000, checkIntervalMs: 1000 }@@ -237,11 +237,11 @@ cases:prompt: The Volcengine API credential instructions are visible, the empty API Key entry says Enter speech API key, and Test API key is disabled.options: { timeoutMs: 30000, checkIntervalMs: 1000 }- aiAssert: The page says no API key is saved for this service and does not show the previous accepted result.- - aiAct: Switch the Recognition service back to Deepgram Nova-3 (English). Then scroll within the Recognition page until the API Key entry and Test API key button are visible.+ - aiAct: Keep the Recognition page open and scroll up within its content to find the Recognition service dropdown. Select Deepgram Nova-3 (English) in that dropdown. Then scroll down within the same page until the API Key entry and Test API key button are fully visible.- aiWaitFor:prompt: The Deepgram API credential instructions are visible, the empty API Key entry says Saved — leave blank to keep, and Test API key is enabled.options: { timeoutMs: 30000, checkIntervalMs: 1000 }- - aiAct: Test the saved Deepgram API key.+ - aiAct: Click Test API key to test the saved Deepgram key again, scrolling within the Recognition page if needed. After the test completes, scroll down within the page to bring the result message below the button into view.- aiWaitFor:prompt: The API key is accepted by the synthetic endpoint and the speech API is ready.options: { timeoutMs: 30000, checkIntervalMs: 1000 }diff --git a/tests/e2e/package-lock.json b/tests/e2e/package-lock.jsonindex e9b4738..880d4cc 100644--- a/tests/e2e/package-lock.json+++ b/tests/e2e/package-lock.json@@ -8,8 +8,8 @@"name": "doubao-say-midscene-e2e","version": "1.0.0","devDependencies": {- "@midscene/computer": "1.13.3",- "@midscene/test": "1.13.3",+ "@midscene/computer": "1.15.3",+ "@midscene/test": "1.15.3","@types/node": "^22.0.0","puppeteer-core": "^25.11.0","typescript": "^5.8.3"@@ -2240,15 +2240,15 @@}},"node_modules/@midscene/computer": {- "version": "1.13.3",- "resolved": "https://registry.npmjs.org/@midscene/computer/-/computer-1.13.3.tgz",- "integrity": "sha512-KVsFemnQ2mDnEa3dYZVgY0Fznkfo1mE6A1IZfM3qDhpy3N5QqXMnVMasQlOuWrEpy4c3qUvIfhQQRB4SaYBqNQ==",+ "version": "1.15.3",+ "resolved": "https://registry.npmjs.org/@midscene/computer/-/computer-1.15.3.tgz",+ "integrity": "sha512-kojZ/20VaFQORhESQkWNfI2UEwekfqRNhxQSNsZSw5SoALiM40urTbmmOl81JMqPPQWa3iKNZTSfL8a6iTRgGQ==","dev": true,"license": "MIT","dependencies": {"@computer-use/libnut": "^4.2.0",- "@midscene/core": "1.13.3",- "@midscene/shared": "1.13.3",+ "@midscene/core": "1.15.3",+ "@midscene/shared": "1.15.3","clipboardy": "^4.0.0","screenshot-desktop": "^1.15.3"},@@ -2260,13 +2260,13 @@}},"node_modules/@midscene/core": {- "version": "1.13.3",- "resolved": "https://registry.npmjs.org/@midscene/core/-/core-1.13.3.tgz",- "integrity": "sha512-M6x6oaR10CmQmVzrAtfzJN30pspgd/YyvwO5DIgoIHvJs3fZwZVVHfzpWKJln8pwdfuL1x4l52H35KgeyIQ3/A==",+ "version": "1.15.3",+ "resolved": "https://registry.npmjs.org/@midscene/core/-/core-1.15.3.tgz",+ "integrity": "sha512-rXjwE6QNaVp+QorYqzmkyFC2n9mLfb6JFiUAzcyDHwnAfC3q71cP5mRP3bGXG/h5sAqmUNakncodcZ2j3ZB/aQ==","dev": true,"license": "MIT","dependencies": {- "@midscene/shared": "1.13.3",+ "@midscene/shared": "1.15.3","@ui-tars/action-parser": "1.2.3","dayjs": "^1.11.11","dotenv": "^16.4.5",@@ -2285,9 +2285,9 @@}},"node_modules/@midscene/shared": {- "version": "1.13.3",- "resolved": "https://registry.npmjs.org/@midscene/shared/-/shared-1.13.3.tgz",- "integrity": "sha512-qdvvbqkV/Ao10LRTGvnXMGvVYVXDVu3xk5ShzeoyU16YP5D8FXFw/xe0w9VAiPlvvNl04VD+pf6X+68dVpe9dg==",+ "version": "1.15.3",+ "resolved": "https://registry.npmjs.org/@midscene/shared/-/shared-1.15.3.tgz",+ "integrity": "sha512-Ml6GKP4hY10tbETpwwycSxPZnjf0zRVvyxjHYG6Uglv2FKy6+yT4cxOEdEzIweQz/4oU844VowwWbDHcSXVdhA==","dev": true,"license": "MIT","dependencies": {@@ -2301,15 +2301,16 @@}},"node_modules/@midscene/test": {- "version": "1.13.3",- "resolved": "https://registry.npmjs.org/@midscene/test/-/test-1.13.3.tgz",- "integrity": "sha512-q4Nrl3E4a+ryUidHkH3UKhTfz81NOJBjpRYYY4PmLEtt9ArrAbwTHTp4Fa4EpUhy7i57w6kTibHgi4+GlnWW4A==",+ "version": "1.15.3",+ "resolved": "https://registry.npmjs.org/@midscene/test/-/test-1.15.3.tgz",+ "integrity": "sha512-vJM64Vbcis3Zo6m8IWC5pVGGfnTF3ju6pX0uKjp3nOBrokQaXBDZqMskV76EG9Ram7HyWP8MjcoNXJMW4UCb/Q==","dev": true,"license": "MIT","dependencies": {"@inquirer/prompts": "^7.8.6",- "@midscene/core": "1.13.3",- "@midscene/shared": "1.13.3",+ "@midscene/core": "1.15.3",+ "@midscene/shared": "1.15.3",+ "chalk": "4.1.2","dotenv": "^16.4.5","execa": "9.3.0","glob": "11.0.0",@@ -2318,7 +2319,7 @@"lodash.merge": "4.6.2","tinyglobby": "0.2.15","tsx": "^4.19.2",- "yargs": "17.7.2",+ "yargs": "17.7.3","zod": "^3.25.1"},"bin": {@@ -2328,11 +2329,11 @@"node": "^20.19.0 || ^22.12.0 || >=24.0.0"},"peerDependencies": {- "@midscene/android": "1.13.3",- "@midscene/computer": "1.13.3",- "@midscene/harmony": "1.13.3",- "@midscene/ios": "1.13.3",- "@midscene/web": "1.13.3",+ "@midscene/android": "1.15.3",+ "@midscene/computer": "1.15.3",+ "@midscene/harmony": "1.15.3",+ "@midscene/ios": "1.15.3",+ "@midscene/web": "1.15.3","playwright": "^1.45.0","puppeteer": "24.6.0"},@@ -3507,9 +3508,9 @@}},"node_modules/fetch-socks/node_modules/undici": {- "version": "8.11.0",- "resolved": "https://registry.npmjs.org/undici/-/undici-8.11.0.tgz",- "integrity": "sha512-AdzuGcAkzhbha3GgCSoUBx2P0quwym6qdFNCQz/fDGZc8w9XJ741wHUbt2kTmfPz+ZIOMkySFkiY7RXmiDDC8w==",+ "version": "8.11.2",+ "resolved": "https://registry.npmjs.org/undici/-/undici-8.11.2.tgz",+ "integrity": "sha512-u4UB2/IrKdU6lFxumHmmo1a3fCQO5tzQllRorfoRS63txhrB7xTpSn1PftwC4qEHkOaqP95fCWW4lJzwErwzhQ==","dev": true,"license": "MIT","engines": {@@ -3952,9 +3953,9 @@"license": "ISC"},"node_modules/ip-address": {- "version": "10.7.2",- "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.2.tgz",- "integrity": "sha512-7H/2gFSIitxc0hG3nOI1glS8QLo/EHBFFLk8vEUjXY/xu0AdL8jZ9U1IzO2PUm0d2D/ofQcAifb0g6OBkt8U7w==",+ "version": "10.7.4",+ "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.4.tgz",+ "integrity": "sha512-DWBMKyeM25D70nrIiTkgQth59/G+naKOTep6huF9j+GmeK3DMD60Zvxg5d5qQnz+38AHgou6ean2LECX+lrKDg==","dev": true,"license": "MIT","engines": {@@ -4239,9 +4240,9 @@}},"node_modules/mdast-util-from-markdown": {- "version": "2.0.3",- "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.3.tgz",- "integrity": "sha512-W4mAWTvSlKvf8L6J+VN9yLSqQ9AOAAvHuoDAmPkz4dHf553m5gVj2ejadHJhoJmcmxEnOv6Pa8XJhpxE93kb8Q==",+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.1.0.tgz",+ "integrity": "sha512-KRLgmPaP2H1ul2bpoJkOS+9pAcDAAj9Nu1mqLnh8NLeJG5tlvj42TH80PIGBpROWlRXLk0lDrWNuZCFy/tsB4A==","dev": true,"license": "MIT","dependencies": {@@ -4279,9 +4280,9 @@}},"node_modules/mdast-util-to-markdown": {- "version": "2.1.2",- "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.2.tgz",- "integrity": "sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==",+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.2.0.tgz",+ "integrity": "sha512-2Jn/ADrHFFyyniBMi0bncTbJqU78K3/TEYvzvwrWWzD9MYPUa/Gm4r3nOeKFQg/PDM5BsbDYdc8ackW4NTY6NA==","dev": true,"license": "MIT","dependencies": {@@ -4290,8 +4291,10 @@"longest-streak": "^3.0.0","mdast-util-phrasing": "^4.0.0","mdast-util-to-string": "^4.0.0",+ "micromark-util-character": "^2.0.0","micromark-util-classify-character": "^2.0.0","micromark-util-decode-string": "^2.0.0",+ "micromark-util-html-tag-name": "^2.0.0","unist-util-visit": "^5.0.0","zwitch": "^2.0.0"},@@ -4322,9 +4325,9 @@"license": "MIT"},"node_modules/micromark": {- "version": "4.0.2",- "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz",- "integrity": "sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==",+ "version": "4.0.3",+ "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.3.tgz",+ "integrity": "sha512-oGYfQzHSG5dOMovQcJ3fyTmZlWAWpi0XA0sJwJs+i6OT88o1+Jtw/8z0CmdowSLxGhhFK89rQ/oXph/wN02PNw==","dev": true,"funding": [{@@ -4348,6 +4351,7 @@"micromark-util-chunked": "^2.0.0","micromark-util-combine-extensions": "^2.0.0","micromark-util-decode-numeric-character-reference": "^2.0.0",+ "micromark-util-edit-map": "^1.0.0","micromark-util-encode": "^2.0.0","micromark-util-normalize-identifier": "^2.0.0","micromark-util-resolve-all": "^2.0.0",@@ -4358,9 +4362,9 @@}},"node_modules/micromark-core-commonmark": {- "version": "2.0.3",- "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.3.tgz",- "integrity": "sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==",+ "version": "2.0.4",+ "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.4.tgz",+ "integrity": "sha512-wxEeE8v8XVvOrxn1TZj74qYhAtTQsSqufHVS3uNVyT1MupXxhyaHk8/9xDNPh9BmL77QNDgWTkZ3RsYHB2ry7w==","dev": true,"funding": [{@@ -4378,18 +4382,19 @@"devlop": "^1.0.0","micromark-factory-destination": "^2.0.0","micromark-factory-label": "^2.0.0",- "micromark-factory-space": "^2.0.0",+ "micromark-factory-space": "^2.1.0","micromark-factory-title": "^2.0.0","micromark-factory-whitespace": "^2.0.0","micromark-util-character": "^2.0.0","micromark-util-chunked": "^2.0.0","micromark-util-classify-character": "^2.0.0",+ "micromark-util-edit-map": "^1.0.0","micromark-util-html-tag-name": "^2.0.0","micromark-util-normalize-identifier": "^2.0.0","micromark-util-resolve-all": "^2.0.0","micromark-util-subtokenize": "^2.0.0","micromark-util-symbol": "^2.0.0",- "micromark-util-types": "^2.0.0"+ "micromark-util-types": "^2.0.3"}},"node_modules/micromark-factory-destination": {@@ -4438,9 +4443,9 @@}},"node_modules/micromark-factory-space": {- "version": "2.0.1",- "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz",- "integrity": "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==",+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.1.0.tgz",+ "integrity": "sha512-fS8hnLIjnjvdQIj39Geug8wWsR0HrYZ43KShKxNfwT7t2LOHo/LbWZEzEaSOjwtjdCsjoE6syHhonEzW0zv0+Q==","dev": true,"funding": [{@@ -4631,6 +4636,26 @@"micromark-util-symbol": "^2.0.0"}},+ "node_modules/micromark-util-edit-map": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/micromark-util-edit-map/-/micromark-util-edit-map-1.0.0.tgz",+ "integrity": "sha512-Pa2ljlsEL6sVwFaYeyrOLSYbQt73JvGbPOYFq+9AElXiSnfI5Q4465RRZ1sHv7lDjDOnGRDDaqPXqClqWK/q1Q==",+ "dev": true,+ "funding": [+ {+ "type": "GitHub Sponsors",+ "url": "https://github.com/sponsors/unifiedjs"+ },+ {+ "type": "OpenCollective",+ "url": "https://opencollective.com/unified"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "micromark-util-types": "^2.0.0"+ }+ },"node_modules/micromark-util-encode": {"version": "2.0.1","resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz",@@ -4768,9 +4793,9 @@"license": "MIT"},"node_modules/micromark-util-types": {- "version": "2.0.2",- "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.2.tgz",- "integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==",+ "version": "2.0.3",+ "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.3.tgz",+ "integrity": "sha512-oxB2Ik03hI0gv+VNn9tnh1t1YEe9MDPptViAEgfdf3YQHsn0pzGTgCdlSCJXcwhqm8phaEuM7zeEu3QQzVBrPg==","dev": true,"funding": [{@@ -5975,9 +6000,9 @@}},"node_modules/undici": {- "version": "6.28.1",- "resolved": "https://registry.npmjs.org/undici/-/undici-6.28.1.tgz",- "integrity": "sha512-zWpdTVD54H48CIybL0rWQ3ukpb9d23wM7eH5RtfdmeP70cWHNjtfo7P4vZX+5CoDcO53J4Pu5uXp7lNfjc6DRA==",+ "version": "6.29.0",+ "resolved": "https://registry.npmjs.org/undici/-/undici-6.29.0.tgz",+ "integrity": "sha512-R+RODBqp6i2pPflGdq+xIOUkl+RNfGgHwoinecKu/JCuf2uO06cOKoDbI2P7Dn6KcswdKwrczbU6IYJ6K8X+wg==","dev": true,"license": "MIT","engines": {@@ -6293,9 +6318,9 @@"license": "ISC"},"node_modules/yargs": {- "version": "17.7.2",- "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",- "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==",+ "version": "17.7.3",+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz",+ "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==","dev": true,"license": "MIT","dependencies": {diff --git a/tests/e2e/package.json b/tests/e2e/package.jsonindex 26bf9d6..3d302e0 100644--- a/tests/e2e/package.json+++ b/tests/e2e/package.json@@ -13,8 +13,8 @@"@img/sharp-linux-x64": "0.34.5"},"devDependencies": {- "@midscene/computer": "1.13.3",- "@midscene/test": "1.13.3",+ "@midscene/computer": "1.15.3",+ "@midscene/test": "1.15.3","@types/node": "^22.0.0","puppeteer-core": "^25.11.0","typescript": "^5.8.3"diff --git a/tests/unit/test_asr_key_persistence.py b/tests/unit/test_asr_key_persistence.pyindex 859fe6f..9181ed6 100644--- a/tests/unit/test_asr_key_persistence.py+++ b/tests/unit/test_asr_key_persistence.py@@ -153,6 +153,21 @@ class OnboardingKeyPersistenceTest(TestCase):self.assertEqual(self.provider, "deepgram")view._actions.save_asr.assert_not_called()+ def test_saved_key_replaces_stale_provider_feedback(self):+ view = self.view()+ self.assertTrue(view._save_asr_key_now())+ view.set_feedback.assert_called_with("API key saved automatically.")++ def test_key_test_result_replaces_stale_feedback(self):+ for result, error, expected in (+ ("accepted", "", "accepted"),+ (None, "synthetic rejection", "Test failed: synthetic rejection"),+ ):+ with self.subTest(error=error):+ view = self.view()+ view._asr_tested(result, error)+ view.set_feedback.assert_called_with(expected)+def test_empty_entry_reflects_saved_key_for_current_provider(self):view = self.view()self.draft = ""@@ -171,6 +186,7 @@ class OnboardingKeyPersistenceTest(TestCase):view.hide()self.assertEqual(self.provider, "volcengine")self.assertEqual(self.draft, "synthetic-volcengine")+ view.set_feedback.assert_called_with("synthetic write failure")view._window.set_visible.assert_not_called()def test_key_test_blocks_switch_and_restores_controls_on_completion(self):diff --git a/tests/unit/test_setup_actions.py b/tests/unit/test_setup_actions.pyindex 7a222f8..976253a 100644--- a/tests/unit/test_setup_actions.py+++ b/tests/unit/test_setup_actions.py@@ -158,6 +158,7 @@ class SetupActionsTest(unittest.TestCase):_asr_status=Mock(),_asr_test_button=Mock(),_actions=Mock(),+ set_feedback=Mock(),)control._asr_key.get_text.return_value = "test-key"control._save_asr_key_now = lambda: ControlWindow._save_asr_key_now(control)@@ -173,6 +174,7 @@ class SetupActionsTest(unittest.TestCase):self.assertFalse(control._asr_testing)self.assertEqual(control._asr_status.set_text.call_args.args[0], "API key accepted")+ control.set_feedback.assert_called_with("API key accepted")def test_endpoint_test_has_adjacent_loading_and_success_feedback(self):view = SimpleNamespace(