Repository navigation
fix(nsh): preserve GTK4 focus barrier and enforce macOS subtree reachability - #6698
Conversation
…ix macOS escape test Keep GTK4 AppView widgets sensitive while Surface::step_input_barrier drains admitted focus transitions and queued input, while immediately refusing new physical pointer, keyboard, paste, and file-drop events via input_paused. This preserves GTK focus targets for autoFocus and focus restoration across pause_input/resume_input. Fix desktop_composing_escape in nsh-platform-macos to import host from "nsh" instead of the retired "nsh/host" subpath and declare the "log" host capability on its bundle policy. Generated-by: Antigravity
…ware pressable_bounds Generated-by: Antigravity
Astro-Han
left a comment
There was a problem hiding this comment.
I reviewed all 16 changed files at b4e0bf0685564a7d0c9629c53259544e07961a83, including the GTK input barrier, physical-input/paste/drop admission, macOS ancestor reachability and focus revocation, transformed pressable bounds, accessibility names, and both terminal test changes.
One P2 is confirmed: the new input::style_changed signature leaves the existing text caller uncompilable, as detailed inline. The current macOS job fails during compilation, before these macOS regressions can run.
The Linux change keeps GTK widgets sensitive while already admitted focus transitions and edits drain, then saves/blurs focus and disables sensitivity. New physical events are rejected through the paused flag while held input can still replay. I traced the keyboard capture, paste-generation and barrier completion/error paths. On the current head's CI merge with 57470e4c, linux-nsh job 128619576800 passes 87 tests, with 2 skipped, including the previously failing pending-focus/pause-input case (0.221s), complete composing-Escape case (0.198s), and scoped/fallback keybindings (0.240s). The CI checkout tree matches an actual merge of this head with the current target.
For macOS, the Escape fixture now imports host from nsh and declares the log capability. The added subtree test exercises hidden/pointer-blocked inputs, grouped labels, translated hit bounds, tab traversal and revocation of stale composition targets. These are source-level checks here: the current macOS compile failure prevents treating this head's AppKit tests as passed. The author's earlier-head results do not establish that the expanded current patch is accepted.
This head merges without conflicts into the current rust-preview target 57470e4c1542431d89e99dad4205270b8845f383. Overall CI is still running and the macOS job has already failed. I did not run a local GTK/AppKit suite, real IME interaction, or the complete desktop journey. The isolated local old/new signature check only corroborates the arity regression; the macOS hosted compiler log provides the platform build evidence. No database schema or wire-protocol changes are present in this diff.
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.
| pub(crate) fn style_changed(_view: &NshView) {} | ||
| /// The view's style changed (visibility, cursor). The cursor follows on the | ||
| /// next mouse move. | ||
| pub(crate) fn style_changed(surface: &Rc<Surface>, view: &NshView) { |
There was a problem hiding this comment.
[P2] Update the existing text caller when adding the surface parameter
text.rs:1181 still calls crate::input::style_changed(view) when selectable text changes. This signature now requires surface as its first argument; only the mount caller was updated. Current native-macos job 128619576760 fails with E0061 at that unchanged text caller while compiling nsh-platform-macos, so the macOS app cannot build and the new AppKit regressions do not run. The target branch's one-argument signature accepts the same caller. Update the text path as well, or preserve a separate one-argument cursor notification.
Generated-by: Antigravity
Astro-Han
left a comment
There was a problem hiding this comment.
I checked the final ce868d70a8509cdd0ad4afe267e67bb7c707cc7e change against the previously reviewed b4e0bf06: it removes the obsolete text-style notification and its now-unused was variable from text::set. I also checked the remaining input::style_changed caller.
The previous P2 is fixed. text.rs no longer calls the new two-argument function with one argument. The final PR's macOS job 128625091112 builds successfully, passes 86 platform tests and all five surface tests, including composing Escape (2.360s), hidden/clipped subtree reachability and focus revocation (0.445s), and the pending-focus barrier (0.468s). The merged commit's job 128629794240 also passes the 86-test and five-test suites. The final commit and merged 11c06b12 have identical Git trees; the hosted final PR checkout has that tree as well.
Both overall runs (42445951989 and 42447608116) still finish failure: the first complete desktop case, desktop_child_conversations_manage_nested_and_archived_workers, cannot obtain the editor for text input (observed: Null, desktop_new_session.rs:230), after 66.854s and 69.264s. This is a different failure from the resolved compiler error and the now-passing surface tests; I have not established its cause. Consequently, the complete desktop behavior remains unvalidated.
No new confirmed P0–P2 finding in this final five-line removal. This is the final fix verification following the earlier 16-file review, not a completed review or acceptance of the broader backend migration. I did not run AppKit or real IME interaction locally.
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.
#6698 made can_reach treat a view whose own pointerEvents is box-none as unreachable, and every text-input path (acceptsFirstResponder, focus_editor, auto_focus, focused_editor) now asks can_reach. RichEditor keeps its caret sink input box-none so presses fall through to the text it draws, so on macOS no RichEditor could take keyboard focus: Maka's composer stopped accepting typing. pointerEvents decides where presses go, not whether an input can hold the keyboard, so an input's own box-none no longer blocks it. A box-none ordinary view is still not a key stop or a press target, and ancestors' hidden, none and box-only keep revoking focus as #6698 intended. Generated-by: Claude Code
… editor focus (#6705) Restore `rust-preview` CI compilation and cross-platform native desktop/terminal behavior: - Expose `AppWindow.attributes` in `nsh-platform-linux`, restore `chrome::track_menu` and `input::native_at(&surface.root, ...)` in `nsh-platform-macos`, and report `Message::Error` inline during `AppView::draw_scene` in `nsh-platform-tui`. - Mark `dirty::VIEW` across `LayoutTree::displays_none` transitions and suppress same-batch pointer-press focus hints via `Overlays.pressed` in `nsh-core`. - Fall back from `Ctrl` to `Cmd` in `nsh-platform-macos` keymap matching when `ctrl_for_command` is enabled, hold the native focus fence across unsettled `Blur` events, scope hidden-sink `When::Always` shortcuts via `ElementRef::on_key_with`, and bind open non-searchable `Listbox` keys with `When::Always` in `nsh-base`. - Isolate per-`Surface` `TerminalClipboard` and handle native `NSTextView` shortcuts on macOS `TerminalSurface`, restore the unmarked buffer via `terminal_cancel_input` before `insertText:` in `terminal_compose` (and arm the focus fence when `!active`), gate `focus_generation` read-only transitions on focused inputs in `nsh-platform-macos` and `nsh-platform-windows`, align `pixels/tests.rs` on macOS, and strip trailing separators on directory `file:` URIs in `maka-workbench`. - Fetch `cargo-nextest`, `cargo-deny`, and `denoland/rusty_v8` release assets via authenticated `api.github.com` with `sha256` verification and workspace-relative `target/CACHEDIR.TAG`. Refs #6698, #6706, #6708, #6709 Generated-by: Antigravity
Summary
Fixes the broken CI checks on
rust-preview(linux-nshandnative-macos):linux-nsh(nsh-platform-linuxAppView::pause_input/Surface::step_input_barrier):self.outer.set_sensitive(false)synchronously at the start ofAppView::pause_inputcaused GTK4 to immediately clear keyboard focus across the entire subtree and rejectgrab_focus_without_selecting()on in-flightautoFocusinputs whilestep_input_barrierwas still draining admitted focus transitions and queued edits (Err("pending input has no editable focus target")inpending_focus_event_holds_keys_paste_and_pause_input_without_queued_text). It also leftpaused_focusempty beforestep_input_barriersaved it, preventingresume_input()from restoring focus.outersensitive whilestep_input_barrierdrains admitted focus transitions, queued edits, and pastes, while immediately refusing new physical pointer/touch/scroll (input::handle), keyboard/shortcut, clipboard-paste (unless replaying held input), and drag-and-drop (file_drop) events viasurface.input_paused. Disableoutersensitivity oncestep_input_barriercapturespaused_focusand blurs (or terminates on error/stop).native-macosmacos-surface(nsh-platform-macosdesktop_composing_escape):DESKTOP_APPimported{ host }from the retired"nsh/host"subpath (moved_to: Some("nsh")innsh-js) and omitted"log"frompolicy.declared.host. QuickJS rejected"nsh/host"at module load time, leaving zero views mounted until the 5s AppKit pump deadline (5.270s).hostfrom"nsh"and declare"log"inpolicy.declared.host.native-macosdesktop(nsh-platform-macossubtree reachability, focus revocation, andTerminalSurface::pressable_bounds):style.hidden(display: "none"/visibility: "hidden") hides only the parent'sCALayer, notNSView.isHidden(whichnavigationreserves for parkedStackscreens), andnsh-coremountspointerEvents: "none"on the blocking ancestor while leaving descendantsAuto. Flat / single-node checks inpressable_bounds,is_key_stop,focus_path,text_input(tab,acceptsFirstResponder,focus_editor,focused_editor,auto_focus/end_batch),navigation,sight,selectable_view, andagentignored ancestorstyle.hidden, ancestorpointerEvents(None/BoxOnly), ancestoraccessibilityElementsHidden, grouping accessible names (access::name_of), CSS transforms (s.transform()), live scroll offsets (scroll::bounds_origin), and clipped visibility (visible_bounds), causingdesktop_connection_failure_has_one_status_below_the_workspaceto match duplicate hidden controls (Chatindisplay: "none").NshView::{is_hidden, is_shown_in_tree, can_reach, to_root, visible_bounds},access::{hidden_in_subtree, name_of}) across macOS input, focus/editor responder admission & revocation (release_invalid_control_focus), navigation, sight/agent/selection, and top-downpressable_bounds_in, plus addhidden_and_clipped_subtrees_exclude_pressables_and_revoke_focusintests/terminal.Verification
node scripts/ci.mjs check format,node scripts/ci.mjs check licenses,node scripts/ci.mjs check notices, andnode scripts/ci.mjs check tooling-testslocally (all passed).linux-nsh(128603910440),native-windows(128603910389), andnative-macosmacos-surface(128603910401) on GitHub Actions, and addedhidden_and_clipped_subtrees_exclude_pressables_and_revoke_focuscovering macOSpressable_bounds, CSS transforms, grouping labels,Tabtraversal,pause_inputwith hiddenautoFocus, and focus revocation on ancestordisplay: "none"/pointerEvents: "none".AI use
Select exactly one:
Tool(s) and scope: Antigravity — diagnosed
rust-previewCI failures (linux-nshandnative-macos), implemented fixes, and verified checks.Checklist
Does this PR entail a change in behavior?
Generated-by: Antigravity