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.
* 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>
* 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>
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>
* 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>
* 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>
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.
* 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
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
* 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>
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
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.
* 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.
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.
* 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.