Commit Graph

264 Commits

Author SHA1 Message Date
Neil f9e18910ae
chore(lint): adopt unicorn/prefer-import-meta-properties (error) (#6847)
Migrate fileURLToPath(import.meta.url) / dirname(...) boilerplate to the
native import.meta.dirname / import.meta.filename, then enable the rule
at error so new code stays on the native form.

The oxlint autofix rewrites the expression but leaves the now-unused
node:url / node:path imports behind (which the already-enabled
no-unused-vars=error would then flag), so this commit also removes those
34 orphaned imports — trimming the named import where other names are
still used, deleting the line where it was the sole import.

Scope is build scripts + Node-env tests only (config/scripts, tools/
benchmarks, *.test.{ts,mjs}, vitest configs); zero shipped runtime code.
The native properties are exact equivalents (Node >= 20.11; repo is on
24), so behavior is unchanged.

Verified: oxlint 0 errors tree-wide (root + mobile), oxfmt clean,
typecheck (node+cli+web) + mobile tsc pass, root vitest 22825 passed /
0 failed, mobile vitest 1018 passed. Exercised the rewritten scripts
directly: build:relay (6 targets), ensure-native-runtime,
verify-macos-entitlements all run correctly with import.meta.dirname.
2026-06-29 23:37:30 -07:00
Neil 46646d7ff1
chore(lint): upgrade oxlint to 1.71 + enable 7 new rules (autofixed backlog) (#6841)
* chore(lint): upgrade oxlint to 1.71 and enable 7 new rules

Upgrade oxlint 1.67.0 -> 1.71.0 (1.72 was blocked by the repo's 3-day
minimum-release-age supply-chain guard; nothing here needs it). The
bump is a no-op on the existing config.

Enable 3 error rules (backlog autofixed to zero in this commit) and
4 warn rules (surface signal without gating CI):

error (autofixed, behavior-preserving):
- unicorn/prefer-node-protocol        (~1531 sites: bare builtin -> node:)
- typescript/no-import-type-side-effects (~36: all-inline-type -> import type)
- unicorn/no-array-reverse            (19: copy-then-reverse -> toReversed)

warn (real signal, current fires are test-only/correct):
- unicorn/no-array-fill-with-reference-type  (aliasing footgun guard)
- typescript/no-unsafe-function-type         (bans bare Function type)
- unicorn/prefer-array-flat-map              (map().flat() -> flatMap())
- unicorn/prefer-regexp-test                 (.match() in bool ctx -> .test())

mobile/.oxlintrc.json extends root, so it inherits all 7; the autofix
ran from root and covered mobile/ too.

Verification (all green): oxlint 0 errors (root+mobile+aux configs),
oxfmt clean, typecheck (node+cli+web), vitest 22795 passed / 0 failed,
builds (electron-vite + web + cli) succeed. node: rewrites confirmed to
skip embedded SSH/CLI string payloads (AST-only); all toReversed sites
verified to operate on fresh copies or write-once locals.

* chore(lint): bump mobile oxlint to 1.71 so inherited rules parse

mobile/ is a standalone pnpm project pinning its own oxlint@1.67, which
lacks unicorn/no-array-fill-with-reference-type (needs >=1.70). Since
mobile/.oxlintrc.json extends the root config, mobile CI's 'cd mobile &&
oxlint' failed to parse the new rule. Bump mobile to match root (1.71).

Verified in mobile/: oxlint 0 errors, oxfmt --check clean, tsc --noEmit
pass, vitest 978 passed / 0 failed.

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Orca <help@stably.ai>
2026-06-29 22:38:29 -07:00
Neil 6130340229
fix: answer startup terminal color queries (#6824) 2026-06-29 21:37:49 -07:00
Jinwoo Hong 22b00a7cd2
fix(terminal): report PTY's applied size so dropped resizes self-heal (split-mount desync) (#6785)
Co-authored-by: Orca <help@stably.ai>
2026-06-29 13:35:43 -07:00
Neil 2739310839
fix(terminal): converge post-spawn PTY size reconcile to fix split-mount column desync (#6725)
* fix(terminal): converge post-spawn PTY size reconcile to fix split-mount column desync

Follow-up to #6644/#6649. Those added a post-spawn PTY reconcile but capped
it at a FIXED 12 requestAnimationFrames whose counter advanced even on frames
where the pane was unmeasurable or the split layout had not yet equalized. When
a tab MOUNTS with a split layout already present (a new worktree opened with the
side split panel on), the real narrow split width settles AFTER frame 12, so the
reconcile gave up while xterm had reflowed narrow and the PTY stayed pinned at
the wide spawn width. The corrective xterm onResize is dropped during the hidden
mount window (isRendererPtyResizeAuthoritative() is false), so process.stdout.columns
stayed wide and interactive TUIs (Claude Code) rendered garbled until a manual resize.

Extract the reconcile into pty-size-reconcile.ts with an authoritative-gated
convergence loop instead of a fixed frame budget:
- While the pane is hidden (onResize dropped), the reconcile is the SOLE corrector:
  it keeps polling and forwarding every grid change (its transport.resize bypasses
  the visibility gate). Hidden frames never advance the settle counter.
- Once visible AND stable for SETTLE_FRAMES, it hands off to the live
  onResize/ResizeObserver path, which reliably catches any later reflow.
- Hard cap (MAX_FRAMES) guarantees termination; mobile-fit/locked frames are
  skipped; the reconcile handle is cancelled on dispose.

Harness: pty-size-reconcile.test.ts (14 tests) drives the loop with a deterministic
frame scheduler; the desync-repro tests fail against the old 12-frame logic and
pass on the fix. Adds an e2e "MOUNTS with a split layout present" test.

Caveat: headless Electron does not reproduce this layout-settle-after-rAF race
(the existing golden e2e passes even against the old buggy logic), which is why
#6644/#6649 merged with green e2e yet the bug persisted. The unit test is the
real regression harness; the e2e tests are integration smoke.

Made with [Orca](https://github.com/stablyai/orca)

Co-authored-by: Orca <help@stably.ai>

* fix(terminal): re-assert PTY size on visibility resume to heal stubborn column desync

Follow-up within the same fix: the user reported "sometimes even resizing
doesn't fix it." Root cause beyond the mount-timing race — the renderer forwards
resizes fire-and-forget and dedupes on the size it THINKS it sent, but never
learns the PTY's actual size. A resize dropped main-side (the pane was hidden,
a mobile take-back resize-suppression window, or a provider no-op) leaves xterm
and the PTY silently diverged; a later same-cols layout fires no onResize, so it
never self-corrects.

Expose the PTY's last-APPLIED size to the renderer and re-assert on show:
- New read-only IPC pty:getSize -> ptySizes.get(id) (the size written only when
  a resize actually lands or at spawn — the authoritative "what the PTY believes
  it is"). Wired through preload (window.api.pty.getSize) + api-types.
- On visibility resume (noteVisibilityResume), the pane re-fits, reads the PTY's
  real size, and re-asserts via forwardPtyResize ONLY on genuine drift — so no
  spurious SIGWINCH on an already-synced resume (which would jar alt-screen TUIs).
  Routed through forwardPtyResize so the authoritative/mobile gates are
  re-checked at send time; remote-runtime PTYs (separate viewport channel) are
  skipped; overlapping resumes coalesce to one query.

Also register pty:getSize in the registerPtyHandlers removeHandler cleanup block
so re-registration (macOS re-activate / new window) doesn't throw on a duplicate
ipcMain.handle, and make the pty IPC test mock throw on duplicate channels like
real Electron so this class of omission is caught going forward.

Tests: 7 resume-reassert cases (drift / match / null / remote-skip /
mobile-fit-skip / hide-during-hop / overlap-coalesce), all non-vacuous. Full
terminal-pane + pty IPC suites green (1494 tests); typecheck (web+node) + oxlint
clean; e2e desync specs pass against a fresh build.

Made with [Orca](https://github.com/stablyai/orca)

Co-authored-by: Orca <help@stably.ai>

* Stub PTY getSize API and skip redundant Wayland GPU sandbox tests

- Implement PTY `getSize` stub in `web-preload-api.ts` to satisfy API
  requirements for the web-preload environment.
- Skip the unfixed Wayland GPU sandbox negative control test if the
  target base branch already contains the sandbox workaround.

---------

Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Jinjing <6427696+AmethystLiang@users.noreply.github.com>
2026-06-29 12:12:35 -07:00
Neil 63e96db7dd
fix(e2e): canonicalize temp repo paths so golden tests pass on macOS (#6718) 2026-06-29 01:24:09 -07:00
Neil eb89255e8f
fix: background-mount hidden automation worktrees before launch (#6568)
Headless automation launches (launchAgentBackgroundSession) created an
inactive tab via createTab(..., { activate: false }) without first telling
the renderer to background-mount that worktree's terminal surface. As a
result the hidden surface either never mounted (no entry in
mountedWorktreeIdsRef) or mounted with display:none (zero-size, can't be
measured/fit), so the eager PTY buffer never flushed on the first mount —
the run tab showed only the shell prompt until an unmount/remount gave the
off-screen xterm a real layout box.

Dispatch BACKGROUND_MOUNT_TERMINAL_WORKTREE_EVENT immediately before
createTab, mirroring the established renderer-backed Codex startup path in
useIpcEvents. The Terminal.tsx listener adds the worktree to
mountedWorktreeIdsRef and marks it measurable for a 3000ms window, so the
hidden surface renders with opacity-0/pointer-events-none (a measurable box)
instead of display:none, letting the first xterm fit flush the buffer.

Extract the inline measurable-mount block into
background-terminal-worktree-visibility.ts (behavior-identical, now
unit-tested) and add unit + E2E coverage.

Fixes #6244

Co-authored-by: ChaDongWun <66347959+lovewave02@users.noreply.github.com>
2026-06-28 23:13:03 -07:00
Jinjing 8430a10a10
fix(terminal): reconcile PTY size after spawn to fix first-mount column desync 2026-06-28 13:56:44 -07:00
Siddiqui Qamar 867c57b93c
fix(renderer): answer OSC color queries from active terminal theme (#6502)
* fix(renderer): answer OSC color queries from active terminal theme

- reply to OSC 10/11 foreground/background queries using the resolved xterm theme

- suppress replayed OSC color replies to avoid leaking escape output into fresh shells

- cover theme-derived color replies and replay suppression with focused tests

* test(renderer): cover terminal OSC color query replies

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
Co-authored-by: Orca <help@stably.ai>
2026-06-27 09:30:29 -07:00
Neil 5363fcd668
Update xterm beta packages (#6486) 2026-06-27 02:37:23 -07:00
Brennan Benson 949b30ea1f
Prevent stale terminal redraw fragments (#6449) 2026-06-26 15:03:41 -07:00
Jinwoo Hong 4904ffda9a
Fix Remote Host downloads and agent status parity (#6436)
* Fix remote host downloads and agent status parity

Co-authored-by: Orca <help@stably.ai>

* Address remote download review comments

Co-authored-by: Orca <help@stably.ai>

* Avoid inefficient SSH chunk fallback

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Orca <help@stably.ai>
2026-06-26 14:28:16 -07:00
Jinwoo Hong 59def7474a
Revert Windows terminal clear repaint fix
Manual Windows testing still reproduces displaced input after Ctrl+K.
2026-06-26 14:05:09 -07:00
Jinwoo Hong daab519c5c
Fix Windows terminal clear repaint (#6382) 2026-06-26 16:59:00 -04:00
Neil fa00464df9
Fix noisy Grok tool notifications (#6306) 2026-06-26 02:19:25 -07:00
Jinwoo Hong 2ec2a98604
Fix Chinese IME composition in terminal chat input (#6396) 2026-06-25 23:32:41 -04:00
Jinwoo Hong ff367431ff
Fix agent resume after force-exit restore (#6391) 2026-06-25 22:10:31 -04:00
Jinwoo Hong d32d62a395
Fix tab switching after terminal tab reorder (#6395)
Co-authored-by: Orca <help@stably.ai>
2026-06-25 18:36:11 -07:00
Jinwoo Hong b651b4be6d
Fix tab switching after missed drag cleanup (#6392)
Co-authored-by: Orca <help@stably.ai>
2026-06-25 17:43:45 -07:00
Brennan Benson 0f8677d7fd
Reveal automation agent logs from the sidebar (#6387)
* Cover sidebar worker log activation

* Cover sidebar worker activation edge cases

* Reveal terminal logs from sidebar agent rows

* Restore warning spy during sidebar tests

---------

Co-authored-by: Neil <neil@stably.ai>
2026-06-25 17:01:33 -07:00
gatsby74 4e45df92ed
fix: forward Ctrl+Enter as kitty CSI-u
Fixes #5966.

Co-authored-by: gatsby74 <166927047+gatsby74@users.noreply.github.com>
2026-06-25 16:38:05 -07:00
Jinwoo Hong cd1d4dfff3
Fix terminal scroll intent across workspace switches (#6319)
Co-authored-by: Orca <help@stably.ai>
2026-06-24 20:16:14 -07:00
Jinjing 5106e33947
fix(changes-tab): prevent freeze and stale highlights when staging/unstaging (#6229)
* fix(changes-tab): prevent freeze and stale highlights when staging/unstaging

When files are staged/unstaged while the Changes tab is open, the
diff viewer was re-rendering all sections, causing UI freezes and
highlight flickering.

- Add resolveCombinedUncommittedSnapshotEntries() to reconcile
  snapshot entries with live git status without destroying existing
  loaded diff content.
- Track retainedResolvedSnapshotEntries from current sections to
  preserve area state when live git status temporarily loses entries.
- Use Map-based O(snapshot + live) algorithm instead of nested loops.
- Add unit tests for the resolver logic.
- Add e2e test with performance measurement for stale unstaged diffs.

Co-authored-by: Orca <help@stably.ai>

* Prevent duplicate entries in uncommitted snapshot resolution

Track resolved snapshot entries using composite area and path keys to
ensure staged and unstaged sections remain distinct and do not duplicate
when live Git status changes or disappears.

Additionally, switch the retained entries from a Map to a list to support
multiple areas per path, and update CombinedDiffViewer to avoid rebuilding
the snapshot list on row load state changes.

* test: add test coverage for duplicate-path snapshot remapping

- Add unit test verifying that duplicate-path snapshots do not remap
  to a retained fallback area.
- Robustify E2E large diff freeze repro test by ensuring interval
  timers are always cleared in a finally block.
- Standardize path utilities in large diff fixtures to ensure cross-platform
  compatibility.

---------

Co-authored-by: Orca <help@stably.ai>
2026-06-23 22:16:20 -07:00
Jinwoo Hong 1b6e65c4ef
Fix terminal paste cancellation on transient blur (#6232)
Fix terminal paste cancellation on transient blur
2026-06-23 21:24:13 -07:00
Trevin Chow 23d14aaa18
fix: reword folder grouping prompt away from "monorepo"
Reword the nested repository import dialog so it asks users whether to group discovered repositories rather than asserting they are a monorepo.

Also keeps locale catalogs aligned with live nested-import strings and updates Electron folder-import coverage for the new affirmative action label.
2026-06-23 21:03:13 -07:00
Jinjing b053e1ac60
Fix diff view scrolling using virtualized scroll anchors (#6190)
* Restore combined diff scroll position using virtualized scroll anchors

Fixes scroll jumping and incorrect restoration in virtualized combined
diff views by tracking scroll position via a stable row anchor (key and
offset) rather than a fragile raw scrollTop.

- Track active row anchors across tab switches and component remounts
- Prevent programmatic scroll events from writing incorrect anchors
- Avoid redundant state updates and re-renders when focusing an
  already focused group

* fix: address review findings
2026-06-23 15:57:29 -07:00
Jinjing 999fbd4217
Prevent redundant SIGWINCH signals on terminal tab restoration (#6177)
Avoid triggering unnecessary terminal PTY resizes and SIGWINCH signals
when restoring terminal tabs or replaying hidden snapshot backlogs. This
prevents alternate-screen TUIs from resetting their viewports or
scrolling to the top when switching tabs.

- Track hidden startup measurement as state and clear it after first visibility
- Suppress forwarding terminal resizes while a pane is hidden
- Avoid resizing or sending SIGWINCH on snapshot replay when dimensions are unchanged
2026-06-23 10:15:06 -07:00
Brennan Benson 17dee0861f
Fix terminal tab switch resume rendering (#6041)
Co-authored-by: Orca <help@stably.ai>
2026-06-23 00:23:34 -07:00
ChaDongWun 814363c45f
fix: preserve source control commit drafts across remounts (#6120)
Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
2026-06-22 22:45:00 -07:00
Jinwoo Hong a0d9505ba5
Fix SSH terminal replay artifacts
Fix SSH reconnect replay ownership and add a Docker-backed regression harness for terminal replay artifacts.
2026-06-22 16:42:20 -07:00
Wolfie e46d4a9267
Fix blank/unclosable mobile emulator tab in floating workspace (#6042)
* Fix blank/unclosable mobile emulator tab in floating workspace

FloatingTerminalPanel only handled terminal/browser/editor content types, so simulator tabs rendered no pane and routed close through closeFile (a no-op for simulator tabs). Treat simulator as its own content type: render EmulatorPane for the active simulator tab, wire activeSimulatorTabId into TabBar, and close via closeUnifiedTab.

* Add floating Mobile Emulator tab E2E smoke test

Adds a deterministic Electron/Playwright spec that seeds a simulator unified tab in the floating workspace, asserts the emulator pane renders, and closes it through the real tab-strip X. Adds stable data-emulator-pane selectors and a data-tab-close-button hook on the simulator tab chrome, plus a targeted package script. No live iOS Simulator or Orca Computer/AX dependency.

* Exclude simulator tabs from floating Close All Files

Close All Files filtered out only terminal/browser tabs, so after the simulator render/close fix it would also close the Mobile Emulator. Simulator tabs are not files; exclude contentType 'simulator' to match terminal/browser behavior, and add a regression test asserting Close All Files closes the editor tab but leaves the simulator open.

* Keep floating simulator tabs mounted

---------

Co-authored-by: Wolfgang Schoenberger <221313372+wolfiesch@users.noreply.github.com>
Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
2026-06-22 16:27:33 -07:00
Jinwoo Hong 338540bf73
fix: refit after single terminal restore (#6089)
Co-authored-by: Orca <help@stably.ai>
2026-06-22 12:29:18 -07:00
Jinjing c139c704af
Add visible PR comment queue action (#6057) 2026-06-21 23:59:29 -07:00
Trevin Chow c6d11efbf2
Make PR comments sidebar easier to triage and read (#5996)
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: brennanb2025 <brennankbenson@gmail.com>
2026-06-21 23:49:43 -07:00
Trevin Chow bfb778570a
feat(tabs): redesign tab splits and terminal pane discoverability (#5927)
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: brennanb2025 <brennankbenson@gmail.com>
2026-06-21 23:09:01 -07:00
Jinwoo Hong 62f1394b44
fix: refit terminals after bulk mobile restore (#5962)
Co-authored-by: Orca <help@stably.ai>
2026-06-20 23:35:37 -07:00
Jinjing 308da355bc
Unify pull request draft title resolution (#5943)
Extract title resolution into a dedicated helper to ensure both inline
and dialog pull request creation flows consistently fall back to
a normalized and humanized branch slug when no eligibility title is
available.

- Normalize remote refs before humanizing branch slugs
- Pre-populate dialog titles when eligibility title is missing
- Update E2E tests to expect pre-populated draft titles
2026-06-20 18:47:39 -07:00
Jinjing 26493072c1
Persist AI PR generation state across worktree switches (#5952)
Connect the ChecksPanel PR draft generation to the global generation
slice, aligning its behavior with SourceControl. This allows detail
generation to continue in the background when navigating away or
switching worktrees, and guarantees that generated fields, terminal seeds,
and branch-preparation push requirements are restored on remount.
2026-06-20 18:16:50 -07:00
Jinjing 44e4d8d4f5
Fix Windows ConPTY probe failures by removing startup control bytes (#5893)
* Fix Windows ConPTY probe failures by removing startup control bytes

Avoid prepending terminal probes with interrupt (`\x03`) or line-kill
(`\x15`) control characters on fresh shell launches. In Windows ConPTY,
echoing a startup Ctrl+C can print a literal "^C" and corrupt the subsequent
PowerShell commands.

- Extract probe command sequence generation to a dedicated helper
- Include E2E unit tests in the Vitest test suite config

* Rename terminal probe E2E test to match unit test pattern

Update the Vitest configuration glob pattern to target only E2E tests
ending in `.unit.test.ts`, and rename the terminal probe input sequence
test to match. This ensures only unit-like E2E tests are picked up
by Vitest.
2026-06-20 02:03:24 -07:00
Jinjing 55055b42af
Use runner Node executable and platform quoting in terminal E2E tests (#5890)
Ensure terminal E2E probes run reliably on Windows CI, where the shell
does not always inherit setup-node's PATH.

- Add `nodeTerminalCommand` helper to resolve and quote `process.execPath`
  for either POSIX shells or PowerShell depending on the platform.
- Update terminal tests and probes to use the new helper instead of
  hardcoded `node` invocations.
2026-06-20 01:27:41 -07:00
Jinjing 5622d0e94f
Stabilize terminal e2e tests on Windows ConPTY (#5881)
* Stabilize terminal e2e tests on Windows ConPTY

Windows ConPTY can drop or reorder the tail of large synchronized terminal
frames or stdout writes when they are written all at once or when the process
exits too quickly.

* Wait for PTY shell readiness before running test scripts.
* Chunk large table writes line-by-line and yield with a short timeout on
  Windows to let the stream drain.
* Add and poll for a synchronized frame tail marker to ensure the entire
  content is rendered before proceeding.

* Remove flaky preflight shell echo in terminal emoji scroll test

The Ctrl+C/Ctrl+U preflight keys sent by `waitForPtyShellEcho` can race
Windows ConPTY startup and eat subsequent test input. Remove this wait
and rely on the fixture marker as the readiness signal instead.
2026-06-20 00:46:37 -07:00
Jinwoo Hong 3478efca08
fix: stabilize release terminal e2e (#5869)
Co-authored-by: Orca <help@stably.ai>
2026-06-19 19:43:42 -07:00
Brennan Benson 6c941d8e75
Fix terminal pane title focus handling (#2756)
Co-authored-by: Orca <help@stably.ai>
2026-06-19 17:50:16 -07:00
Brennan Benson b212c2b87b
Stabilize Windows raw emoji terminal golden (#5852) 2026-06-19 17:23:47 -07:00
Jinwoo Hong 972078f2c4
Fix paste ownership, input bounds, and IPC validation
Supersedes #5745, #5746, and #5747.
2026-06-19 17:14:55 -07:00
Jinwoo Hong abbfb6d53f
fix: handle macOS terminal command arrow scrolling (#5846)
Co-authored-by: Orca <help@stably.ai>
2026-06-19 15:48:03 -07:00
Brennan Benson e7ef7681ae
Fix flaky e2e tests (#5680) 2026-06-18 00:11:32 -07:00
Jinwoo Hong 84a5def248
Use managed Pi and OMP extensions (#5681)
Co-authored-by: Orca <help@stably.ai>
2026-06-17 23:28:54 -07:00
Brennan Benson ce273c8aef
Improve release validation reliability (#5643)
Co-authored-by: Orca <help@stably.ai>
2026-06-17 20:05:55 -07:00
Jinjing bd546b47d2
Redesign mobile driver overlay layout and clarify action copy (#5647)
Clarify the mobile-driving experience by updating outdated terminology and
making actions more precise. Generic "Mobile" references are replaced with
"Phone", and action buttons now explicitly distinguish between "this"
terminal and "all" terminals. Also introduces a modern card layout featuring
a smartphone icon badge and a live status indicator, complete with updated
locales, tests, and a standalone HTML preview.
2026-06-17 19:21:42 -07:00