Skip to content

fix(nsh): restore rust-preview CI, isolate macOS clipboard, and scope editor focus - #6705

Merged
M4n5ter merged 13 commits into
rust-previewfrom
fix/macos-box-none-editor-focus
Nov 9, 2026
Merged

M4n5ter merged 13 commits into
rust-previewfrom
fix/macos-box-none-editor-focus

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes all rust-preview CI failures — including the Linux and macOS nsh compile breakages and behavioral regressions introduced in #6708 (cb2cc8958), the native-macos desktop_new_session focus-transition / clipboard / ctrl_for_command / IME composition-commit failures, the native-windows rail same-batch click tooltip preview failure, and GitHub Releases 504 / parallel v8 build-script truncation races:

  • Restore Linux and macOS nsh compilation and TUI same-frame error diagnostics after chore(nsh): synchronize third-party/nsh to upstream 323a8663 #6708 (cb2cc8958):
    • Expose pub(crate) attributes: WindowAttributes on AppWindow in nsh-platform-linux for scroll::key_pressed Escape window-close checks (root-build, packaging, linux-nsh).
    • Restore chrome::track_menu for text::context_menu, update terminal.rs input::native_at(&surface.root, ...), and gate terminal-only view bounds imports/helpers under #[cfg(feature = "terminal")] in nsh-platform-macos (native-macos).
    • Report Message::Error inline during AppView::draw_scene inbox draining in nsh-platform-tui so diagnostics.draw and test inspection requests observe runtime errors on the exact frame that drains them (errors_are_dismissible_and_logs_open_only_on_request).
  • Emit MountItem::ViewStyle { hidden } across LayoutTree::displays_none transitions (nsh-core):
    • Mark dirty::VIEW in mount_state, set_style, sync_layout_style, sync_grid_role, unfix_view, and cell_changed whenever LayoutTree::displays_none is active on mount or flips after mount so native platforms hide display: "none" subtrees, exclude pressables, and revoke responder focus (hidden_and_clipped_subtrees_exclude_pressables_and_revoke_focus).
  • Suppress keyboard-focus hints on pointer-pressed anchors across both held and same-batch clicks (nsh-core):
    • Track active touches and per-commit pressed touch-start nodes in Overlays (cleared at the end of Core::commit()), walking the live focus chain (focus_hint_target) during both TouchPhase::Start (hint_touches) and commit_round (focus_hints) so focus landing on an anchor from or during a pointer press — even when TouchPhase::Start and TouchPhase::End arrive in the same event batch before commit() — sets focus_on = true without opening focus_shown (every_visible_turn_mark_can_be_clicked_with_cell_coordinates), while leaving subsequent genuine keyboard Tab focus unaffected.
  • Fall back from Ctrl to Cmd in nsh-platform-macos keymap matching when ctrl_for_command is enabled:
    • Match explicit Ctrl bindings first via match_table, and when KeyMatch::None is returned with ctrl_for_command && ctrl && !cmd, retry with Ctrl -> Cmd so mod+... shortcuts (such as mod+u in Composer / TRANSITION_APP) fire even when RichEditor registers Emacs ctrl+a / ctrl+e / ctrl+k bindings in the same keymap.
  • Hold native focus fence across unsettled Blur events and scope hidden-sink When::Always keybindings (ElementRef::on_key_with):
    • Arm the focus fence in nsh-platform-macos, nsh-platform-linux, and nsh-platform-windows whenever wants_text holds and events_handled() < events_sent(), and only disarm via maybe_disarm once behind(surface) clears.
    • Propagate Environment::native_focus_scopes into nsh_core::element::Environment, add ElementRef::on_key / ElementRef::on_key_with backed by RefTarget node tracking in ViewKey, and scope RichEditor, Editor (including completion), and Terminal When::Always shortcuts to their attached hidden <Input> sink on focus-scope hosts while keeping within: None on headless hosts.
  • Bind open Listbox navigation, selection, and typeahead keys with When::Always when non-searchable (nsh-base):
    • Desktop and headless hosts intentionally leave responder focus in an editing text input when the user clicks a <Select> trigger (a_press_outside_closes_it_and_leaves_the_focus). Bind up, down, pageup, pagedown, and enter with When::Always whenever a Listbox is open, bind home, end, and space with When::Always when !searchable (leaving home / end as When::NotEditing when searchable so the search field retains caret movement), and bind bind_typeahead with When::Always while active so open <Select> dropdowns own keyboard navigation and selection instead of leaking Enter / arrows into a focused Composer editor (desktop_remembers_folders_without_restoring_unsent_drafts).
  • Isolate per-Surface TerminalClipboard, handle native Input shortcuts and preedit-matching IME commits on macOS TerminalSurface, gate focus_generation read-only transitions on focused inputs, and normalize directory file: URI trailing separators (maka-workbench):
    • Replace NSPasteboard::generalPasteboard().changeCount() polling and duplicate clipboard slots with per-Surface TerminalClipboard { text, pending } (matching nsh-platform-windows), and execute Ctrl/Cmd+{A,C,X,V,Z,Shift+Z,Y} directly on the focused NSTextView (FieldEditor or TextArea) with undo enabled.
    • Restore the pre-composition unmarked buffer via terminal_cancel_input(&input) before insertText: in nsh-platform-macos's terminal_compose (and arm the focus fence when !active sends commit/composition events, matching nsh-platform-windows) so committing a string identical to the active preedit ("方向" -> "方向") fires textDidChange: (EventKind::ChangeText) and EventKind::CompositionChange { composing: false } instead of leaving RichEditor wedged in composing = true (desktop_steering_freezes_each_message_and_queue_is_one_shot).
    • Gate focus_generation (nsh-platform-macos) and terminal_focus_generation (nsh-platform-windows) increments on became_readonly / became_editable with input.focused.get() so mounting or toggling readonly on an unfocused background <Input> does not revoke and re-admit the currently focused editor's TextInputTarget (desktop_side_pane_keeps_its_draft_separate_when_closed_and_reopened).
    • Mark the outside click target in native_editor_focus_and_text_do_not_wait_for_another_pixel_frame (maka-terminal-shell) selectable and match "⌃K" on macOS / "Ctrl+K" elsewhere under ctrl_for_command = true.
    • Normalize local paths at the attachment_paths::normalize boundary (components().collect()) and ignore trailing separators in uploads::display_name so macOS AppKit/Finder directory file: URIs (file:///.../dir/) insert clean directory paths without trailing slashes (desktop_file_gestures_preserve_drafts_and_stage_an_image).
  • Install CI Rust tools and stage prebuilt rusty_v8 archives via authenticated GitHub REST API (api.github.com):
    • Fetch cargo-nextest, cargo-deny, and denoland/rusty_v8 release assets via authenticated api.github.com (Accept: application/octet-stream) with sha256 verification and retry backoff, pre-decompress librusty_v8.a / rusty_v8.lib + .sum alongside ~/.cargo/.rusty_v8, and write target/CACHEDIR.TAG using workspace-relative target.

Refs #6698, #6706, #6708, #6709

Verification

  • cargo test --manifest-path third-party/nsh/Cargo.toml -p nsh-core --lib -q — 1263 passed, 0 failed (including element_ref_on_key_with_scopes_within_attached_node_on_focus_scope_hosts, displays_none_emits_hidden_view_style_on_mount_and_toggle, and pointer_press_on_focused_anchor_suppresses_focus_hint_until_refocused)
  • cargo test --manifest-path third-party/nsh/Cargo.toml -p nsh-base --test base select -q && cargo test --manifest-path third-party/nsh/Cargo.toml -p nsh-base --test base combobox -q — 114 passed, 0 failed (including open_list_keys_and_typeahead_work_while_a_text_field_keeps_focus)
  • cargo nextest run -p maka-workbench — 28 passed, 0 failed (including pasted_directories_preserve_path_order_and_leave_file_lists_for_upload and display_name_ignores_trailing_directory_separators)
  • cargo check -p maka-workbench -p maka-terminal-shell --tests — passed
  • node scripts/ci.mjs check format & cargo fmt --manifest-path third-party/nsh/Cargo.toml --all -- --check — passed
  • node scripts/ci.mjs check tooling-tests — 265/265 passed
  • node scripts/ci.mjs check licenses — passed
  • CI matrix verified across root-build, root-tests (22/22), packaging, linux-nsh, native-windows (100%), nsh, termina, product, bridge, tooling, and native-macos (macos-surface 9/9 + desktop 19/22 before the final terminal_compose preedit-commit fix).

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Antigravity diagnosed the #6708 Linux/macOS compile errors, TUI same-frame error diagnostics deferral, missing displays_none dirty::VIEW marking, same-batch pointer-focused hint opening (Overlays.pressed), ctrl_for_command Ctrl -> Cmd fallback in nsh-platform-macos, headless macOS TerminalSurface clipboard isolation, unsettled Blur focus-fence disarming + unscoped hidden-sink When::Always shortcuts + open non-searchable Listbox When::Always keybindings + unfocused <Input> focus_generation bumps + macOS terminal_compose preedit-matching IME commit wedging + macOS directory file: URI trailing-separator normalization (desktop_new_session), and GitHub Releases 504 / parallel v8 archive truncation in CI setup; implemented the fixes and regression tests; and verified local and CI suites.

Checklist

  • Tests cover the change and fail without it
  • Format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@Astro-Han Astro-Han 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.

I reviewed all six changed files at 3c93b4b17c17fdccc6b62761346f3d41424663d3, the RichEditor input sink and the corresponding keyboard, responder, pointer-picking and Tab paths.

No confirmed P0–P2 finding in this source review. The patch separates keyboard focus (can_focus) from pointer/accessibility targeting (can_reach), permits the box-none sink to retain keyboard focus, and prevents its hosted native subview from intercepting pointer hits. It also filters disabled/nonfocusable/implicitly read-only inputs during Tab traversal and routes modified paste to the native plain-text action. I checked 20 controlled ancestry/state cases against the actual extracted methods; those use simulated native-object responses and are not AppKit acceptance.

Current macOS job 128656562911 passes 86 platform tests and all five surface tests. The expanded hidden/clipped-subtree case (0.513s) includes pointer pass-through to the covered control, programmatic sink focus, focus retention across a layout update, paste, forward/backward Tab and stale composition-target revocation. This is broader coverage than the already-merged #6706's narrow input-focus fix; the two patches should not be treated as wholly equivalent.

The macOS desktop suite gets past the formerly failing first input and passes three cases, then fails the fourth case after 65.856s: the expected selected.png draft does not appear in the editor (observed: Null, desktop_new_session.rs:265). Eighteen cases remain unrun due to fail-fast. Separately, Linux CLI shard job 128658882365 fails model_and_source_search_preserves_focus_and_keyboard_selection (67.777s, keyboard.rs:315); I have not established causality for that unchanged TUI path. The overall run 42456459549 is failure, not a full desktop pass. Native Shift-modified paste is source-checked here, not independently exercised locally.

Integration: an actual merge into current rust-preview 74765152 exits 1 with a content conflict in nsh-platform-macos/src/view.rs, where #6706 changed the same reachability logic. Resolve that overlap while retaining the additional behavior and tests. I did not run AppKit or real IME locally. No schema or wire changes.


Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

@M4n5ter M4n5ter changed the title fix(nsh): allow keyboard focus on macOS pointerEvents box-none sinks fix(nsh): isolate macOS terminal clipboard and box-none focus reachability Nov 8, 2026
@M4n5ter
M4n5ter force-pushed the fix/macos-box-none-editor-focus branch from 3c93b4b to 06548f7 Compare November 8, 2026 09:01

@Astro-Han Astro-Han 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.

I reviewed all 11 changed files at 06548f7a8d991f003856e15671788717a4810ecb, including the rebased focus changes, the new per-surface clipboard and native-editor shortcuts, their terminal-output consumer, and the model-search test synchronization. The earlier 3c93b4b1 review applies to the previous revision; this revision merges without conflicts into current rust-preview 74765152.

No confirmed P0–P2 finding in this source review. Surface::terminal_clipboard now separates the locally readable text from a pending write consumed once by the terminal output path. system.rs::write_clipboard, text.rs::copy and the terminal native-editor copy/cut path use that shared surface state; setting incoming clipboard text does not echo a write or modify the global pasteboard. The ordinary nonterminal clipboard path still uses AppKit's general pasteboard. The direct shortcut handling checks secure-copy and editability policy, bounds the selected UTF-16 range, and delegates replacement/paste and undo to the existing editor paths. I also read the new controlled two-surface native test, including single-line/multiline paste, cut/undo/redo and masked-input copy suppression.

I compiled and ran the actual extracted clipboard write/read/set/take methods with controlled OS-pasteboard and event adapters. Per-surface isolation, one-shot/latest pending writes, incoming-text no-echo behavior, empty and Unicode text, has-only reads, the ordinary OS branch and the unset-local fallback pass. The actual focus predicate bodies are unchanged from the previous revision and pass the same 20 controlled ancestry/state cases. These checks do not execute AppKit, native shortcuts, undo, IME or real clipboard ownership.

keyboard.rs now waits for the narrowed 1 model search result before choosing the previously visible model row. That directly addresses the stale-row window in the old test; the author's eight stress repetitions remain author-reported. I did not rerun the real Host/TUI test locally.

Current CI does not establish the native acceptance claimed in the PR description. Run 42465390034 is failure: macOS job 128686791569 stops during setup because downloading cargo-binstall returns HTTP 504 (exit 56), before platform or desktop tests run. The root-build, packaging and Windows jobs fail while downloading the v8 150.4.0 prebuilt archive, also with HTTP 504. The Cargo manifests/lockfile and CI setup action are unchanged from 74765152; these logs do not establish a PR-caused code failure. They also provide no current-head native or desktop pass. No rerun was triggered.

For the separate current-base result, 74765152 run 42460736390 is now failure: macOS passes 86 platform tests and six surface tests, then three desktop cases; the fourth fails after 67.967s because the expected selected.png draft is absent (desktop_new_session.rs:265), leaving 18 cases unrun. This is baseline evidence, not a result for the new clipboard implementation. The previous head's surface passes and the author's stated native/22-desktop acceptance cannot substitute for current-head execution. No schema or wire changes.


Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

@M4n5ter
M4n5ter force-pushed the fix/macos-box-none-editor-focus branch from ed8e794 to 465e1da Compare November 8, 2026 10:57

@Astro-Han Astro-Han 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.

I reviewed the update to 465e1da7c8f6c11b896ce62d5972a77a34f6c42b. The new commit changes three CI files: .github/actions/ci-setup/action.yml, scripts/ci/setup.mjs and scripts/ci.test.mjs. All 11 runtime/test files covered in my previous revision review retain identical Git blobs. An actual merge into current rust-preview 74765152 still succeeds without conflicts.

No confirmed new P0–P2 finding in this update. Rust-tool installation now uses GitHub release metadata and the API asset endpoint instead of cargo-binstall's web-download path. The downloader retries transient HTTP failures, rejects mismatched SHA-256 values when the release metadata supplies a digest, and installs through a temporary file. The new V8 setup selects the locked crate version and host target, fills the compressed Cargo cache, and stages the debug-profile static library plus its URL marker before compilation. The action also stages it for packaging workers whose compiler-cache option is disabled.

I inspected the corresponding upstream V8 150.4.0 build script: its compressed-cache branch copies the archive and returns before the normal download branch writes the .sum URL marker. That supports the marker-handling premise. I did not independently reproduce the author's concurrent Rust-link truncation, and the staging helper's explicit target/debug path is not evidence for arbitrary Cargo profiles or cross-target builds.

Executed checks: I ran the new unmodified loopback-HTTP test under Node 24.18.1 (1 passed, 0 failed). It exercises an authenticated API request, a transient 504 retry, corrupted-digest rejection before installation, cold V8 cache/library/marker creation, repeated setup without another request, and recovery of a missing gn_out from the compressed cache. These use fixture archives, not real native binaries. The current hosted tooling job 128709991162 separately reports 265 passed, 0 failed, 1 skipped. Root-build 128709991182 and packaging 128709991218 both succeed; their raw logs show the new V8 staging step, and root-build also records successful nextest installation.

The previously failing real Host/TUI model-search case now passes in 11.684s in current-head CLI shard job 128713108782 (19 passed, 93 skipped). This is current execution evidence; the earlier old-head keyboard failure should not remain a current failure claim.

Acceptance boundary: run 42473582157 was still running when inspected, with native-macos and native-windows unfinished. I have no current-head native clipboard/undo/IME or complete desktop-suite result yet, and did not run AppKit locally. The previous 06548f7a download-504 result and 74765152's fourth desktop draft failure remain historical/baseline evidence, not this head's terminal result. The PR description's full-matrix claim therefore remains unconfirmed at inspection. No schema or wire changes.


Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

@M4n5ter
M4n5ter force-pushed the fix/macos-box-none-editor-focus branch 2 times, most recently from e7a17f7 to 0b8c5fe Compare November 8, 2026 12:40

@Astro-Han Astro-Han 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.

I reviewed the update to 0b8c5fead417971c34df9d145de292c6872c0011: four files change relative to the previously reviewed 465e1da7. The other ten changed-file blobs are identical. An actual merge into current rust-preview 74765152 succeeds without conflicts.

No confirmed new P0–P2 finding in this update. The previous revision introduced a real CI cleanup failure: both native jobs rejected the precreated Cargo target directory because it lacked CACHEDIR.TAG. setup.mjs now writes Cargo's standard signature before staging V8, also repairs a missing tag on the already-staged and prune paths, and uses the same fixed target directory as its prune command. I ran the actual old and new setup scripts against temporary, otherwise equivalent Cargo fixtures: old setup → cargo clean exit 101 / missing tag; new setup → exit 0. This uses actual Cargo cleanup with a fixture compressed library, not a native build. The updated unmodified loopback API/tag test also passes locally under Node 24.18.1 (1 passed, 0 failed).

The native test's submit handler now reads {text}, matching the actual Input event declaration in nsh-core/src/js/mod.rs, rather than the nonexistent {value} field. Extracting the two actual handlers and invoking the documented payload produces submitted:undefined before and the expected submitted string after. This controlled check does not locate the precise wait that failed in the previous AppKit run. The three geometry helpers newly gated by feature = "terminal" are used by that same feature's terminal paths; their computation is unchanged.

Current macOS job 128734083421 passes 86 platform tests and all seven surface tests, including native_input_shortcuts_copy_cut_paste_and_undo_without_global_pasteboard (0.356s). The previous revision's new clipboard test failed; that is no longer the current surface result. Current macOS cache pruning also succeeds, recording removal of 2,623 files, rather than the former missing-tag error. Current tooling reports 265 passed, 0 failed, 1 skipped, and the real Host/TUI model-search case passes again in 11.644s in CLI job 128737067968 (19 passed, 93 skipped).

The complete desktop fix is still unconfirmed. This head's macOS desktop suite passes its first three cases, then fails desktop_creates_only_on_first_submission_and_preserves_the_confirmed_snapshot after 66.104s: the expected selected.png draft is absent (desktop_new_session.rs:265, observed: Null). Eighteen cases remain unrun due to fail-fast. The current base has the same failing draft wait; I have not established this update as its cause. Surface coverage does not establish complete desktop acceptance.

Run 42481390738 has now completed with failure, with macOS as its only failing platform job. Current-head Windows job 128734083388 is success: its raw log records 22/22 desktop tests passed (327.281s), including the image-draft case (14.199s), and successful cache pruning. Windows acceptance and the Cargo-tag repair are therefore confirmed for this head; the macOS desktop failure above still prevents complete cross-platform acceptance. I did not run AppKit, a real macOS clipboard or IME locally. No schema or wire changes.


Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

@M4n5ter M4n5ter changed the title fix(nsh): isolate macOS terminal clipboard and box-none focus reachability fix(nsh): restore rust-preview CI, isolate macOS clipboard, and scope editor focus Nov 8, 2026
@M4n5ter
M4n5ter force-pushed the fix/macos-box-none-editor-focus branch from 0b8c5fe to e1d4caf Compare November 8, 2026 17:09

@Astro-Han Astro-Han 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.

I reviewed the 26-file change at e1d4caf15d0c8d464b9aca89a018d2e7d0aeae73 (+1,195/−165) against current rust-preview cb2cc895896220d8dffea66d16b31329defbbf76, separating the upstream NSH synchronization from this PR with a range comparison. An actual merge into that base succeeds. I found no confirmed new P0–P2 issue in the reviewed code; complete native acceptance remains unconfirmed.

The compile-repair premise is real. The current base's CI fails Linux builds because AppWindow.attributes is private, and macOS compilation because chrome::track_menu is missing and native_at receives Surface instead of NshView. This revision exposes the field within the crate, restores the shared menu helper, and passes surface.root to the hit test. Current-head root-build, packaging and Linux NSH succeed; macOS also compiles and passes its 106 platform tests.

I traced the new ElementRef shortcut scope through registration, attachment/detachment notifications, keymap projection and the engine environment, including the editor/completion/rich-editor/terminal callers (nsh-core/src/element/ambient.rs, element_ref.rs, keys.rs and core/components.rs). The native-host path omits unmounted targets and supplies within for mounted ones; the headless path retains its existing behavior. I ran the actual new core regression locally in an isolated workspace with unchanged source and the repository's dependency versions: passed. Restoring only the former unscoped keymap projection makes that same regression fail because an unmounted target emits a binding; restoring the current projection passes again. This is a core test, not an AppKit or Windows test. Current hosted NSH checks also record 4,602 passed, including this regression, and Linux NSH records 131 passed.

The focus-fence changes now retain protection while events are unhandled, rather than releasing it solely because the current focus notification emitted no new event. I also checked the per-surface clipboard, read-only/secure handling, undo setup and the new RichEditor-to-attachment-input fixture. The latter checks the responder transition without an extra input fence, but its macOS execution has not yet succeeded in this run.

Current CI is not all green. Run 42503519616 has completed with failure. The macOS job passes its first three terminal-native cases, then hidden_and_clipped_subtrees_exclude_pressables_and_revoke_focus fails to settle after 6.248s, leaving four cases unrun, including the new clipboard and transition regressions; its desktop suite is not reached. The Windows job passes 22/22 desktop cases in 201.348s, then its native-pixels test fails while hiding the hover preview at scale 2 (rail.rs:259, 5.792s), leaving the second pixel test unrun. The same base's Windows job passes both pixel tests, so this needs investigation; one base/head result does not establish the cause. The base's macOS build fails before tests, so it supplies no direct runtime control for the macOS failure. I did not rerun CI or locally exercise AppKit, Windows, IME, or a real clipboard. No Maka runtime schema or protocol epoch changes are introduced.


Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

…ocused hints

Mark dirty::VIEW when LayoutTree::displays_none is set on mount or changes across style, role, fixed-view, or terminal grid transitions so native platforms hide display:none subtrees and revoke responder focus. Track active touch paths in Overlays, suppress keyboard-focus hints when focus lands on a pressed anchor, and remove premature mouse-down focus_view on non-Input controls in nsh-platform-windows.

Generated-by: Antigravity

@Astro-Han Astro-Han 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.

I reviewed the five-file increment from e1d4caf15d0c8d464b9aca89a018d2e7d0aeae73 to f2968436669a2581c58ae008d2953f2ddda0971d, together with the preceding review of the full change. The current topic is 29 files (+1,449/−192) against rust-preview cb2cc895896220d8dffea66d16b31329defbbf76; an actual merge succeeds. I found no confirmed additional P0–P2 issue in this increment. Native acceptance remains incomplete, and current CI has completed with failure.

The hidden-view repair now propagates changes in the layout tree's display:none state into dirty::VIEW when mounting or changing styles, grid role, fixed overlays or terminal grid mode (nsh-core/src/core/mod.rs, core/overlay.rs). This makes the native view-style update carry the hidden state instead of relying on an unrelated view-style change. The overlay code also tracks active touch paths and finds the current focus anchor from the live tree, suppressing a keyboard-focus hint when that anchor is being pressed while retaining genuine keyboard-focus hints.

I ran both new regressions against the actual current nsh-core: hidden-style mount/toggle and the three pointer/focus orderings pass. With the same current tests, restoring the preceding core/mod.rs and core/overlay.rs makes both fail: the hidden mount emits no hidden style, and pointer focus opens a tooltip. Restoring the current production files passes both again. These checks use an isolated workspace and unchanged source; they test the core mount/event protocol, not native AppKit or Windows input.

I also checked the macOS terminal-only geometry annotations and the Windows removal of eager mouse-down focus from generic controls. Native input/hosted-item dispatch and keyboard Tab focus remain separate paths; whether the changed generic-control focus behavior is satisfactory needs Windows interaction coverage. I did not locally execute Windows, AppKit, a real clipboard, or IME.

Current run 42512378063 has passed root-build, packaging, tooling, product, NSH, Linux NSH and all 22 root-test partitions. The macOS job passes 106 platform tests and 7/8 terminal-native cases, including the formerly failing hidden/clipped case (0.717s) and clipboard copy/cut/paste/undo (0.787s). Its final new rich_editor_to_box_none_input_focus_transition_copies_and_submits case still fails to settle after 5.420s, so its desktop suite is not reached. The preceding revision failed earlier, and the current base does not compile on macOS; neither supplies a successful direct control for this final case. I have not established its runtime cause or relabeled it as a proven new regression. The Windows job has now completed with failure: its sixth desktop case, desktop_goal_commands_create_pause_resume_and_finish_without_losing_the_draft, cannot find the Pause Goal control after 73.456s (desktop_new_session.rs:230, observed Null). It records 5 passed, 1 failed, 16 unrun in 136.118s; native-pixels is not reached. That case passed on the current base and preceding head, but one failing run does not establish the cause. Both platforms and the aggregate run have therefore failed. The preceding head's 22 passing desktop cases and scale-2 preview failure remain historical results. No runtime schema or protocol epoch changes are introduced.


Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

@Astro-Han Astro-Han 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.

I reviewed the seven-file increment from f2968436669a2581c58ae008d2953f2ddda0971d to 6e88168dcdd6c3bc323b4a5cb14d194273852b9e, together with my preceding reviews of the full change. The current topic is 29 files (+1,567/−198) against rust-preview cb2cc895896220d8dffea66d16b31329defbbf76; an actual merge succeeds. I found no confirmed additional P0–P2 issue in this increment. Current Windows acceptance passes, while macOS acceptance and aggregate CI still fail.

The focus-hint repair now retains the nodes pressed since the last core commit, even if a touch ends before deferred focus processing (nsh-core/src/core/overlay.rs). Clearing that set at the end of Core::commit prevents a previous click from suppressing later keyboard focus. I ran the strengthened actual-core regression: both same-batch focus/press/release orders, a press held across commits, and subsequent genuine keyboard focus pass. Keeping that test but restoring the preceding two production files makes it fail; restoring current production files passes again.

The macOS keymap now tries the original keystroke first and retries Ctrl as Cmd only when no binding matched, terminal ctrl_for_command is enabled, and Cmd was not already pressed (nsh-platform-macos/src/keymap.rs). I tested the extracted, verbatim match_table function with the actual current nsh-core, including the author's test and additional scope, fallback-phase, repeat, notification and Alt/Shift checks. Both tests pass; removing only the remapping makes both fail, and restoring it passes again. Explicit Ctrl bindings retain priority. This is a Linux-hosted function check, not an AppKit event-loop test.

I also checked the revised RichEditor fixture, terminal-only geometry imports, and restored Windows mouse-down focus behavior. The Windows input file now matches the current base. The macOS fixture explicitly registers and captures Mod-u through a RichEditor plugin while retaining the global binding; this changed fixture still fails in the native run below. I did not locally execute AppKit, Windows, a real clipboard, IME, or manual native interactions.

Current CI 42524607706 has completed with failure. The Windows job passes all 22 desktop tests (195.689s) and both native-pixel tests (0.913s). The preceding revision's missing Pause Goal control is therefore not a current failure; these results alone do not establish which change caused that recovery. The macOS job passes 107 platform tests and 7/8 terminal-native cases, including the new keymap test. Its final rich_editor_to_box_none_input_focus_transition_copies_and_submits case still fails to settle after 5.615s; desktop tests are not reached.

The NSH job records 4,603 passed, 1 failed and 29 skipped. Its TUI case dev::errors_are_dismissible_and_logs_open_only_on_request expects runtime failure but observes blank output. I have not established the runtime cause or PR attribution of either remaining failure. All 22 root-test partitions, root-build, packaging, tooling, product and Linux NSH pass. No runtime schema or protocol epoch changes are introduced.


Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

… RichEditor key capture

Generated-by: Antigravity
Desktop and headless hosts keep responder focus in an editing text input when the user clicks a Select trigger. Bind open Listbox navigation, selection, and typeahead keys with When::Always when non-searchable (keeping Home and End as When::NotEditing only when searchable so the search field retains caret movement) so open Select popups own keyboard navigation instead of leaking Enter or arrows into a focused editor.

Generated-by: Antigravity

@Astro-Han Astro-Han 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.

I reviewed the seven-file increment from 6e88168dcdd6c3bc323b4a5cb14d194273852b9e to 2b82ca9f09a61e1a01d391e410c696e33cded1a4, together with my preceding reviews of this topic. The current change is 35 files (+1,824/−269) against rust-preview cb2cc895896220d8dffea66d16b31329defbbf76; an actual merge succeeds. I found no confirmed additional P0–P2 issue in this increment.

The open Listbox now owns navigation, selection and non-searchable typeahead even when another text input retains editing focus (nsh-base/src/listbox.rs). Searchable lists keep Home/End available to the editing field, and Select/Combobox activate typeahead only in their applicable states. I ran the new actual-engine headless regression: selecting by Home/Down/Enter and typeahead/Space preserves the draft without submitting it, and Enter submits normally after the popup closes and the draft is refocused. Keeping this test but restoring the preceding Listbox implementation submits the draft and leaves the popup open, so the test fails; restoring current production code passes all 52 Select/Combobox tests. This is headless coverage, not native responder or IME acceptance.

The TUI now reports each drained Message::Error before drawing diagnostics and serving frame-inspection requests (nsh-platform-tui/src/app.rs), while preserving the first error returned by pump. I ran the actual AppView/JS-runtime same-frame regression: current code passes, the preceding production file with the new test fails, and restoring current code passes both that test and the existing dismissible-error/log-opening test. The macOS transition fixture separately moves its capturing Mod-u plugin into a priority-200 extension, ahead of the editor's default keymap; this is a fixture change.

Directory gestures now collect normalized path components, while upload display names ignore trailing URI, drive and UNC separators and retain a fallback for roots (workbench/src/attachment_paths.rs, bindings/uploads.rs). I tested the extracted production functions with the two author regressions and additional real-file, Unicode, query/fragment, relative-path and non-Unicode-directory boundaries: 3 tests pass. Restoring the preceding production functions fails both author regressions; restoring current functions passes all three. These checks preserve actual selected file bytes but do not execute Finder, Windows, WSL translation, or a real clipboard. I did not locally run AppKit or Windows.

Current CI 42537764386 has completed with failure; macOS is the only failed suite, apart from the aggregate test job. Its NSH job passes 4,606 tests with 29 skipped, including both the existing dismissible-error test (0.083s) and new same-frame test (0.024s). All 22 root-test partitions, root-build, tooling, product, packaging and Linux NSH pass. The macOS job passes 107 platform tests and all eight terminal-native tests, including the formerly failing editor transition (0.670s). The desktop remembered-folder case also passes (22.401s). It then fails its 19th desktop case, desktop_side_pane_keeps_its_draft_separate_when_closed_and_reopened: the shared draft assertion expects SIDE_DRAFT but observes Null after 67.740s (desktop_new_session.rs:265). The desktop suite records 18 passed, 1 failed and 3 unrun in 254.514s. That test file is unchanged from the current base and intervening heads; I have not established the runtime cause or PR attribution. The Windows job passes all 22 desktop tests (334.626s) and both native-pixel tests (1.512s). Its side-pane draft case passes in 13.649s, which does not establish the cause of the macOS failure. Earlier revisions' native successes and failures are historical results.

No runtime schema or protocol epoch changes are introduced.


Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

Only advance focus_generation / terminal_focus_generation when the focused Input transitions between editable and read-only, preventing unfocused background inputs (such as a newly mounted Side pane composer) from revoking and re-admitting the focused editor's TextInputTarget. Also mark the outside click target in terminal-shell's native pixel focus test selectable and match macOS's ⌃K label under ctrl_for_command.

Generated-by: Antigravity
Compare borrowed TextInputTarget references in unfocused_readonly_input_preserves_focused_target instead of moving the non-Copy target handle across assertions.

Generated-by: Antigravity

@Astro-Han Astro-Han 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.

I reviewed the five-file increment from 2b82ca9f09a61e1a01d391e410c696e33cded1a4 to fb39ad7e6b5b91b649b654443294f6f465c500d6, including the intervening 707facf4 change and this revision's test correction. The full change is 36 files (+2,017/−295) against rust-preview cb2cc895896220d8dffea66d16b31329defbbf76; an actual merge succeeds. I found no confirmed remaining new P0–P2 issue in this increment.

The production change gates macOS focus_generation and Windows terminal_focus_generation increments on the changed input being focused. I checked both configuration paths, focused-readonly composition cancellation, actual focus-change invalidation, terminal target admission, and queued composition generation checks. Configuring an unfocused background input should therefore leave the active editor's target intact, while actual focus changes and focused editable/read-only transitions still revoke it. This is a source-level assessment, not native behavioral acceptance.

The added macOS regression mounts a read-only background input during active preedit, makes it editable without moving focus, then focuses it and pastes its own draft. The Windows regression checks both background and focused transitions. In 707facf4, the macOS test consumed the non-Copy TextInputTarget at two assertions and inside an FnMut; its macOS job failed to compile with two E0382 errors and one E0507. Current code borrows the target at all three comparisons. Using the actual unchanged target type and the test's original expressions with native methods represented only by signatures, I reproduced those three errors on the preceding version and successfully typechecked the current expressions. The empty-preedit cancellation now passes None, which the current composition entry point maps to the same empty 0..0 selection. These checks establish the ownership correction, not successful execution of the macOS or Windows tests.

The pixel-test adjustments make the outside click target selectable, matching the native selection path that leaves the editor, and expect the macOS ⌃K label under ctrl_for_command; I checked both native selection paths and the actual key-label formatter. These are fixture adjustments.

Current CI 42549084550 is not all green. I inspected the raw log of macOS job 128940661449: 107 platform tests and all 9 native terminal tests pass, including the new unfocused-input regression. The side-pane draft test also passes on this commit. The later desktop_steering_freezes_each_message_and_queue_is_one_shot case fails after 79.034 seconds because the expected draft Check keyboard focus too. is observed as Null: 19 desktop cases pass, one fails and two are not run. This is a different current failure from the preceding revision's side-pane failure; its cause and attribution to this PR are not established. Windows is still running, and the pixel stage was not reached on macOS. I did not locally run AppKit, Windows, real clipboard/IME interactions, or a populated desktop-session restore. Older Windows 22-desktop/2-pixel counts are historical and do not validate the current commit.

No runtime schema or protocol epoch change is introduced by this increment.


Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

@M4n5ter
M4n5ter merged commit 8c1b8fc into rust-preview Nov 9, 2026
@M4n5ter
M4n5ter deleted the fix/macos-box-none-editor-focus branch November 9, 2026 02:58
me2seeks added a commit that referenced this pull request Nov 9, 2026
Merge upstream/rust-preview through 1cba85e, including #6705 native clipboard and focus fixes. Prefer the upstream native compile repairs and remove the superseded local query/menu variants, while retaining Linux desktop routing, nextest installation and its behavioral coverage.

Generated-by: Maka

@Astro-Han Astro-Han 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.

Post-merge CI follow-up for final commit 3b6336a6c7e65e433fafb9f145fd4138500f0e88 and its merge 8c1b8fc16d647dce0960137840c72f8253c63d7d: I found a confirmed P2 test/CI failure in the new composition regression, not an established production root cause.

rich_editor_composition_commit_matches_preedit_and_keeps_shortcuts fails at third-party/nsh/crates/nsh-platform-macos/tests/terminal/cases.rs:1335. After starting preedit and dispatching Enter/Escape, the test submits the committed text using its previously captured target; apply_composition(&target, "方向", "", None, false) returns false, so execution stops before the copy and replacement-shortcut assertions. The actual admission path can reject a stale target, and the composition path can also return false without an editable target. The log does not identify which branch rejected this sequence; I have not established whether the fixture or production logic needs correction.

I independently inspected both raw hosted logs. The final-commit macOS job fails this case in 0.456 seconds; the merged-commit macOS job fails the same assertion in 0.803 seconds. Both pass all 107 platform tests, then record seven terminal-native passes, one failure and two unrun cases. These two commits have identical trees. The failing case is new in the final three-file increment, so the current CI failure is attributable to the added regression test. Neither run reaches the Desktop or pixel suites, and neither verifies that the earlier steering draft failure is fixed.

Please correct the input sequence or the underlying composition handling as appropriate, retain the behavior the regression is intended to check, and demonstrate the native case plus the Desktop steering case passing. Simply treating a returned false as success would leave that behavior untested. The final-commit Windows job has now completed successfully: 224 platform tests pass with one skipped, all 22 Desktop tests pass in 195.332 seconds (including steering in 9.553 seconds), and both pixel tests pass in 0.892 seconds. Those are results for this final commit; they do not resolve the macOS failure. I did not execute AppKit locally or initiate a retry. This report does not change the earlier source review's database/schema assessment.

Follow-up: #6710 has now been merged as 033e1a50bd53c38da89bdbda545fb30414cb9ebd. I reviewed its three changed files and checked the pending-composition query and replay isolation with controlled native-state stand-ins. The follow-up macOS log now verifies the previously failing composition regression passes (0.396 seconds), with all 107 platform library tests, 10 native terminal tests and 22 Desktop tests passing. The original composition-test P2 is therefore resolved by that follow-up on macOS. Its job later fails in an unchanged pixel fixture that binds the reserved Cmd+H shortcut; that separate failure does not repeat the composition assertion. The follow-up Windows job has also succeeded: its new unsettled-composition regression passes (0.094 seconds), with 225 platform tests passing and one skipped, all 22 Desktop tests passing and both pixel tests passing. The targeted composition fix now has native regression evidence on both platforms; the follow-up overall CI is red because of the separate macOS pixel fixture.


Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

me2seeks added a commit that referenced this pull request Nov 9, 2026
Retain Desktop's real Host client after closing a window while releasing its UI engine, rendering resources and window-scoped subscriptions. Recreate UI and restore presentation state from the Desktop-owned native tray or menu bar; reserve bounded detach and Desktop exit for explicit Quit.

Integrates rust-preview through 1cba85e, including #6705. CI completed with 33/35 jobs passing; the remaining native-macos IME assertion and dependent unified test failure also occur in the final CI of merged #6705. No checks were weakened or reported as green. The contributor authorized merging when remaining failures are unrelated to this PR.

Fixes #6668

Generated-by: Maka
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.

2 participants