Repository navigation
Conversation
de47aec to
1ecf549
Compare
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe change removes custom IME composition, native-text forwarding, candidate-key, and input-context refresh paths. Keyboard routing now filters IME-owned events through shared detection and retains macOS initial-jamo bypass handling. Terminal lifecycle code enforces active PTY transport ownership. New tests cover stock composition, Enter ordering, preview keyboard behavior, transport replacement, and native macOS input. CI separates native IBus tests from deterministic tests and updates reliability-gate coverage. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/renderer/src/components/terminal-pane/regular-terminal-focus-ownership.ts (1)
75-89: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winRemove the now-dead
isMacparameter, or update its stale documentation.
args.isMacis declared onresyncTerminalFocusForWindowFocusand documented as overriding "the macOS check," but the function body no longer readsargs.isMacanywhere. The macOS-specific IME refresh flow that used to consume this flag is gone. A caller or test that still passesisMacto change behavior gets no effect, and the JSDoc now describes behavior that does not exist.Remove the parameter and its JSDoc if no caller depends on it, or update the comment if it is intentionally kept for a near-term reintroduction.
Run the following script to check whether any caller or test still passes
isMac:#!/bin/bash # Description: Check for remaining `isMac` usage tied to resyncTerminalFocusForWindowFocus. rg -n -C4 'resyncTerminalFocusForWindowFocus' -g '*.ts' -g '*.tsx' src/renderer rg -n 'isMac' src/renderer/src/components/terminal-pane/regular-terminal-focus-ownership.test.ts 2>/dev/null♻️ Proposed fix (if no caller depends on it)
releasedHelper?: HTMLElement | null - /** Override the macOS check (tests). Defaults to the navigator user agent. */ - isMac?: boolean /** Override the refocus scheduler (tests). Defaults to requestAnimationFrame. */ scheduleRefocus?: RefocusScheduler
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1bf871b9-535c-4bf9-9610-33e4118a6494
📥 Commits
Reviewing files that changed from the base of the PR and between e08eba6 and de47aecdfa1a14f136a5b3eae565c9b20aea2195.
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (60)
.github/workflows/pr.yml.github/workflows/terminal-ime-e2e.ymlconfig/patches/@[email protected]config/reliability-gates.jsoncconfig/scripts/pr-e2e-gate-contract.test.mjsconfig/scripts/terminal-ime-e2e-workflow.test.mjssrc/renderer/src/components/dashboard-popout/AgentTerminalPreview.test.tsxsrc/renderer/src/components/dashboard-popout/AgentTerminalPreview.tsxsrc/renderer/src/components/dashboard-popout/preview-terminal-compatibility.tssrc/renderer/src/components/dashboard-popout/preview-terminal-ime-bridge.tssrc/renderer/src/components/dashboard-popout/preview-terminal-key-handler.test.tssrc/renderer/src/components/dashboard-popout/preview-terminal-key-handler.tssrc/renderer/src/components/floating-terminal/FloatingTerminalPanel.test.tsxsrc/renderer/src/components/floating-terminal/FloatingTerminalPanel.tsxsrc/renderer/src/components/terminal-pane/TerminalPane.tsxsrc/renderer/src/components/terminal-pane/keyboard-handlers-ime-enter-keyup.test.tsxsrc/renderer/src/components/terminal-pane/keyboard-handlers-ime.test.tsxsrc/renderer/src/components/terminal-pane/keyboard-handlers.test.tssrc/renderer/src/components/terminal-pane/keyboard-handlers.tssrc/renderer/src/components/terminal-pane/pty-connection.test.tssrc/renderer/src/components/terminal-pane/pty-connection.tssrc/renderer/src/components/terminal-pane/regular-terminal-focus-ownership.test.tssrc/renderer/src/components/terminal-pane/regular-terminal-focus-ownership.tssrc/renderer/src/components/terminal-pane/terminal-ime-candidate-key-release-guard.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-candidate-key-release-guard.tssrc/renderer/src/components/terminal-pane/terminal-ime-composition-route.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-composition-route.tssrc/renderer/src/components/terminal-pane/terminal-ime-composition-tracker.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-composition-tracker.tssrc/renderer/src/components/terminal-pane/terminal-ime-composition-transaction-ownership.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-deferred-newline.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-deferred-newline.tssrc/renderer/src/components/terminal-pane/terminal-ime-hangul-syllable-flush.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-input-context-refresh.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-input-context-refresh.tssrc/renderer/src/components/terminal-pane/terminal-ime-input-source.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-input-source.tssrc/renderer/src/components/terminal-pane/terminal-ime-linux-candidate-state.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-linux-candidate-state.tssrc/renderer/src/components/terminal-pane/terminal-ime-native-text-candidates.tssrc/renderer/src/components/terminal-pane/terminal-ime-native-text-forwarder.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-native-text-forwarder.tssrc/renderer/src/components/terminal-pane/terminal-ime-won-composition-order.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-xterm-adversarial.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-xterm-composition-cancel.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-xterm-composition-deduplication.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-xterm-transaction-events.test.tssrc/renderer/src/components/terminal-pane/terminal-stock-composition.test.tssrc/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.tssrc/renderer/src/components/terminal-pane/xterm-bypass-policy-non-mac.test.tssrc/renderer/src/components/terminal-pane/xterm-bypass-policy.test.tssrc/renderer/src/components/terminal-pane/xterm-bypass-policy.tssrc/renderer/src/lib/focus-terminal-tab-surface.test.tssrc/renderer/src/lib/focus-terminal-tab-surface.tssrc/renderer/src/lib/ime-composition-keyboard-event.test.tssrc/renderer/src/lib/ime-composition-keyboard-event.tssrc/renderer/src/lib/pane-manager/pane-lifecycle.tssrc/renderer/src/lib/pane-manager/terminal-ime-candidate-anchor.tstests/e2e/terminal-ibus-hangul-native.spec.tstests/e2e/terminal-ime-observed-event-sequences.ts
💤 Files with no reviewable changes (35)
- src/renderer/src/components/dashboard-popout/preview-terminal-ime-bridge.ts
- src/renderer/src/components/terminal-pane/terminal-ime-deferred-newline.test.ts
- src/renderer/src/components/terminal-pane/terminal-ime-xterm-adversarial.test.ts
- src/renderer/src/components/terminal-pane/terminal-ime-composition-route.test.ts
- src/renderer/src/components/terminal-pane/terminal-ime-input-source.test.ts
- src/renderer/src/components/terminal-pane/terminal-ime-composition-tracker.ts
- src/renderer/src/components/terminal-pane/regular-terminal-focus-ownership.test.ts
- src/renderer/src/components/terminal-pane/terminal-ime-composition-route.ts
- src/renderer/src/lib/pane-manager/pane-lifecycle.ts
- src/renderer/src/components/terminal-pane/terminal-ime-candidate-key-release-guard.test.ts
- src/renderer/src/components/terminal-pane/terminal-ime-composition-transaction-ownership.test.ts
- src/renderer/src/lib/pane-manager/terminal-ime-candidate-anchor.ts
- src/renderer/src/components/terminal-pane/terminal-ime-linux-candidate-state.ts
- src/renderer/src/components/terminal-pane/terminal-ime-xterm-transaction-events.test.ts
- src/renderer/src/components/terminal-pane/terminal-ime-native-text-forwarder.test.ts
- src/renderer/src/components/terminal-pane/terminal-ime-input-context-refresh.test.ts
- src/renderer/src/components/dashboard-popout/AgentTerminalPreview.test.tsx
- src/renderer/src/components/terminal-pane/terminal-ime-candidate-key-release-guard.ts
- src/renderer/src/components/terminal-pane/terminal-ime-linux-candidate-state.test.ts
- src/renderer/src/components/terminal-pane/terminal-ime-native-text-candidates.ts
- src/renderer/src/components/terminal-pane/terminal-ime-input-source.ts
- src/renderer/src/components/terminal-pane/terminal-ime-hangul-syllable-flush.test.ts
- src/renderer/src/components/terminal-pane/terminal-ime-native-text-forwarder.ts
- src/renderer/src/components/terminal-pane/terminal-ime-composition-tracker.test.ts
- src/renderer/src/components/terminal-pane/TerminalPane.tsx
- src/renderer/src/components/terminal-pane/keyboard-handlers-ime.test.tsx
- src/renderer/src/components/terminal-pane/terminal-ime-deferred-newline.ts
- src/renderer/src/components/terminal-pane/terminal-ime-xterm-composition-deduplication.test.ts
- src/renderer/src/components/dashboard-popout/AgentTerminalPreview.tsx
- src/renderer/src/lib/focus-terminal-tab-surface.ts
- src/renderer/src/components/terminal-pane/terminal-ime-input-context-refresh.ts
- src/renderer/src/components/terminal-pane/terminal-ime-won-composition-order.test.ts
- src/renderer/src/components/terminal-pane/keyboard-handlers-ime-enter-keyup.test.tsx
- src/renderer/src/lib/focus-terminal-tab-surface.test.ts
- src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts
| "keyboard bypass", | ||
| "JIS yen" | ||
| ], | ||
| "surfaces": ["IME", "paste", "keyboard bypass", "JIS yen"], | ||
| "platforms": ["macos", "linux", "windows"], |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Reconcile stale surfaces and missing assertionRefs in this gate.
surfaces at Line 5677 lists "paste" and "JIS yen", but neither the invariant, the oracle, nor any assertionRefs entry addresses paste handling or a JIS Yen key case. Remove these two surfaces, or add corresponding oracle coverage and assertionRefs.
testFiles at Lines 5693-5699 lists 5 files, but assertionRefs at Lines 5700-5722 documents only 3 of them. keyboard-handlers.test.ts and ime-composition-keyboard-event.test.ts have no assertionRefs entries, unlike every other gate in this file, which pairs each testFiles entry with a matching assertionRefs entry. Add the missing entries so this gate's evidence trail stays traceable.
Also applies to: 5693-5722
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/e2e/terminal-ibus-hangul-native.spec.ts (1)
92-93: 🚀 Performance & Scalability | 🔵 Trivial | 🏗️ Heavy liftReduce per-character process churn if the native suite is slow.
typeSentenceSequencenow invokesxdotool typeandxdotool sleepfor every character. The 38-character sentence creates about 380 synchronous child-process launches at the default of five repetitions and about 2,280 at the maximum of 30. This can increase test duration and failure points. If character-level segmentation is required for IBus, preserve the event boundaries but use a lower-process delay strategy. Verify that the replacement preserves separate key events and the required composition delay.Based on the supplied line-range change details and static-analysis context, the previous implementation used one delayed
xdotool typecall and this path usesexecFileSync.Also applies to: 95-97
Source: Linters/SAST tools
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 48acd5a6-487f-4bc1-b9fc-bbb1bbf85cb6
📥 Commits
Reviewing files that changed from the base of the PR and between de47aecdfa1a14f136a5b3eae565c9b20aea2195 and 1ecf549.
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (60)
.github/workflows/pr.yml.github/workflows/terminal-ime-e2e.ymlconfig/patches/@[email protected]config/reliability-gates.jsoncconfig/scripts/pr-e2e-gate-contract.test.mjsconfig/scripts/terminal-ime-e2e-workflow.test.mjssrc/renderer/src/components/dashboard-popout/AgentTerminalPreview.test.tsxsrc/renderer/src/components/dashboard-popout/AgentTerminalPreview.tsxsrc/renderer/src/components/dashboard-popout/preview-terminal-compatibility.tssrc/renderer/src/components/dashboard-popout/preview-terminal-ime-bridge.tssrc/renderer/src/components/dashboard-popout/preview-terminal-key-handler.test.tssrc/renderer/src/components/dashboard-popout/preview-terminal-key-handler.tssrc/renderer/src/components/floating-terminal/FloatingTerminalPanel.test.tsxsrc/renderer/src/components/floating-terminal/FloatingTerminalPanel.tsxsrc/renderer/src/components/terminal-pane/TerminalPane.tsxsrc/renderer/src/components/terminal-pane/keyboard-handlers-ime-enter-keyup.test.tsxsrc/renderer/src/components/terminal-pane/keyboard-handlers-ime.test.tsxsrc/renderer/src/components/terminal-pane/keyboard-handlers.test.tssrc/renderer/src/components/terminal-pane/keyboard-handlers.tssrc/renderer/src/components/terminal-pane/pty-connection.test.tssrc/renderer/src/components/terminal-pane/pty-connection.tssrc/renderer/src/components/terminal-pane/regular-terminal-focus-ownership.test.tssrc/renderer/src/components/terminal-pane/regular-terminal-focus-ownership.tssrc/renderer/src/components/terminal-pane/terminal-ime-candidate-key-release-guard.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-candidate-key-release-guard.tssrc/renderer/src/components/terminal-pane/terminal-ime-composition-route.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-composition-route.tssrc/renderer/src/components/terminal-pane/terminal-ime-composition-tracker.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-composition-tracker.tssrc/renderer/src/components/terminal-pane/terminal-ime-composition-transaction-ownership.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-deferred-newline.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-deferred-newline.tssrc/renderer/src/components/terminal-pane/terminal-ime-hangul-syllable-flush.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-input-context-refresh.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-input-context-refresh.tssrc/renderer/src/components/terminal-pane/terminal-ime-input-source.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-input-source.tssrc/renderer/src/components/terminal-pane/terminal-ime-linux-candidate-state.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-linux-candidate-state.tssrc/renderer/src/components/terminal-pane/terminal-ime-native-text-candidates.tssrc/renderer/src/components/terminal-pane/terminal-ime-native-text-forwarder.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-native-text-forwarder.tssrc/renderer/src/components/terminal-pane/terminal-ime-won-composition-order.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-xterm-adversarial.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-xterm-composition-cancel.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-xterm-composition-deduplication.test.tssrc/renderer/src/components/terminal-pane/terminal-ime-xterm-transaction-events.test.tssrc/renderer/src/components/terminal-pane/terminal-stock-composition.test.tssrc/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.tssrc/renderer/src/components/terminal-pane/xterm-bypass-policy-non-mac.test.tssrc/renderer/src/components/terminal-pane/xterm-bypass-policy.test.tssrc/renderer/src/components/terminal-pane/xterm-bypass-policy.tssrc/renderer/src/lib/focus-terminal-tab-surface.test.tssrc/renderer/src/lib/focus-terminal-tab-surface.tssrc/renderer/src/lib/ime-composition-keyboard-event.test.tssrc/renderer/src/lib/ime-composition-keyboard-event.tssrc/renderer/src/lib/pane-manager/pane-lifecycle.tssrc/renderer/src/lib/pane-manager/terminal-ime-candidate-anchor.tstests/e2e/terminal-ibus-hangul-native.spec.tstests/e2e/terminal-ime-observed-event-sequences.ts
💤 Files with no reviewable changes (35)
- src/renderer/src/lib/focus-terminal-tab-surface.test.ts
- src/renderer/src/components/terminal-pane/terminal-ime-candidate-key-release-guard.test.ts
- src/renderer/src/components/terminal-pane/terminal-ime-composition-tracker.test.ts
- src/renderer/src/components/terminal-pane/regular-terminal-focus-ownership.test.ts
- src/renderer/src/components/terminal-pane/terminal-ime-xterm-adversarial.test.ts
- src/renderer/src/components/dashboard-popout/preview-terminal-ime-bridge.ts
- src/renderer/src/components/terminal-pane/terminal-ime-hangul-syllable-flush.test.ts
- src/renderer/src/components/terminal-pane/terminal-ime-won-composition-order.test.ts
- src/renderer/src/components/terminal-pane/keyboard-handlers-ime.test.tsx
- src/renderer/src/components/terminal-pane/terminal-ime-input-source.test.ts
- src/renderer/src/components/terminal-pane/terminal-ime-xterm-composition-deduplication.test.ts
- src/renderer/src/components/terminal-pane/terminal-ime-linux-candidate-state.test.ts
- src/renderer/src/components/terminal-pane/terminal-ime-candidate-key-release-guard.ts
- src/renderer/src/components/terminal-pane/TerminalPane.tsx
- src/renderer/src/components/terminal-pane/terminal-ime-input-source.ts
- src/renderer/src/components/dashboard-popout/AgentTerminalPreview.test.tsx
- src/renderer/src/components/terminal-pane/terminal-ime-input-context-refresh.ts
- src/renderer/src/components/terminal-pane/terminal-ime-linux-candidate-state.ts
- src/renderer/src/components/terminal-pane/terminal-ime-input-context-refresh.test.ts
- src/renderer/src/components/terminal-pane/terminal-ime-deferred-newline.ts
- src/renderer/src/components/terminal-pane/terminal-ime-deferred-newline.test.ts
- src/renderer/src/components/terminal-pane/terminal-ime-xterm-transaction-events.test.ts
- src/renderer/src/components/terminal-pane/keyboard-handlers-ime-enter-keyup.test.tsx
- src/renderer/src/components/terminal-pane/terminal-ime-native-text-candidates.ts
- src/renderer/src/lib/pane-manager/terminal-ime-candidate-anchor.ts
- src/renderer/src/components/terminal-pane/terminal-ime-composition-tracker.ts
- src/renderer/src/components/terminal-pane/terminal-ime-native-text-forwarder.ts
- src/renderer/src/components/dashboard-popout/AgentTerminalPreview.tsx
- src/renderer/src/lib/focus-terminal-tab-surface.ts
- src/renderer/src/components/terminal-pane/terminal-ime-composition-transaction-ownership.test.ts
- src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts
- src/renderer/src/lib/pane-manager/pane-lifecycle.ts
- src/renderer/src/components/terminal-pane/terminal-ime-composition-route.ts
- src/renderer/src/components/terminal-pane/terminal-ime-native-text-forwarder.test.ts
- src/renderer/src/components/terminal-pane/terminal-ime-composition-route.test.ts
🚧 Files skipped from review as they are similar to previous changes (22)
- src/renderer/src/components/terminal-pane/pty-connection.test.ts
- src/renderer/src/components/terminal-pane/keyboard-handlers.test.ts
- src/renderer/src/lib/ime-composition-keyboard-event.test.ts
- src/renderer/src/components/dashboard-popout/preview-terminal-key-handler.test.ts
- src/renderer/src/components/terminal-pane/terminal-ime-xterm-composition-cancel.test.ts
- src/renderer/src/lib/ime-composition-keyboard-event.ts
- src/renderer/src/components/dashboard-popout/preview-terminal-compatibility.ts
- src/renderer/src/components/floating-terminal/FloatingTerminalPanel.test.tsx
- config/scripts/pr-e2e-gate-contract.test.mjs
- src/renderer/src/components/terminal-pane/xterm-bypass-policy.test.ts
- src/renderer/src/components/terminal-pane/xterm-bypass-policy-non-mac.test.ts
- .github/workflows/pr.yml
- src/renderer/src/components/dashboard-popout/preview-terminal-key-handler.ts
- tests/e2e/terminal-ime-observed-event-sequences.ts
- src/renderer/src/components/terminal-pane/regular-terminal-focus-ownership.ts
- src/renderer/src/components/terminal-pane/pty-connection.ts
- config/scripts/terminal-ime-e2e-workflow.test.mjs
- src/renderer/src/components/floating-terminal/FloatingTerminalPanel.tsx
- .github/workflows/terminal-ime-e2e.yml
- config/reliability-gates.jsonc
- src/renderer/src/components/terminal-pane/keyboard-handlers.ts
- src/renderer/src/components/terminal-pane/xterm-bypass-policy.ts
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a65ae7be-7dc8-45ad-af39-9584fa9bb067
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (5)
config/patches/@[email protected]src/renderer/src/components/terminal-pane/keyboard-handlers.test.tssrc/renderer/src/components/terminal-pane/keyboard-handlers.tssrc/renderer/src/components/terminal-pane/terminal-stock-composition.test.tstests/e2e/terminal-macos-2set-korean-native.spec.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/renderer/src/components/terminal-pane/keyboard-handlers.test.ts
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4ce82d37-ec8a-4719-b4f0-3cdd47c8d7a2
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (2)
config/patches/@[email protected]tests/e2e/terminal-macos-pinyin-native.spec.ts
| function selectInputSource(inputSourceId: string): void { | ||
| execFileSync('swift', ['.tmp/select-input-source.swift', inputSourceId]) | ||
| } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find the Swift input-source helper and any code that generates it.
fd -H -t f 'select-input-source' .
rg -n --hidden -g '!node_modules' 'select-input-source'
rg -n --hidden -g '!node_modules' 'ORCA_E2E_NATIVE_MACOS_PINYIN'Repository: stablyai/orca
Length of output: 151
🏁 Script executed:
#!/bin/bash
set -u
echo "Tracked files matching select-input-source:"
git ls-files -- '*select-input-source*'
echo
echo "Tracked files under tests/e2e matching terminal:"
git ls-files | grep -E '(^|/)terminal[^/]*|tests/e2e/terminal' || true
echo
echo "Repository file list for .tmp (limited):"
git ls-files -- | grep '^\./?\.tmp/' || true
git ls-files -- | grep '^\./?\.tmp' || true
echo
echo "Search text patterns with status-safe rg:"
rg -n --hidden -g '!node_modules' 'select-input-source|ORCA_E2E_NATIVE_MACOS_PINYIN|execFileSync\(\x27swift\x27|swift.*select-input-source' . || true
echo
echo "Candidate e2e files:"
git ls-files tests/e2e | sort | sed -n '1,120p'Repository: stablyai/orca
Length of output: 50369
Ensure .tmp/select-input-source.swift is available before selectInputSource runs.
selectInputSource resolves ./\.tmp/select-input-source.swift relative to the current working directory. If this generated helper is missing, the E2E gate fails with an opaque swift error instead of explaining the missing input-source script. Add script generation/availability handling for ORCA_E2E_NATIVE_MACOS_PINYIN=1, or resolve the path from a known repository baseline.
🧰 Tools
🪛 ast-grep (0.45.0)
[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFileSync } from 'node:child_process'
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(detect-child-process-typescript)
| } finally { | ||
| await attachTerminalImeBoundaryEvidence(orcaPage, testInfo, 'native-macos-pinyin').catch( | ||
| () => undefined | ||
| ) | ||
| await disposeTerminalImeBoundaryProbe(orcaPage).catch(() => undefined) | ||
| if (!completed) { | ||
| await sendToTerminal(orcaPage, ptyId, '\x03').catch(() => undefined) | ||
| } | ||
| removeTerminalImeByteReader(reader) | ||
| selectInputSource(ABC_ID) | ||
| } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Guard the input-source restore in finally.
selectInputSource(ABC_ID) at Line 135 is synchronous and unguarded. If swift exits non-zero, execFileSync throws inside finally and replaces the original test failure. The reported error then hides the real assertion failure.
🛡️ Proposed fix
removeTerminalImeByteReader(reader)
- selectInputSource(ABC_ID)
+ try {
+ selectInputSource(ABC_ID)
+ } catch {
+ // Keep the original failure visible if the input-source reset fails.
+ }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| } finally { | |
| await attachTerminalImeBoundaryEvidence(orcaPage, testInfo, 'native-macos-pinyin').catch( | |
| () => undefined | |
| ) | |
| await disposeTerminalImeBoundaryProbe(orcaPage).catch(() => undefined) | |
| if (!completed) { | |
| await sendToTerminal(orcaPage, ptyId, '\x03').catch(() => undefined) | |
| } | |
| removeTerminalImeByteReader(reader) | |
| selectInputSource(ABC_ID) | |
| } | |
| } finally { | |
| await attachTerminalImeBoundaryEvidence(orcaPage, testInfo, 'native-macos-pinyin').catch( | |
| () => undefined | |
| ) | |
| await disposeTerminalImeBoundaryProbe(orcaPage).catch(() => undefined) | |
| if (!completed) { | |
| await sendToTerminal(orcaPage, ptyId, '\x03').catch(() => undefined) | |
| } | |
| removeTerminalImeByteReader(reader) | |
| try { | |
| selectInputSource(ABC_ID) | |
| } catch { | |
| // Keep the original failure visible if the input-source reset fails. | |
| } | |
| } |
🧰 Tools
🪛 ast-grep (0.45.0)
[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFileSync } from 'node:child_process'
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(detect-child-process-typescript)
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1da88e93-f182-4817-b1d6-4cfd6645dcdc
📒 Files selected for processing (1)
tests/e2e/terminal-macos-vietnamese-native.spec.ts
| function selectInputSource(inputSourceId: string): void { | ||
| execFileSync('swift', ['.tmp/select-input-source.swift', inputSourceId]) | ||
| } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Locate the input-source helper script and any step that generates it.
fd -H -t f 'select-input-source' || echo 'no select-input-source file found'
rg -n --hidden -g '!node_modules' 'select-input-source'
rg -n --hidden -g '!node_modules' 'ORCA_E2E_NATIVE_MACOS_VIETNAMESE'Repository: stablyai/orca
Length of output: 151
🏁 Script executed:
#!/bin/bash
set -u
echo "Repository top-level files/directories relevant to tmp/scripts:"
git ls-files | sed -n '1,200p' | rg '(^|/)(\.tmp|tmp|scripts|test|e2e|setup|package\.json|Makefile|justfile|.*\.sh|.*\.swift|.*\.ts)$' || true
echo
echo "Find all script files:"
git ls-files | rg '\.(swift|sh|ts|tsx|js|jsx|json|toml|yaml|yml|md)$' | sed -n '1,240p' || true
echo
echo "Search select-input-source with all tracked files (hidden disabled by default in git ls-files):"
python3 - <<'PY'
import subprocess, os
files = subprocess.check_output(['git','ls-files'], text=True).splitlines()
try:
for f in files:
if 'select-input-source' in f:
print(f)
except Exception as e:
print(f"no match in tracked files: {e}")
PY
echo
echo "Search ORCA_E2E_NATIVE_MACOS_VIETNAMESE in tracked files:"
python3 - <<'PY'
import subprocess
files = subprocess.check_output(['git','ls-files'], text=True).splitlines()
for f in files:
try:
data = subprocess.check_output(['git','show',f], text=True, stderr=subprocess.DEVNULL)
except Exception:
continue
if 'ORCA_E2E_NATIVE_MACOS_VIETNAMESE' in data:
print(f)
PY
echo
echo "Inspect target file outline/size if present:"
if [ -f tests/e2e/terminal-macos-vietnamese-native.spec.ts ]; then
wc -l tests/e2e/terminal-macos-vietnamese-native.spec.ts
sed -n '1,140p' tests/e2e/terminal-macos-vietnamese-native.spec.ts
else
echo "target file not tracked"
fiRepository: stablyai/orca
Length of output: 15135
Add selectInputSource and its setup before running this test.
selectInputSource() calls .tmp/select-input-source.swift, but this repo contains no select-input-source.swift generator/setup step. Add the Swift helper or create it before the test runs, and document the ORCA_E2E_NATIVE_MACOS_VIETNAMESE requirements with an explicit file existence check.
🧰 Tools
🪛 ast-grep (0.45.0)
[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFileSync } from 'node:child_process'
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(detect-child-process-typescript)
|
Native macOS Korean/Codex mutation evidence is now in 90a3ef6.
This adds test evidence only—no production class, tracker, buffer, or Orca-specific composition protocol. The unrelated xterm |
|
IME evidence update at d6b711c:
Conclusion: the OSS references support the slim ownership boundary, not stock-xterm correctness. Orca keeps composition delivery in the 40-added-line xterm seam and does not add an app-specific IME class/protocol. |
76c30a8 to
f4c84f1
Compare
Summary
CompositionHelperseam because stock beta.287 and beta.292 fail the recorded rapid Korean and empty-end IBus tracesTerminal.input()so xterm orders them behind its active compositionSortedListsearch-decoration repairThis supersedes the IME architecture introduced by #12259 and the follow-up hotfixes without reverting unrelated terminal behavior.
Design
VS Code and Hyper use unpatched xterm, but they mostly avoid injecting application-owned terminal bytes during composition. Wave injects Shift+Enter directly and has the same race shape as Orca; it is not evidence that stock xterm solves the ordering problem.
The retained patch stays inside xterm's existing composition owner. It derives Korean commits from saved ranges, accepts exact
InputEvent.datafor empty-end IBus commits, and queuesTerminal.input()data only while xterm already owns a composition. Its internal hook is optional for stock/test composition helpers. It adds no public IME API, Orca callback, session ID, custom DOM event, application tracker, PTY map, class, or production file. Ordinary non-compositionTerminal.input()remains immediate.Deletion
The final application-keyboard adjustment is 12 additions and 80 deletions. It removes the dedicated captured-input dispatcher and its 104-line test file. The xterm IME source delta is 40 added lines including blanks and 48 removed; its unrelated
SortedListhunk is unchanged.Native evidence
tiếng việtcommit/PTY bytes without commit-time normalization.DefaultKeyBinding.dictremap reaches the PTY as backtick; ordinary ABC control passes.Regression and mutation evidence
Terminal.input(), the committing-Enter E2E expected하 하 하\x1b\rbut received하 하 \x1b\r하.하\x1b\r; ordinary non-composition input emits\x1b\rimmediately.한ab한c글; removing the mutable textarea-diff fallback emits exact한abc글while ordinary controls remain green.c; the valid empty-end commit control remains green.Verification
pnpm install --frozen-lockfilepnpm run typecheck:webgit diff --checkScope
This PR does not claim the full IME goalpost is complete. Windows Microsoft Korean native traces, ConPTY/WSL/SSH, Windows rendering at 100/125/150%, Qingg Wubi, and mobile device evidence remain separate acceptance work. Synthetic modifier-loss cases were removed because no recorded native trace contains modifier loss; the Windows Shift-release issues remain uncertified pending native evidence.