Skip to content

[upstream #10078] feat(terminal): opt-in wide East Asian Ambiguous character width - #18

Open
innocarpe wants to merge 10000 commits into
mainfrom
fix/terminal-east-asian-ambiguous-width
Open

innocarpe wants to merge 10000 commits into
mainfrom
fix/terminal-east-asian-ambiguous-width

Conversation

@innocarpe

Copy link
Copy Markdown
Owner

Portfolio mirror of my contribution to upstream stablyai/orca.
Exhibition only — the real review/merge target is upstream.

Upstream

Summary

Summary Opt-in setting for East Asian Ambiguous character cell width (iTerm2-style escape hatch), requested in stablyai#9958. On Windows CJK locales, characters like ① ■ ● ★ → render poorly in Orca because: 1. Unicode 11 width tables report them as width 1 (modern CLI def

Note

  • Do not merge this into innocarpe/orca main until the upstream PR is merged.
  • After upstream merges: sync fork from upstream, then close this mirror PR.
  • This open PR exists so visitors see in-flight work on this fork's Pull requests tab.

@innocarpe
innocarpe force-pushed the fix/terminal-east-asian-ambiguous-width branch from f73f7df to bae2e4e Compare July 28, 2026 13:11
@innocarpe

Copy link
Copy Markdown
Owner Author

Sync update (bae2e4e42)

@DoDAON Thanks for the check-in — still on this, and the remaining two activation sites are now wired.

Headless (headless-emulator.ts)

  • Sets East Asian Ambiguous mode before activateOrcaTerminalUnicodeProvider
  • Runtime passes store.getSettings().terminalEastAsianAmbiguousWidth when creating PTY mirrors
  • Main process also syncs the process-wide mode on settings load/change so live headless buffers stay aligned with the renderer (SSH fidelity)

Mobile (terminal-webview-html.ts + engine)

  • Bundles Orca unicode into the WebView engine (window.OrcaTerminalUnicode)
  • After Unicode11, activates the Orca provider (this path previously stopped at Unicode11 and bypassed Orca entirely)
  • init accepts eastAsianAmbiguousWidth; wide mode also inserts CJK UI fonts ahead of Consolas (same coupling as desktop)

Tests

  • Headless: wide vs narrow ① cell advance
  • Mobile: activate order (open → Unicode11 → Orca → replay); Chrome 74 parse floor still green

Happy to adjust if you want mobile to pull the host setting via settings.get at session open as a follow-up (prop/init path is ready).

@innocarpe

Copy link
Copy Markdown
Owner Author

Sync update (26f03fc82)

Follow-up: 1cb8121 + font-extract test fix are on the branch (earlier sync comment referenced a pre-push tip).

@DoDAON — remaining activation sites are wired as described above. Full headless/mobile coverage for stablyai#9958 is in this PR tip.

@innocarpe

Copy link
Copy Markdown
Owner Author

Sync update (46640c27f)

Merge + review follow-up (46640c27f)

  • Rebased/merged onto latest main — conflict was only mobile imports; kept both TERMINAL_EAW_JS and TERMINAL_WHEEL_SCROLL_JS.
  • Greptile P2: dropped BMP PUA U+E000–U+F8FF from the EAW ambiguous table so Nerd Font / Powerline / OMP icons stay single-cell in wide mode (with regression tests).
  • Greptile note: setTerminalEastAsianAmbiguousWidthMode now runs once before the appearance pane loop (not per pane).
  • Extracted HeadlessEmulatorOptions to stay under max-lines after the main merge.

Evidence: east-asian-ambiguous-width.test.ts PUA cases + existing width suites.

@innocarpe
innocarpe force-pushed the fix/terminal-east-asian-ambiguous-width branch from 46640c2 to bd9f9d2 Compare October 29, 2026 09:34
brennanb2025 and others added 24 commits November 1, 2026 15:54
…over (stablyai#37157)

* fix(ui): notification cards lift only for the chat input they would cover

The lift measured the composer's full-width wrapper, so with the right
sidebar open the update card rose above an input it never covered. Measure
the centred input column instead, and keep observing the full-width strip so
a sidebar toggle that moves the column still re-measures.

* fix(ui): notification cards re-measure when only the chat input column resizes

Changing the chat width setting resizes the centred input column while its
full-width pane keeps its size, so the cards could stay over Send and Stop
or stay lifted for nothing. Observe the measured column as well as the pane.

* test: drop a type assertion in the notification card stack test
…ts box went away (stablyai#37234)

The diff-review dock has no next-step bar, so its bottom action now offers
Resolve with <agent> for a conflicting pull request, with the launch notice.
In the hub the bar shows its agent launch notice on the Pull request tab
too, since the removed box was the one that showed it there, and an Unlink
failure reaches the bar's notice now that the PR tab has no footer.
…blyai#37184)

* test(e2e): expand child agent lists in spinner benchmark fixture

Sub-agent lists start collapsed since stablyai#36936, so the spinner benchmark's
working subagent rows never mounted and the census assertion failed.

* test(e2e): wait on child-agent disclosure expansion instead of sleeping
…ablyai#37153)

Offscreen or clipped working rings dropped their CSS animation through one
shared IntersectionObserver; revealing a ring restarts it and the existing
animationstart anchor keeps every ring on the shared phase.

The spinner bench gains an always-on comparison variant and reports
compositor frame counts.
…ablyai#36871)

* docs(settings): point the Chat or CLI choice at Settings → Agents

The Settings → Chat → Providers page was removed; the default and the per-agent choice now live in Settings → Agents.

Tracked in STA-13195.

* docs(settings): say the Chat | CLI choice is for supported agents on this computer
…so it shows on light themes (stablyai#36583)

* fix(terminal): tint the scrollbar thumb from the terminal foreground so it shows on light themes

* fix(terminal): dim the foreground-tinted scrollbar thumb on dark themes

* fix(terminal): keep the scrollbar thumb at least as visible as the legacy grey on muted dark themes

* fix(terminal): document the opaque cap on the scrollbar contrast floor
…e in Appearance, and offer catalog themes in the pickers (stablyai#36828)
… reconnect (stablyai#37163)

* fix(terminal): send exactly one mode-2031 report per flip, including after reconnect

xterm 6.1's built-in DECSET 2031 handling sent a second ?997 report on every
appearance flip alongside Orca's own push, and a flip that happened while a
pane's stream was down was never delivered. Orca panes now own mode 2031 and
?996n, the push no longer waits on the phone-fit override, and onConnect
catches the pane up through the existing dedupe.

Closes stablyai#10913

* fix(terminal): catch up legacy relay reattach and forget 2031 on process replacement

* fix(terminal): keep 2031 with the viewer holding the grid and catch up on release

* fix(terminal): re-send 2031 after another viewer's hold and keep owed reports across repeated DECSET
…tablyai#37218)

* feat(mobile): give Tasks and Automations their own sections on Home

Home's bottom bar squeezed Tasks, Automations and New workspace into
three equal buttons whose labels cut off on phones. Tasks and
Automations now each get a section under Desktops, matching the old
Tasks card, and the bar keeps New workspace at full width. The
desktop's phone preview is redrawn to match.

* fix(mobile): neutral Tasks subtitle and a preview that shows both sections

The Tasks row said "Issues and pull requests", GitHub's wording, to GitLab,
Linear and Jira users too; it now reads "Browse your issues and reviews".
Section subtitles wrap to two lines so translations and large text aren't
cut. Each section now owns its desktop picker.

The desktop phone preview cut off the new sections in its narrow frame and
in shorter windows. It now shows two Jump back in rows, and drops the extra
rows when the frame is narrow so Tasks and Automations stay in view.

* chore: drop unrelated pnpm-lock.yaml churn from the main merge
…7167)

* fix(antigravity): avoid built-in skill files in repositories

* fix(antigravity): say which runtime releases write the skill file

* test(antigravity): read the recorded 1.4.1 model and Effort options

* test(antigravity): type the recorded option key
* Read the Claude account route off the main thread for chat reads and sends

Chat option reads, model-list reads and every send resolved the selected
Claude account through the router's synchronous state-file read. Route them
through an async twin that shares the same login cache. A relaunch for a
removed account no longer prepares (and recreates) its folder.

* Chats follow an account switch for worker results too

A coordinator chat that had started any worker kept answering every
message on the account it used before a switch, until every worker it
started finished and every result was read. Every new turn, including a
worker's result, now launches on the selected account. A reply already
running finishes where it started, and a chat whose own background work
is still running keeps its process until that work ends.

This removes the per-account result tracking that held the old account
(the parent-work query, the response index and its queued and
usage-limit carve-outs, the input account recipe on the startup attempt,
and the read-only journal restore that only fed it), plus the journal
index and change-feed fields only it read. A relaunch can no longer
prepare, and so recreate, a removed account's folder. The record still
saves the account each launch actually ran on, for Session History.

* Chats reading the Claude account at the same time share one read of its state file

* Test worker results after an account switch through the real account choice, next to a user's message

* Pass the mailbox pointer's sender snapshot in the account-switch worker test

* Import worker custody helpers once in the process listing, and build the expected homes without a shared object
…r reduced motion (stablyai#37162)

The stale-review shimmer animates background-position on the main thread for
as long as review data stays stale, once per sidebar card. It now steps 30
times per sweep and pauses when its card is out of view. Pending-check
spinners also pause offscreen, and pending checks, the phone-driver dot and
the notebook busy pulse stop under reduced motion.
…thing changes (stablyai#37188)

* perf(browser-pane): stop the client-hosted page position loop when nothing changes

The shared position driver requested an animation frame every frame for as
long as any client-hosted page or docked DevTools was shown, keeping the
renderer and compositor at display refresh rate while the app sat idle.

Frames now run only in a short settle window after something that can move a
pane or open an overlay: DOM mutations, viewport resize/scroll/DPR changes,
transitions and animations, input/focus/drag events, font and resource loads.
Finite running animations extend the window; endless spinners do not. The
DevTools dock also resyncs directly on drag passthrough changes.

* perf(browser-pane): settle position syncs in two frames and ignore terminal/editor DOM churn

Busy-case measurement showed the 250 ms settle window kept syncs at 60/s
under any steady DOM traffic (sidebar rows re-rendering every 200 ms,
xterm scrollbar style writes while output streams). Every DOM change
already wakes the driver, so two frames per wake are enough; mutations
confined to .xterm/.monaco-editor can't move panes and no longer wake it.

* perf(browser-pane): recheck client-hosted page position once a second without frames

A pane move with no DOM mutation, event or CSS animation (a style sheet
edit, a script-driven animation) left the overlay stale until the next
wake. A frameless 1 s recheck bounds that; unchanged rects write nothing,
so an idle app still requests no frames.
* Adjust Chat UI announcement rollout and show a nonblocking card

- Assign new profiles to an 80/20 control and treatment experiment,
  with treatment split between all users and eligible harnesses.
- Show terminal-default users a corner card and record targeting
  assignments to measure outcomes.

* Refine the Chat UI announcement card layout and copy

* Add live switching demo to Chat UI launch tip experiment

* fix test

* Shorten Chat UI announcement telemetry documentation

* Add a swapped-button cohort to the Chat UI launch tip

- Assign 10% of new enrollments to the new variant while preserving existing assignments.
- Track live-switching link exposure and simplify the demo copy.

* Adjust Chat UI launch tip rollout and switching options

- Add a centered dialog cohort and independently vary button emphasis.
- Target users who have not switched and allow switching back to terminal.
- Record live-switching exposure only when the link is visible.

* Validate persisted chat tip emphasis before initializing telemetry

* Target chat UI launch tips using the current default surface

Freeze eligibility at enrollment while preserving the historical audience.
* Bound agent journal queue before reading control binds

Limit startup queue growth by bytes and operation count, while preserving
backpressure and allowing final Pi events to drain after exit.

* Test read pause and resume for large Claude messages
OrcaWin and others added 28 commits November 2, 2026 16:25
* fix(native-chat): keep pending messages marked as sending

* fix(native-chat): keep pending feedback continuous through recording
* test: remove 102 low-value renderer store tests

* test: remove 102 low-value renderer store tests
)

* refactor: group desktop integration and lifecycle owners

* refactor: preserve runtime literals and mock owner boundaries

* refactor: link historical reliability evidence to current test paths

* refactor: retain the historical lid-sleep baseline path
* refactor: group agent launch and workspace hook owners

* refactor: align trust CI scope and reliability paths
…ks package (stablyai#37446)

* fix(dsh): report hooks as partial when a DSH profile cannot load the executor package

* fix(dsh): name only the broken profiles and print hook detail for failing states

* refactor(dsh): fold the profile package check into the installed branch
…yai#37551)

* fix(agents): stop agent rows showing pasted data as their name

Fixes stablyai#29842

* fix(agents): keep the board card's task as the raw prompt

The card only shows task when no "You" line exists, so the label never rendered.

* refactor(agents): route activity titles and mobile rows through the row label owner
… refused (stablyai#37552)

* fix(chat): name the attachment that expired when a send is refused

The claim step knew which uploads were gone but threw a bare error, so the
refusal could only say "This attachment expired". It now carries each expired
upload's id and file name: every client names them, and desktop marks those
image chips. Older hosts and clients keep today's generic words.

* test(chat): read expired-attachment details through the wire reader
…tablyai#37564)

Claude reopens one branch of a shared transcript on resume, so a pane could silently come back showing the other pane's conversation.

Refs stablyai#31545
…s at another URL (stablyai#37575)

* feat(browser): guard page commands with an expected URL

* fix(browser): refuse an empty --expect-url and check it on dialogs and the forwarding desktop

* fix(browser): recheck the expected URL right before keys go out

* refactor(browser): drop duplicate session type, dialog alias and per-capability sidecar fields

* chore(browser): satisfy the changed-code gates for the expected URL guard
…o its shell (stablyai#37563)

* fix(orchestration): fail worker-start promptly when the agent exits to its shell

* test(orchestration): keep the exit watch helper's void return
…7614)

* refactor: group workspace creation and preparation owners

* refactor: coalesce concrete owner type imports

* test: preserve IPC default-ref mock at its concrete owner
* Open large pasted text and attached text in structured chats

* Read pending pasted text before its host route resolves

* Pass structured attachment eligibility from the owning chat

* Preserve composer and Markdown state when inspecting text attachments

* fix: preserve attachment identity and cancel deferred reads

* test: consolidate phone attachment rendering contracts

* Scope attachment previews to visible chats and share route indexes

* test: consolidate duplicate attachment preview coverage

* perf: share remaining workspace catalog derivations

* feat(chat): open text attachments from structured goal objectives

* fix(chat): reuse preview owner and bind app hooks

* refactor(chat): trim duplicate tests and unused capability initialization

* test(chat): share routing scope mount fixture

* Fix routing performance attribution and folder row imports

* Share attachment capability through its domain module

* Align attachment fixtures and warm routing contracts with current gates

* Preserve relay connection timeout default for ordinary requests

* Share image classification ownership and repair integration fixtures

* Repair real attachment integration fixture boundaries

* Expose e2e compiler diagnostics and prune stale read allowance

* Type the recall fixture row ref as a div

* Keep text attachment capability in its existing capability owner

* Keep image MIME bindings in the media type owner

* Own private bridge response completion at the request boundary

* Complete bridge fixture return and retention types

* Localize native chat text attachment preview controls

* Complete attachment preview localization at presentation boundaries

* Preserve legacy preview locale identity and complete localization controls

* Fix typed mobile host witness lookup

* Commit attachment page edits and reset mobile page scroll

* test(chat): remove duplicate preview localization coverage

* fix(mobile): apply page input font and footer safe area

* fix(chat): commit edited page before admitted navigation

* fix(chat): retain field readiness on pending commit

* fix: preserve attachment field focus until control activation

* fix: restore attachment preview styles and canonical close

* Bind mobile input font role to the central theme

* Type font source fixture cases as tuples

* Attribute inherited owner filter work and qualify folder fixtures

* Keep owner filter fixture input types source-derived

* test: retain attachment capability assertion import

* test: focus attachment coverage on important regressions

* Replace text attachment paging with bounded scrolling and trim tests

* Preserve literal phone attachment whitespace and trim unused test meter

* Keep scroll view refs and measurements out of render

* Keep preview collection independent of native clipboard initialization

* Give the phone scroll fixture coherent measured DOM geometry

* Commit attachment scroll extent before restoring its anchor

* Preserve text viewport geometry across bounded reads

* Unify bounded text scrolling around the viewport

* Preserve the live text anchor across viewport resizing

* Measure committed text viewport bounds from the host

* Preserve live attachment position across native client extent changes

* Use the actual first source block in the resize regression fixture

* Reuse subscription handle type

* Keep attachment effects keyed to their existing triggers

* Keep attachment rows within the committed track

* Allow the full attachment renderer contract to settle

* Open text attachment previews in a large modal

* Preserve attachment modal header layout with primitive-owned styles
…#37626)

* fix(mobile): wait for runtime readiness before option picks

* test(mobile): type readiness probe RPC mock
* fix(history): retain unreadable transcript errors

* test(history): pass nullable sizes to cache fixtures
Add terminalEastAsianAmbiguousWidth (narrow|wide, default narrow) so CJK
locales can match conhost double-width ambiguous glyphs (① ■ ★ →) without
changing the modern CLI-aligned default. Wide mode also inserts CJK UI
fonts ahead of Consolas so full-size glyphs fill the two-cell slot.

Closes stablyai#9958
buildFontFamily only adjusts the CJK fallback stack; activate Orca's
unicode provider (and wide ambiguous mode) before writing the sample
buffer so the preview measures like live panes.
DoDAON / stablyai#9958 asked for all three activation sites. Desktop already set
mode + OrcaUnicodeProvider; this pass completes the twins:

- Headless: honor eastAsianAmbiguousWidth (runtime store + settings sync)
- Mobile: bundle Orca unicode into the WebView engine and activate after
  Unicode11 (was bypassing Orca entirely); CJK font stack when wide
- Provider as plain object so the Chrome 74 engine floor parses cleanly

Evidence: headless-emulator-unicode-width + mobile engine/html tests
@innocarpe
innocarpe force-pushed the fix/terminal-east-asian-ambiguous-width branch from fdeabc0 to 962ea46 Compare November 3, 2026 02:55
@innocarpe

Copy link
Copy Markdown
Owner Author

Sync update (962ea467f7)

Rebased onto current upstream/main. The startup import conflict keeps the moved applyAppIcon path and this PR's setTerminalEastAsianAmbiguousWidthMode call, so wide East Asian Ambiguous width still applies at launch.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.