mirror of
https://github.com/stablyai/orca.git
synced 2026-11-14 01:47:24 +00:00
Restore IME Enter protection in workspace details by reusing the existing composition tracker. Reset Notes ownership at textarea detachment and preserve sizing behavior. Repair isolated native test-window delivery without changing the production foreground policy or original native input assertions.
Fixes #24097
Related contributor history: #10711, #11067, #13128, #13282.
Original implementation and macOS recordings: @setodeve, commit b30f095.
Verified on required stock Linux X11/Wayland checks and independent frozen-source review.
Co-authored-by: setodeve <keinick11@outlook.com>
36 lines
1.3 KiB
TypeScript
36 lines
1.3 KiB
TypeScript
import { expect, type ElectronApplication, type Page } from '@stablyai/playwright-test'
|
|
import type { BrowserWindow } from 'electron'
|
|
|
|
export async function presentNativeIbusWindow(
|
|
electronApp: ElectronApplication,
|
|
page: Page
|
|
): Promise<void> {
|
|
const ownedWindow = await electronApp.browserWindow(page)
|
|
try {
|
|
await ownedWindow.evaluate((window: BrowserWindow) => {
|
|
if (
|
|
process.platform !== 'linux' ||
|
|
process.env.GITHUB_ACTIONS !== 'true' ||
|
|
process.env.RUNNER_ENVIRONMENT !== 'github-hosted' ||
|
|
process.env.ORCA_E2E_NATIVE_IBUS_HANGUL !== '1' ||
|
|
process.env.ORCA_E2E_NATIVE_IBUS_XVFB !== '1' ||
|
|
!/^:\d+(?:\.\d+)?$/.test(process.env.DISPLAY ?? '') ||
|
|
process.env.ORCA_BACKGROUND_LAUNCH !== '1' ||
|
|
!window ||
|
|
window.isDestroyed() ||
|
|
window.isVisible()
|
|
) {
|
|
throw new Error('Native IBus presentation requires an owned hosted-CI Xvfb window')
|
|
}
|
|
// Aura needs logical visibility to accept native keyboard input.
|
|
window.showInactive()
|
|
})
|
|
await expect
|
|
.poll(() => ownedWindow.evaluate((window: BrowserWindow) => window.isVisible()))
|
|
.toBe(true)
|
|
await page.waitForFunction(() => document.visibilityState === 'visible')
|
|
} finally {
|
|
await ownedWindow.dispose()
|
|
}
|
|
}
|