You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue records deferred September upstream work. It does not approve every feature below or claim that the immediate sync patches are complete. Each item needs a separate scope decision and semantic adaptation.
Longbridge now uses longbridge/gpui-kit. The local partial clones at /tmp/zed and /tmp/longbridge-gpui-component are disposable. engine/UPSTREAM.md, engine/fork.toml, and framework/UPSTREAM.md remain the authoritative sync records. This issue does not advance their cursors.
Paths below are relative to the Neutron root. Line references refer to the baseline and can move after the immediate sync.
The upstream WM_QUERYENDSESSION and WM_ENDSESSION support can help installer-driven shutdown. It conflicts with Neutron message allocation and embedded-host lifetime policy.
Local paths: engine/crates/gpui_windows/src/platform.rs, engine/crates/gpui_windows/src/window.rs, engine/crates/gpui/src/app.rs, and framework/crates/app/src/handles.rs.
Reserve a distinct message ID. Upstream uses WM_USER + 9, which Neutron assigns to WM_GPUI_VSYNC_THREAD_STOPPED at platform.rs:117.
Route shutdown through the existing lifecycle. Preserve request_quit_with, run_will_exit, and VSync thread cleanup.
Keep the embedded host alive unless its owner explicitly requests process termination. Do not copy unconditional process::exit.
Acceptance requires native Windows end-session, cancellation, repeated quit, and reentrant quit observations. Confirm one lifecycle completion, VSync cleanup, and preservation of the embedded host.
Browser IME and focus
The current hidden input lacks the upstream text mirror. The full adaptation must address composition, context-sensitive deletion, selection import, and virtual keyboard focus together.
Local paths: engine/crates/gpui_web/src/{events.rs,window.rs}, a new ime_mirror.rs, engine/crates/gpui/src/{input.rs,platform.rs,window.rs}, and concrete framework input handlers under framework/crates/ui/src/input/.
Dependency order
Source
Extract required selection and geometry contracts from the pre-cursor API
Neutron lacks parts of the pre-cursor API despite the audit cursor. Extract only required contracts rather than import the full mobile API.
Preserve the handled-key guard before preventDefault() in events.rs. Implement real selection mutation in concrete handlers. Do not accept upstream empty selection setters as proof of support. Keep unsupported desktop capabilities explicit instead of silent no-ops.
Acceptance requires browser composition commit and cancellation, emoji and UTF-16 selection, autocorrect, word deletion, and Android slide-delete selection. Exercise concurrent application selection changes and editable-range boundaries. Confirm keyboard reopen, focus loss, and no duplicate input. Keep browser observations separate from native IME claims.
Portable touch and callout policy
Neutron has no portable gesture recognizer. These changes add a feature rather than repair existing gesture physics. The current PlatformInput and pointer-to-mouse path need a coordinated extension.
Local paths: engine/crates/gpui/src/{interactive.rs,window.rs,elements/div.rs}, a new gestures.rs, and engine/crates/gpui_web/src/{events.rs,window.rs,platform.rs}.
Dependency order
Source
Add raw touch dispatch and portable recognition after the required pre-cursor API
Reconcile synchronous draws after taps with deferred arena cleanup, retained layers, accessibility, and frame scheduling. Preserve reduced-motion policy. Native recognizer defaults do not prove native touch support.
Acceptance requires browser tap-versus-pan arbitration, pointer cancellation and ID reuse, nested scroll boundaries, axis lock, prediction reversal, and long-press or direct-drag ownership. Confirm that pans do not move keyboard focus and that momentum stops correctly.
Defer 9bda6b4e03, zed-industries/zed#63775, until an alternative interaction exists. Its canvas callout suppression alone provides no replacement long-press behavior.
Framework soft-wrap affinity and optional multi-cursor input
At an exact soft-wrap boundary, one logical offset can identify either adjacent visual row. Neutron needs an explicit affinity model before the upstream selection correction can transfer safely.
Local paths: framework/crates/ui/src/input/{state.rs,element.rs,movement.rs,text_wrapper.rs,selection.rs}.
Define the logical-offset and visual-row contract first. Then adapt hit tests, caret movement, and selection endpoints. Preserve UTF-8 boundaries, IME ranges, accessibility selection, and existing undo behavior.
Acceptance requires clicks on both sides of exact wrap boundaries, Shift-selection, vertical movement, and Home/End behavior. Include empty lines, multibyte text, and resize-induced wrap changes.
The upstream commit touches 13 input files and exceeds 3,600 insertions overall. It changes the selection model, undo, IME, and editor operations. Do not treat it as a routine cherry-pick. Resolve affinity and document the selection-model migration before implementation.
This optimization prepares font-match caches before first use. Its value depends on startup cost and actual cache misses.
Local paths: engine/crates/gpui_wgpu/src/cosmic_text_system.rs, engine/crates/gpui/src/{text_system.rs,platform.rs}, and the application startup integration.
Measure startup, first text use, and memory before an API change. Keep cache preparation off the foreground path where safe. Confirm fallback font selection and behavior after font additions. Glyph-raster reuse belongs to the immediate implementation scope, not this deferred item.
Preserve bundled browser fonts. ef075910c9, zed-industries/zed#63493, removes defaults rather than supply a missing font API. Neutron already exposes add_fonts.
An optional small-artifact policy may use explicit configuration in engine/crates/gpui_web/src/platform.rs. Require artifact-size measurements and missing-font behavior before approval. Keep current applications compatible by default.
Local paths: engine/crates/gpui_macos/src/{window.rs,platform.rs}.
Limit the migration to PlatformWindow::prompt, MacWindow main-thread proof, and owned NSAlert state. Preserve MainThreadMarker requirements. Do not expand this task into a general Objective-C rewrite.
Acceptance requires native macOS button results, Escape cancellation, deferred completion, focus restoration, and window closure while the prompt exists. Preserve callback ownership and AppShell shutdown behavior.
Local paths: engine/crates/gpui_macos/src/metal_renderer.rs, engine/crates/gpui_windows/src/{directx_renderer.rs,window.rs}, and engine/crates/gpui_platform/.
Upstream headless Metal exposure and Windows image capture do not model all Neutron renderer state. Define the capture contract before an implementation import.
Require image evidence for retained-layer reuse, element backdrop blur, resize, scale changes, and device recovery. Record compositor-only native blur and overlay behavior separately when renderer readback cannot capture it. Do not classify a headless image as native presentation evidence. Coordinate overlay coverage with #36.
Local paths: engine/crates/gpui/src/{taffy.rs,elements/div.rs}.
Neutron's to_taffy path does not use the same authored-padding snap as upstream. Transfer the regression test before the patch. Establish whether recomputed padding and layout padding disagree at fractional scale factors. Include percentage padding and scroll-end clamping.
Keep stacksafe protection. 41d72f6c1d, zed-industries/zed#63187, is only a future measurement and opt-in policy reference. This issue does not request its removal or default disablement.
Upstream grants Apache-2.0 to the current upstream packages. That grant does not by itself establish the license of every retained historical Neutron source variant.
The source comparison found differences in engine/crates/zlog/src/filter.rs and engine/crates/zlog/src/sink.rs, including historical rotation code. engine/crates/ztracing/src/lib.rs differs in WASM and feature extraction. The engine/crates/ztracing_macro source matches the compared upstream source.
The current GPL-declared dependency graph is gpui -> sum_tree -> ztracing -> zlog/ztracing_macro. This issue does not authorize a blanket metadata relabel of that graph.
engine/LICENSE-AUDIT.md records the new grant and unresolved source differences separately. Its update does not change package licenses. The engine policy requires license notices to remain unchanged unless an authorized task explicitly names the migration.
Map every retained source file and material local change to an applicable license grant. Then select exact relicensed upstream source plus authorized local adaptations, or obtain an owner or rightsholder decision for unresolved source. Preserve required notices and attribution throughout that work.
Acceptance requires a source-to-license record, explicit treatment of historical differences, and inspection of the resulting cargo package artifacts. Confirm that package metadata and included notices agree with the reconciled source. Preserve registry ownership, asset provenance, and other publication blockers. Do not claim publication readiness from the upstream grant alone.
Defer the index optimization and coordinate the API decision with #28. Measure large-domain benefit before new Eq + Hash constraints.
The immediate ScaleBand adaptation uses first-occurrence category deduplication and retains PartialEq-compatible values. Central tests remain pending. This issue makes no completion claim for that code.
The current deduplication construction is O(n^2), and each lookup is O(n). A future API or index choice needs measured large-domain benefit. Decide float and custom PartialEq compatibility before a HashMap migration. Preserve category order and equality behavior unless an explicit API decision changes them.
These candidates are not automatic Stage 2 approvals. Existing #28 owns chart-domain work. Existing #34 owns system notifications. Neither needs a duplicate feature request here.
Invariants, non-goals, and completion evidence
Preserve typed unsupported errors, embedded lifecycle, accessibility, custom cursor and font behavior, retained layers, overlay policy, and native blur. Keep framework dependencies on public engine interfaces.
Exclude wholesale gpui-base or gpui-shell extraction, crate rebrand, native-menu replacement, and Zed application code. Do not copy upstream root manifests or lockfiles. Do not remove native blur or retained layers.
Do not import already-equivalent notification timers or the WASM application-lifetime example fix as deferred corrections. This issue makes no license or source-provenance completion claim.
For each approved item, record exact source identity, semantic changes, and remaining unsupported behavior. Run affected unit or headless checks and applicable native Stage 1 profiles through the repository scripts. Preserve downstream framework checks for engine changes.
Keep compile-only, headless, browser, software-GPU, hardware-GPU, and native observations distinct. Record exact commands, environments, artifacts, and omissions. Require native evidence for claims that depend on native lifecycle or presentation.
Purpose and source records
This issue records deferred September upstream work. It does not approve every feature below or claim that the immediate sync patches are complete. Each item needs a separate scope decision and semantic adaptation.
58be988690645917d35fd4b636a4ce2e3a11a9b6d9ad6aff67e47de43abb270d22de75dd950f1b48..5a9b9558db01a6b906cec2fb70a797affdc58cdd334bbed2e8c47d606eb79ab05ddcebd60b823429..cbdf5baa26a5c20ae5c1d7481bffdd1d0d2abd3dLongbridge now uses
longbridge/gpui-kit. The local partial clones at/tmp/zedand/tmp/longbridge-gpui-componentare disposable.engine/UPSTREAM.md,engine/fork.toml, andframework/UPSTREAM.mdremain the authoritative sync records. This issue does not advance their cursors.Paths below are relative to the Neutron root. Line references refer to the baseline and can move after the immediate sync.
Windows Restart Manager
Source: 7f2a2c3c3e, zed-industries/zed#62987.
The upstream
WM_QUERYENDSESSIONandWM_ENDSESSIONsupport can help installer-driven shutdown. It conflicts with Neutron message allocation and embedded-host lifetime policy.Local paths:
engine/crates/gpui_windows/src/platform.rs,engine/crates/gpui_windows/src/window.rs,engine/crates/gpui/src/app.rs, andframework/crates/app/src/handles.rs.WM_USER + 9, which Neutron assigns toWM_GPUI_VSYNC_THREAD_STOPPEDatplatform.rs:117.request_quit_with,run_will_exit, and VSync thread cleanup.process::exit.Acceptance requires native Windows end-session, cancellation, repeated quit, and reentrant quit observations. Confirm one lifecycle completion, VSync cleanup, and preservation of the embedded host.
Browser IME and focus
The current hidden input lacks the upstream text mirror. The full adaptation must address composition, context-sensitive deletion, selection import, and virtual keyboard focus together.
Local paths:
engine/crates/gpui_web/src/{events.rs,window.rs}, a newime_mirror.rs,engine/crates/gpui/src/{input.rs,platform.rs,window.rs}, and concrete framework input handlers underframework/crates/ui/src/input/.Neutron lacks parts of the pre-cursor API despite the audit cursor. Extract only required contracts rather than import the full mobile API.
Preserve the handled-key guard before
preventDefault()inevents.rs. Implement real selection mutation in concrete handlers. Do not accept upstream empty selection setters as proof of support. Keep unsupported desktop capabilities explicit instead of silent no-ops.Acceptance requires browser composition commit and cancellation, emoji and UTF-16 selection, autocorrect, word deletion, and Android slide-delete selection. Exercise concurrent application selection changes and editable-range boundaries. Confirm keyboard reopen, focus loss, and no duplicate input. Keep browser observations separate from native IME claims.
Portable touch and callout policy
Neutron has no portable gesture recognizer. These changes add a feature rather than repair existing gesture physics. The current
PlatformInputand pointer-to-mouse path need a coordinated extension.Local paths:
engine/crates/gpui/src/{interactive.rs,window.rs,elements/div.rs}, a newgestures.rs, andengine/crates/gpui_web/src/{events.rs,window.rs,platform.rs}.The focus and hover changes in a66fb6aebd, zed-industries/zed#63533, also need this touch state.
Reconcile synchronous draws after taps with deferred arena cleanup, retained layers, accessibility, and frame scheduling. Preserve reduced-motion policy. Native recognizer defaults do not prove native touch support.
Acceptance requires browser tap-versus-pan arbitration, pointer cancellation and ID reuse, nested scroll boundaries, axis lock, prediction reversal, and long-press or direct-drag ownership. Confirm that pans do not move keyboard focus and that momentum stops correctly.
Defer 9bda6b4e03, zed-industries/zed#63775, until an alternative interaction exists. Its canvas callout suppression alone provides no replacement long-press behavior.
Framework soft-wrap affinity and optional multi-cursor input
Source: 91217366a5, longbridge/gpui-kit#2656.
At an exact soft-wrap boundary, one logical offset can identify either adjacent visual row. Neutron needs an explicit affinity model before the upstream selection correction can transfer safely.
Local paths:
framework/crates/ui/src/input/{state.rs,element.rs,movement.rs,text_wrapper.rs,selection.rs}.Define the logical-offset and visual-row contract first. Then adapt hit tests, caret movement, and selection endpoints. Preserve UTF-8 boundaries, IME ranges, accessibility selection, and existing undo behavior.
Acceptance requires clicks on both sides of exact wrap boundaries, Shift-selection, vertical movement, and Home/End behavior. Include empty lines, multibyte text, and resize-induced wrap changes.
Multi-cursor input is a separate optional subtask. Source: cbdf5baa26, longbridge/gpui-kit#2837. Coordinate ownership with #23.
The upstream commit touches 13 input files and exceeds 3,600 insertions overall. It changes the selection model, undo, IME, and editor operations. Do not treat it as a routine cherry-pick. Resolve affinity and document the selection-model migration before implementation.
Optional font cache and browser font policy
Source: f1d27d545e, zed-industries/zed#63158.
This optimization prepares font-match caches before first use. Its value depends on startup cost and actual cache misses.
Local paths:
engine/crates/gpui_wgpu/src/cosmic_text_system.rs,engine/crates/gpui/src/{text_system.rs,platform.rs}, and the application startup integration.Measure startup, first text use, and memory before an API change. Keep cache preparation off the foreground path where safe. Confirm fallback font selection and behavior after font additions. Glyph-raster reuse belongs to the immediate implementation scope, not this deferred item.
Preserve bundled browser fonts. ef075910c9, zed-industries/zed#63493, removes defaults rather than supply a missing font API. Neutron already exposes
add_fonts.An optional small-artifact policy may use explicit configuration in
engine/crates/gpui_web/src/platform.rs. Require artifact-size measurements and missing-font behavior before approval. Keep current applications compatible by default.Bounded macOS prompt migration
Source: a60addb9a9, zed-industries/zed#59572.
Local paths:
engine/crates/gpui_macos/src/{window.rs,platform.rs}.Limit the migration to
PlatformWindow::prompt,MacWindowmain-thread proof, and ownedNSAlertstate. PreserveMainThreadMarkerrequirements. Do not expand this task into a general Objective-C rewrite.Acceptance requires native macOS button results, Escape cancellation, deferred completion, focus restoration, and window closure while the prompt exists. Preserve callback ownership and AppShell shutdown behavior.
Renderer image evidence
Sources: fecc3273ed, zed-industries/zed#63244, and 74490daced, zed-industries/zed#63012.
Local paths:
engine/crates/gpui_macos/src/metal_renderer.rs,engine/crates/gpui_windows/src/{directx_renderer.rs,window.rs}, andengine/crates/gpui_platform/.Upstream headless Metal exposure and Windows image capture do not model all Neutron renderer state. Define the capture contract before an implementation import.
Require image evidence for retained-layer reuse, element backdrop blur, resize, scale changes, and device recovery. Record compositor-only native blur and overlay behavior separately when renderer readback cannot capture it. Do not classify a headless image as native presentation evidence. Coordinate overlay coverage with #36.
Fractional padding and stack protection
Source: b1a7ef0cf6, zed-industries/zed#62296.
Local paths:
engine/crates/gpui/src/{taffy.rs,elements/div.rs}.Neutron's
to_taffypath does not use the same authored-padding snap as upstream. Transfer the regression test before the patch. Establish whether recomputed padding and layout padding disagree at fractional scale factors. Include percentage padding and scroll-end clamping.Keep
stacksafeprotection. 41d72f6c1d, zed-industries/zed#63187, is only a future measurement and opt-in policy reference. This issue does not request its removal or default disablement.License-source reconciliation
Source: ac5af8b9e1, zed-industries/zed#63573.
Upstream grants Apache-2.0 to the current upstream packages. That grant does not by itself establish the license of every retained historical Neutron source variant.
The source comparison found differences in
engine/crates/zlog/src/filter.rsandengine/crates/zlog/src/sink.rs, including historical rotation code.engine/crates/ztracing/src/lib.rsdiffers in WASM and feature extraction. Theengine/crates/ztracing_macrosource matches the compared upstream source.The current GPL-declared dependency graph is
gpui -> sum_tree -> ztracing -> zlog/ztracing_macro. This issue does not authorize a blanket metadata relabel of that graph.engine/LICENSE-AUDIT.mdrecords the new grant and unresolved source differences separately. Its update does not change package licenses. The engine policy requires license notices to remain unchanged unless an authorized task explicitly names the migration.Map every retained source file and material local change to an applicable license grant. Then select exact relicensed upstream source plus authorized local adaptations, or obtain an owner or rightsholder decision for unresolved source. Preserve required notices and attribution throughout that work.
Acceptance requires a source-to-license record, explicit treatment of historical differences, and inspection of the resulting
cargo packageartifacts. Confirm that package metadata and included notices agree with the reconciled source. Preserve registry ownership, asset provenance, and other publication blockers. Do not claim publication readiness from the upstream grant alone.Lower-priority decisions
max_lines: a9edc3e294, longbridge/gpui-kit#2829framework/crates/ui/src/text/{text_view.rs,state.rs,inline.rs}and whole-line truncation semantics. Coordinate text-domain ownership with #14.framework/crates/ui/src/icon.rsor icon slots.Eq + Hashconstraints.The immediate ScaleBand adaptation uses first-occurrence category deduplication and retains
PartialEq-compatible values. Central tests remain pending. This issue makes no completion claim for that code.The current deduplication construction is O(n^2), and each lookup is O(n). A future API or index choice needs measured large-domain benefit. Decide float and custom
PartialEqcompatibility before a HashMap migration. Preserve category order and equality behavior unless an explicit API decision changes them.These candidates are not automatic Stage 2 approvals. Existing #28 owns chart-domain work. Existing #34 owns system notifications. Neither needs a duplicate feature request here.
Invariants, non-goals, and completion evidence
Preserve typed unsupported errors, embedded lifecycle, accessibility, custom cursor and font behavior, retained layers, overlay policy, and native blur. Keep framework dependencies on public engine interfaces.
Exclude wholesale
gpui-baseorgpui-shellextraction, crate rebrand, native-menu replacement, and Zed application code. Do not copy upstream root manifests or lockfiles. Do not remove native blur or retained layers.Do not import already-equivalent notification timers or the WASM application-lifetime example fix as deferred corrections. This issue makes no license or source-provenance completion claim.
For each approved item, record exact source identity, semantic changes, and remaining unsupported behavior. Run affected unit or headless checks and applicable native Stage 1 profiles through the repository scripts. Preserve downstream framework checks for engine changes.
Keep compile-only, headless, browser, software-GPU, hardware-GPU, and native observations distinct. Record exact commands, environments, artifacts, and omissions. Require native evidence for claims that depend on native lifecycle or presentation.