Skip to content

fix(terminal): align CJK IME preedit spacing - #19367

Merged
nwparker merged 10 commits into
mainfrom
nwparker/bug-ime-preedit-advances-1px-wider-per-full-widt
Sep 19, 2026
Merged

nwparker merged 10 commits into
mainfrom
nwparker/bug-ime-preedit-advances-1px-wider-per-full-widt

Conversation

@nwparker

@nwparker nwparker commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​675 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​675
Prod 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​462 $\color{#cf222e}{\Huge{\mathbf{−}}}$​151 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​311

ELI5

Japanese IME text can spread farther apart while composing than after confirmation. With the reported UDEV Gothic NF font at 13px and DPR 1, eight characters now occupy the same 96px as committed text, without resizing the glyphs. Appending ASCII or emoji preserves the existing Japanese prefix.

What Changed

  • Correct complete, single-codepoint CJK graphemes with measured letter spacing in ordinary inline runs. Equal corrections share a span; native stretches retain browser shaping, bidi, combining sequences, emoji, and whitespace behavior.
  • Reuse xterm's existing font measurer. Bound cold measurements and styled runs, invalidate on typography/font-loading changes, and use the active renderer's CSS cell width.
  • Preserve preedit/caret nodes when a terminal repaint changes only the row remainder. Regenerate the source patch, bundles, sourcemaps, and lockfile together.

Why

Stock xterm reproduces the mismatch: WebGL rounds the half-cell to 6px, while native preedit text advances 13px per fullwidth glyph. Orca's inherited letter spacing adds another 0.16px per glyph. Resetting inherited spacing alone leaves the primary mismatch. CompositionHelper already owns this overlay and has no public extension point for its layout, so the existing source patch remains the appropriate boundary.

The work budget applies to new measurements and styled spans, rather than switching an entire composition between layout modes. A repeated 10,000-character CJK string uses one measurement and one span. Expensive alternating or varied text keeps its remaining tail in native layout after the budget is consumed. That tail, and unsupported multi-codepoint clusters, deliberately retain the original spacing; this is not universal grid parity for arbitrary text.

Linked Issue

Fixes #19315.

Other open IME reports were checked; no confirmed duplicate or additional fix is claimed. #18963 concerns dictation flicker, #19284 Cursor-specific Korean input, #19156 disappearing Korean characters, #15192/#15550 duplication/disappearance, and #18283 a separate mobile patch gap.

Visual Proof

Native Japanese input on the M4 Air reproduces the original problem and verifies the fix with the same UDEV font, size, and DPR. Both builds commit the exact eight characters once. Actual Electron captures, cropped and enlarged without smoothing:

Native Japanese before/after: 105.28125px becomes the correct 96px

The following hidden-renderer captures compare committed text with preedit and verify prefix continuity after appending ASCII:

Before and after: preedit matches the committed 96px grid

Before and after: appending ASCII preserves the Japanese prefix

Testing

Production patches and lockfile are byte-identical to 1db4dc04; subsequent commits only correct the regression fixture's subpixel tolerance and available width. Remote installed source and runtime hashes were checked, not just checkout names.

  • 571 focused unit tests across 42 files pass locally; 32 broader Electron cases pass, with four Linux-only cases skipped on macOS.
  • pnpm tc:web, changed-code quality, frozen install, E2E build, and generated xterm patch reproducibility pass.
  • The final seven-case grid/shaping suite passes locally at 85bc7687, preserving DPR 1/1.25/2. Chromium's per-inline-run 1/64px rounding is accounted for; repeated CJK retains a 0.05px tolerance. The owned test window is sized to avoid wrapping the committed reference.

Hosts were discovered with orca host list; dedicated checkouts, remote shells, and evidence retrieval used Orca CLI. Native input used OS keyboard injection and actual input sources; renderer inspection used Playwright/CDP. Native, hybrid, and synthesized-event coverage are distinguished below.

Platform Rendered/replay checks Native OS input
M4 Air, macOS 26.6.2 ARM64 26 unique cases covered; final grid 7/7 after the rounding correction UDEV Japanese before/after at DPR 1, fixed DPR 2, Korean, candidate conversion, delete-to-empty cancellation, Japanese→ABC, and final-column caret pass with exact bytes. Korean original-cadence cases pass 9/9 on each build, plus 3/3 paced cases on the fix.
Windows 11 Pro x64 (awin) 488 unit tests pass; broad Electron run 32 pass / 5 skip. Final grid suite 7/7 at 85bc7687 resolves both earlier reference-wrapping failures Real SendInput Japanese and Korean pass: Japanese 112px = 16×7px cells; active Korean 글 14px = 2×7px cells. Exact UTF-8 commits. Chinese converts to 你好 with exact bytes through a route that emits no DOM composition events.
Ubuntu 24.04.4 (openclaw, private Xvfb) 12/12 applicable cases: 8 grid/shaping/continuity, including software WebGL, plus 4 Linux exact-byte replay cases IBus Hangul produces actual native preedit and mixed Korean/ASCII text. A 30-line hybrid run with CDP Enter preserves every byte; fully native Enter is unpassed and fails identically in a baseline comparison.

Windows native Japanese screenshot · Windows native Korean screenshot · Linux native Hangul preedit screenshot

Windows's five patch-generator test failures exercise unchanged baseline path normalization; the generator and its test are identical to main. Linux initially required a process-local Mesa/software renderer selection to avoid an Xvfb/NVIDIA startup crash. Neither prompted a production change.

Four matched warm browser batches preserve all text across 1,024 measured updates and emit no PTY data. Median handler times (UDEV 13px, DPR 1, WebGL):

Input Base This change
128 repeated CJK 0.5–0.6ms 0.6ms
10,000 repeated CJK 2.2ms 3.9–4.0ms
10,000 alternating CJK/Latin 21.7–25.8ms 22.6–26.7ms
10,000 distinct Han 5.2–6.2ms 5.7–6.8ms

A further 36 fresh Electron runs produced 72 paired cold samples with reversed variant order, exact text, and zero data events. First-position WebGL medians (base/current): 8.3/10.2ms for 128 CJK, 17.0/19.1ms for 10k distinct Han, and 27.8/30.7ms for 10k alternating CJK/Latin. The earlier unmatched 51ms observation did not recur; the largest current handler was 30.7ms (DOM: 30.3ms). OS font caches were not flushed. Alternating stress exceeds a frame in the baseline too; this does not establish a universal latency bound.

Owned remote test apps were closed, original macOS/Windows input sources and focus were restored, and Windows temporary install settings were restored. Linux host inspection confirmed no remaining test processes and a restored current build; some older shell-close receipts remained unverifiable and were not treated as confirmed exits. Local validation stayed background-only. Windows input was injected on the remote host during an active RDP session; this does not test keyboard forwarding through RDP.

Review

Functional, performance/resource, and compatibility sub-agent reviews completed against the readiness checklist. No proven new defect remains within the documented scope. Review covered source/bundle integrity, disposal, bounded allocations, font invalidation, native shaping, prefix continuity, and client/host boundaries. The final test-only delta was independently re-reviewed. Zero candidate findings remain, so severity counsel was not required.

Agent skill upstream boundary

  • Not applicable: no agent-skill sharing or upstream installer source is changed.

Notes

This changes client-side provisional text rendering. It adds no PTY bytes, protocol, persistence, process, SSH execution, or workspace-type assumptions. Paired web shares this renderer; native mobile has a separate package graph.

Remaining coverage limits: Windows Chinese delivered exact converted text through an OS route with no DOM composition events, so it does not verify xterm preedit. Linux full-native Enter failed identically on baseline (no native Return key events in this background harness); native Japanese/Mozc activation remains unproven. Linux WebGL used SwiftShader on private Xvfb; physical GPU/Wayland behavior was not exercised. Safari/paired-mobile rendering, WSL/RDP-specific IME forwarding, and live terminal SSH network-fault scenarios were not tested. Operating the Linux evaluation host over SSH does not certify those failure paths.

The PR remains a draft. At 85bc7687, the test-LoC check passed, but PR Checks were manually cancelled before validation completed; the aggregate verify job was still queued at the last check. Current-head CI is not green: require a passing run before merge. No universal zero-regression guarantee is claimed.

Checklist

  • Scope is limited to preedit rendering and its regression coverage.
  • Change and rationale explained, including ELI5.
  • Before/after visual proof attached outside the diff.
  • Correctness, security, performance, cross-platform, SSH, and compatibility impact reviewed.
  • Focused tests, renderer typecheck, changed-code checks, build, and patch sync pass; full CI will validate the pushed revision.

@nwparker nwparker changed the title fix(terminal): align IME preedit to terminal cell grid fix(terminal): align CJK IME preedit with terminal cell widths Sep 7, 2026
@nwparker nwparker changed the title fix(terminal): align CJK IME preedit with terminal cell widths fix(terminal): align CJK IME preedit with terminal cell widths (hold) Sep 7, 2026
@nwparker nwparker changed the title fix(terminal): align CJK IME preedit with terminal cell widths (hold) fix(terminal): align CJK IME preedit spacing Sep 7, 2026
@bongho

bongho commented Sep 9, 2026

Copy link
Copy Markdown

This looks like the same defect as #18293, which I filed on 9/3 — mid-line Hangul drawn one cell wide where the grid gives it two. The 한글 assertion in terminal-ime-xterm-preedit-cell-grid.test.ts (cell-width * 2 - 11.25px) is exactly my case, and the mid-line tail suite composes 한/글 over committed text. Grabbing the adhoc build to run my original repro (macOS 26.5.2 arm64, Orca v1.4.195, DPR 2) and will report back. Mind adding Fixes #18293 if you agree it's the same one?

@nwparker

nwparker commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

This looks like the same defect as #18293, which I filed on 9/3 — mid-line Hangul drawn one cell wide where the grid gives it two. The 한글 assertion in terminal-ime-xterm-preedit-cell-grid.test.ts (cell-width * 2 - 11.25px) is exactly my case, and the mid-line tail suite composes 한/글 over committed text. Grabbing the adhoc build to run my original repro (macOS 26.5.2 arm64, Orca v1.4.195, DPR 2) and will report back. Mind adding Fixes #18293 if you agree it's the same one?

Not sure
Could you give these instructions a spin?
Let me know! #19315 (comment)

Would be awesome if it is the same

@nwparker
nwparker force-pushed the nwparker/bug-ime-preedit-advances-1px-wider-per-full-widt branch from 85bc768 to 42ce57a Compare September 19, 2026 08:15
@nwparker
nwparker marked this pull request as ready for review September 19, 2026 09:42
@coderabbitai

coderabbitai Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Important

Review skipped

We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The patch updates xterm IME handling to track composition transactions, reconcile keypress and input events, defer finalization, and clean up on cancellation, blur, and disposal. It adds grapheme-aware preedit rendering with cell-width corrections, bounded font measurements, caret and row-tail elements, and font-load refreshes. Unit, regression, and end-to-end tests cover rendering, shaping, alignment, continuity, cleanup, and single-commit behavior.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: 🟡 Moderate · up to 42ce5

The required lint workflow currently fails on two new test helpers. Replace the reflective reads or add justified scoped suppressions before merging.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 4 files. (2 skipped: 2 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: aligning CJK IME preedit spacing in the terminal.
Description check ✅ Passed The description is complete and directly covers the user impact, implementation, rationale, linked issue, visual proof, testing, compatibility, performance, and review status. It also states that curr…
Linked Issues check ✅ Passed Issue #19315 requires IME preedit advances to match terminal cell advances at affected DPR, font, and size combinations. The patch adds CJK grapheme-width correction with bounded measurements, styled …
Out of Scope Changes check ✅ Passed The reviewed changes stay connected to issue #19315. Composition lifecycle handling, repaint node reuse, cache invalidation, documentation, generated patch updates, and regression tests support correc…
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 4 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 28e58cf3-b129-4ba0-8efa-bf9ea0bbf899

📥 Commits

Reviewing files that changed from the base of the PR and between 3af09f8 and 42ce57a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • config/patches/@[email protected]
  • config/patches/xterm-src/@[email protected]
  • docs/reference/ime-regression-checklist.md
  • src/renderer/src/components/terminal-pane/terminal-ime-xterm-midline-preedit-tail.test.ts
  • src/renderer/src/components/terminal-pane/terminal-ime-xterm-preedit-cell-grid.test.ts
  • tests/e2e/terminal-ime-preedit-cell-grid.spec.ts
  • tests/e2e/terminal-ime-preedit-continuity.spec.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.

Comment on lines +47 to +67
const core: unknown = Reflect.get(terminal, '_core')
if (!isImeTerminalCore(core)) {
throw new Error('xterm internals are unavailable')
}
return core
}

function isImeTerminalCore(value: unknown): value is ImeTerminalCore {
const renderService = objectProperty(value, '_renderService')
const dimensions = objectProperty(renderService, 'dimensions')
const css = objectProperty(dimensions, 'css')
const cell = objectProperty(css, 'cell')
const compositionHelper = objectProperty(value, '_compositionHelper')
return (
typeof objectProperty(cell, 'width') === 'number' &&
typeof objectProperty(compositionHelper, 'updateCompositionElements') === 'function'
)
}

function objectProperty(value: unknown, key: string): unknown {
return typeof value === 'object' && value !== null ? Reflect.get(value, key) : undefined

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

rg -n 'no-reflect-get|anti-slop|Reflect\.get' package.json pnpm-lock.yaml .github config scripts src/renderer/src/components/terminal-pane/terminal-ime-xterm-preedit-cell-grid.test.ts 2>/dev/null
rg -n '"(lint|check|typecheck|test)[^"]*"\s*:' package.json packages/*/package.json apps/*/package.json 2>/dev/null

Repository: stablyai/orca

Length of output: 16713


🏁 Script executed:

printf '%s\n' '--- package scripts ---'
sed -n '1,35p' package.json
printf '%s\n' '--- anti-slop config ---'
sed -n '1,125p' config/oxlint-anti-slop.json
printf '%s\n' '--- PR workflow ---'
sed -n '125,148p' .github/workflows/pr.yml
printf '%s\n' '--- changed-code checker ---'
sed -n '330,360p' config/scripts/check-changed-code-quality.mjs

Repository: stablyai/orca

Length of output: 10093


Resolve the anti-slop/no-reflect-get lint errors.

anti-slop/no-reflect-get is configured as an error. The audit scans src, and both lint and the PR workflow run this audit. Both Reflect.get calls therefore fail the ordinary lint workflow.

Replace the dynamic reads with typed property access, or add a scoped disable with a reason.

♻️ Proposed fix using typed access
 function rendering() {
-  const core: unknown = Reflect.get(terminal, '_core')
+  const core: unknown = (terminal as unknown as { _core?: unknown })._core
   if (!isImeTerminalCore(core)) {
     throw new Error('xterm internals are unavailable')
   }
   return core
 }
@@
 function objectProperty(value: unknown, key: string): unknown {
-  return typeof value === 'object' && value !== null ? Reflect.get(value, key) : undefined
+  return typeof value === 'object' && value !== null
+    ? (value as Record<string, unknown>)[key]
+    : undefined
 }
📝 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.

Suggested change
const core: unknown = Reflect.get(terminal, '_core')
if (!isImeTerminalCore(core)) {
throw new Error('xterm internals are unavailable')
}
return core
}
function isImeTerminalCore(value: unknown): value is ImeTerminalCore {
const renderService = objectProperty(value, '_renderService')
const dimensions = objectProperty(renderService, 'dimensions')
const css = objectProperty(dimensions, 'css')
const cell = objectProperty(css, 'cell')
const compositionHelper = objectProperty(value, '_compositionHelper')
return (
typeof objectProperty(cell, 'width') === 'number' &&
typeof objectProperty(compositionHelper, 'updateCompositionElements') === 'function'
)
}
function objectProperty(value: unknown, key: string): unknown {
return typeof value === 'object' && value !== null ? Reflect.get(value, key) : undefined
const core: unknown = (terminal as unknown as { _core?: unknown })._core
if (!isImeTerminalCore(core)) {
throw new Error('xterm internals are unavailable')
}
return core
}
function isImeTerminalCore(value: unknown): value is ImeTerminalCore {
const renderService = objectProperty(value, '_renderService')
const dimensions = objectProperty(renderService, 'dimensions')
const css = objectProperty(dimensions, 'css')
const cell = objectProperty(css, 'cell')
const compositionHelper = objectProperty(value, '_compositionHelper')
return (
typeof objectProperty(cell, 'width') === 'number' &&
typeof objectProperty(compositionHelper, 'updateCompositionElements') === 'function'
)
}
function objectProperty(value: unknown, key: string): unknown {
return typeof value === 'object' && value !== null
? (value as Record<string, unknown>)[key]
: undefined
🧰 Tools
🪛 GitHub Check: static analysis

[failure] 67-67: anti-slop(no-reflect-get)
src/renderer/src/components/terminal-pane/terminal-ime-xterm-preedit-cell-grid.test.ts:67:56: Replace Reflect.get with typed property access. Parse dynamic input into a named domain type before reading it.


[failure] 47-47: anti-slop(no-reflect-get)
src/renderer/src/components/terminal-pane/terminal-ime-xterm-preedit-cell-grid.test.ts:47:25: Replace Reflect.get with typed property access. Parse dynamic input into a named domain type before reading it.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — reviewed all 8 changed files at 42ce57a (7 commits) against main (3af09f8).

  • CJK preedit cell-grid correction — the xterm source patch adds CompositionPreeditRenderer, which segments the preedit with Intl.Segmenter, measures each single-codepoint CJK grapheme with the existing WidthCacheFontVariantCanvas, and wraps equal-correction runs in inline spans whose letter-spacing: calc(var(--xterm-composition-cell-width) * columns - measuredWidth px) makes each run advance by exactly columns × cellWidth. Marks, emoji, multi-codepoint clusters, and non-CJK text stay as plain text nodes so native shaping is preserved. A MAX_PREEDIT_LAYOUT_WORK = 128 budget bounds cold measurements plus styled runs, leaving the uncorrected tail native.
  • Repaint preservation — _renderCompositionView is split so a row repaint updates only the covered-tail node (_renderCompositionRemainder), keeping the preedit and caret DOM nodes stable; --xterm-composition-cell-width is published on the view so a resize re-aligns spans without re-measuring; the helper textarea anchors to the preedit rect rather than the whole view.
  • WidthCacheFontVariantCanvas export — exported so the renderer can reuse xterm's font measurer.
  • Tests/docs — a new 36-case unit suite plus two Electron/CDP e2e specs assert grid alignment, prefix continuity, native shaping, and bounded work; the midline-tail test now pins node identity across repaints; ime-regression-checklist.md documents the invariant.
  • Generated artifacts — the bundled .patch and pnpm-lock.yaml patch hash are regenerated in sync (the lockfile hash matches the sha256 of the bundled patch).

I verified the source-level delta by reconstructing both patches' new-side sources: the only semantic changes are the renderer, the render/remainder split, the constructor param, the WidthCache export, and the trailing newline — the pending-composition/transaction hunks visible in the diff-of-patch are alignment noise, not source changes. All 13 terminal-ime-xterm-* unit files pass (177 tests), and pnpm run typecheck:web is clean.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@nwparker
nwparker force-pushed the nwparker/bug-ime-preedit-advances-1px-wider-per-full-widt branch from 42ce57a to 46e41ae Compare September 19, 2026 23:02

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — reviewed the two commits landed since the prior pullfrog review (42ce57a); both are test-only.

  • Removed reflective internals access in the grid unit fixture — rendering() narrows through a hasTerminalCore type guard and reads terminal._core directly, and isImeTerminalCore was rewritten with an isRecord helper, dropping both Reflect.get calls that anti-slop/no-reflect-get flagged.
  • Tagged the WebGL grid matrix @headful — the DPR × GPU describe now runs in the electron-headful project, so setTerminalGpuAcceleration('on') exercises a real WebGL context rather than failing the sample.webgl assertion under the headless project. The untagged native-shaping test in the same file stays headless.

The production xterm patch and lockfile are unchanged since 42ce57a. I re-applied the current patch locally and confirmed the 36-case unit suite passes, pnpm tc:web is clean, and oxlint reports no findings on both changed files.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — reviewed the single commit landed since the prior pullfrog review (46e41ae); it is a CI-unblocking editor refactor unrelated to the IME work.

  • Restored DiffViewer under the max-lines budget — replaced the local isDark computation with the shared resolveDocumentTheme(settings?.theme ?? 'light') and folded the two font-size consts together, dropping DiffViewer.tsx from 402 to 400 counted lines. Repo-wide oxlint was already failing on main at 402 lines (confirmed via the failed static analysis job on 46e41ae: DiffViewer.tsx:445:2: File has too many lines (402).), so this repairs a pre-existing breakage rather than one the IME commits introduced.
  • Behavior preserved — resolveDocumentTheme returns the same value as the removed expression for 'dark', 'light', 'system', and a missing setting; document-theme.test.ts already covers the matchMedia path, and no DiffViewer test pins the old expression.

The IME production patch, lockfile, and test files are unchanged since 46e41ae. The PR remains a draft and its author notes the aggregate CI run is still pending; this review covers the incremental delta only.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@nwparker
nwparker force-pushed the nwparker/bug-ime-preedit-advances-1px-wider-per-full-widt branch from b5440c1 to 9d249b9 Compare September 19, 2026 23:31
@nwparker
nwparker merged commit 85a3ba6 into main Sep 19, 2026
37 checks passed
nwparker pushed a commit to ethznn/orca that referenced this pull request Sep 24, 2026
CompositionHelper built the rendered row tail from translateToString, which
returns characters and drops every cell attribute, so a dim placeholder or a
coloured prompt came back in the default foreground and read as entered text.

The tail is now emitted as runs that share a rendered style, each carrying what
the grid resolved for it: palette, RGB and default foregrounds, backgrounds,
dim, bold, italic, inverse, invisible, underline style and colour, strikethrough
and overline. A run that needs no override stays a bare text node, so a default
tail emits exactly the DOM it did before.

Re-cut onto stablyai#19367, which split the remainder into its own renderer so a row
repaint keeps the preedit and caret nodes. The runs go inside that renderer and
the refresh is keyed on text and styling together, since a repaint that only
recolours a row leaves its characters identical.

Fixes stablyai#16025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: IME preedit advances 1px wider per full-width char than the terminal cell grid (dpr 1 + 0.5em-advance font + odd font size)

2 participants