Doubao-powered voice input for Linux, Wayland and Omarchy
fix: support Ubuntu GTK password entries
quanru831e8a1377b8
diff --git a/src/doubao_input/ui/polish_settings.py b/src/doubao_input/ui/polish_settings.pyindex 87400ed..1c14662 100644--- a/src/doubao_input/ui/polish_settings.py+++ b/src/doubao_input/ui/polish_settings.py@@ -36,7 +36,10 @@ class PolishSettings(Gtk.Box):self.base_url = Gtk.Entry(text=settings.polish_base_url, hexpand=True)self.model = Gtk.Entry(text=settings.polish_model, hexpand=True)- self.api_key = Gtk.Entry(visibility=False, invisible_char=ord("•"), hexpand=True)+ # Older PyGObject releases cannot convert invisible_char through the+ # constructor's property mapping even though the setter accepts it.+ self.api_key = Gtk.Entry(visibility=False, hexpand=True)+ self.api_key.set_invisible_char("•")self.api_key.set_placeholder_text(tr("Saved — leave blank to keep" if has_key else "Required when enabled","已保存,留空则保持不变" if has_key else "启用时必填"))self.details.append(self._row("Base URL", self.base_url))diff --git a/tests/midscene/e2e/onboarding.test.ts b/tests/midscene/e2e/onboarding.test.tsindex ab89288..0ebf917 100644--- a/tests/midscene/e2e/onboarding.test.ts+++ b/tests/midscene/e2e/onboarding.test.ts@@ -20,6 +20,33 @@ const stopProcessGroup = (child?: ChildProcess) => {}};+const waitForFixture = (child: ChildProcess) =>+ new Promise<void>((resolvePromise, rejectPromise) => {+ let diagnostics = '';+ const timeout = setTimeout(() => {+ rejectPromise(+ new Error(`GTK fixture did not become ready:\n${diagnostics}`),+ );+ }, 15_000);+ const capture = (chunk: Buffer) => {+ diagnostics += chunk.toString();+ if (diagnostics.includes('READY: synthetic Doubao Say GTK fixture')) {+ clearTimeout(timeout);+ resolvePromise();+ }+ };+ child.stdout?.on('data', capture);+ child.stderr?.on('data', capture);+ child.once('exit', (code, signal) => {+ clearTimeout(timeout);+ rejectPromise(+ new Error(+ `GTK fixture exited before ready (${code ?? signal}):\n${diagnostics}`,+ ),+ );+ });+ });+describe('Doubao Say onboarding', () => {let agent: ComputerAgent;let fluxbox: ChildProcess;@@ -27,9 +54,11 @@ describe('Doubao Say onboarding', () => {beforeAll(async () => {agent = await agentFromComputer({- aiActionContext:- 'You are testing the English Doubao Say GTK onboarding window. ' +- 'Interact only with the Doubao Say window and use visible labels.',+ aiContexts: {+ aiAct:+ 'You are testing the English Doubao Say GTK onboarding window. ' ++ 'Interact only with the Doubao Say window and use visible labels.',+ },xvfbResolution: '1280x960x24',});@@ -44,7 +73,7 @@ describe('Doubao Say onboarding', () => {fixture = spawn('/usr/bin/python3', ['tests/midscene/gtk_fixture.py'], {cwd: repositoryRoot,detached: true,- stdio: ['ignore', 'inherit', 'inherit'],+ stdio: ['ignore', 'pipe', 'pipe'],env: {...process.env,GTK_A11Y: 'none',@@ -52,7 +81,8 @@ describe('Doubao Say onboarding', () => {XDG_CONFIG_HOME: resolve(repositoryRoot, '.midscene-config'),},});- await sleep(2500);+ await waitForFixture(fixture);+ await sleep(1000);});afterAll(() => {