Repository navigation
fix(macos): retry live input before the first write #1410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
appergb
wants to merge
3
commits into
appergb/settings-memory-updater
Choose a base branch
from
fix/macos-live-input
base: appergb/settings-memory-updater
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import { expect, test } from '@playwright/test'; | ||
|
|
||
| for (const [os, ua, platform] of [ | ||
| ['macOS', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 14_0)', 'MacIntel'], | ||
| ['Windows', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', 'Win32'], | ||
| ] as const) { | ||
| test(`live transcript input has a dedicated advanced settings page on ${os}`, async ({ | ||
| page, | ||
| }) => { | ||
| await page.addInitScript( | ||
| ({ ua, platform }) => { | ||
| Object.defineProperty(navigator, 'userAgent', { value: ua }); | ||
| Object.defineProperty(navigator, 'platform', { value: platform }); | ||
| Object.defineProperty(navigator, 'userAgentData', { value: undefined }); | ||
| }, | ||
| { ua, platform }, | ||
| ); | ||
| await page.goto('/'); | ||
| await page.getByRole('button', { name: '设置', exact: true }).click(); | ||
| const dialog = page.getByRole('dialog', { name: '设置', exact: true }); | ||
| await dialog.getByRole('button', { name: '高级功能', exact: true }).click(); | ||
| await dialog.locator('[data-ol-advanced-entry="liveInput"]').click(); | ||
| const panel = dialog.locator('[data-ol-advanced-page="liveInput"]'); | ||
| await expect(panel).toBeVisible(); | ||
| await expect(panel.getByText('实时原文显示在输入框', { exact: true })).toBeVisible(); | ||
| }); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On macOS with live transcript input disabled (the default),
live_compositionis intentionallyNone, but this now captures a new AX target on every finish and always producesSome(live_result). Consequently, the later branch always returns before the ordinaryinsert_finalpath: unsupported AX editors receive only a clipboard fallback instead of normal insertion, while supported editors receive text at the current focus without restoring the captured insertion target. Streaming finalization also passes an empty string, which can now delete selected text rather than simply close the session. Only retry live capture whencontext.insertion.composition_inputis enabled; otherwise preserve the existing non-composition finalization path.Useful? React with 👍 / 👎.