Port · Build: Zed's gpui at 1a28cff

gpui and gpui_platform now come from Zed's repo by git at 1a28cff,
the code gpui-pre 0.3.7 republishes, so the gallery can later build
for the browser. gpui takes stacker, as 0.2.2 always did, and
gpui_platform takes font-kit, without which macOS draws no text;
runtime_shaders moves to gpui_platform.

The API moved: focus, blur and Tab steps take cx, Corner is Anchor,
shaped lines paint with an alignment, defer_draw takes a content
mask, the inspector registers a factory, async updates return their
value, and wrapped lines are shared, not cloned. Updates through a
window context go through the window, so a closed window still ends
them as it did.

Where the new gpui behaves differently, Ely keeps its old intent.
Holds and reveals under a resting pointer survive typing through
gpui's input-modality-independent hover; previews the keyboard also
moves keep the default, and the calendar's leave ignores a key press.
Enter reaches a button inside the code editor, since gpui now arms a
key click on the press. The event logger skips a lone modifier. A
video and an image grid keep their shape in a flex column under
taffy 0.13, as a picture does.

AGENTS.md records the new stack and the rules this port changes; the
rest of the old gpui and taffy rules are re-tested in T44c.
This commit is contained in:
ZacharyZhang-NY committed 2026-09-28 20:30:17 -04:00
1 parent 25b8a6f22c
commit 4c3ed1bbb9
199 files changed
+2513 -2643

No files matched your search

+1 -1
View File
@@ -266,7 +266,7 @@ impl RenderOnce for Calculator {
.focus_ring(cx)
.on_mouse_down(MouseButton::Left, {
let focus = focus.clone();
move |_, window, _| window.focus(&focus)
move |_, window, cx| window.focus(&focus, cx)
})
.on_key_down({
let tape = tape.clone();
+3 -3
View File
@@ -90,7 +90,7 @@ impl RenderOnce for Captcha {
let verify = tab_stop((id.clone(), "verify").into(), !passed, window, cx);
if passed && field.read(cx).focus().is_focused(window) {
log::info!("captcha: passed; focus goes to the mark");
window.focus(&verify);
window.focus(&verify, cx);
}
let checking = self.state == CaptchaState::Checking;
let answer = {
@@ -101,13 +101,13 @@ impl RenderOnce for Captcha {
}
let text = SharedString::from(field.read(cx).text().trim().to_string());
if text.is_empty() {
window.focus(field.read(cx).focus());
window.focus(&field.read(cx).focus().clone(), cx);
return;
}
log::info!("captcha: answered");
on_answer(&text, window, cx);
field.update(cx, |field, cx| field.set_text("", cx));
window.focus(field.read(cx).focus());
window.focus(&field.read(cx).focus().clone(), cx);
})
};
let theme = cx.theme();
+2 -1
View File
@@ -54,7 +54,8 @@ fn each_second(id: impl Into<ElementId>, window: &mut Window, cx: &mut App) {
cx.background_executor()
.timer(Duration::from_nanos(1_000_000_000 - past))
.await;
if ticker.update(cx, |_, cx| cx.notify()).is_err() {
let ticked = cx.update(|_, cx| ticker.update(cx, |_, cx| cx.notify()));
if ticked.and_then(|inner| inner).is_err() {
return;
}
}
+1 -1
View File
@@ -190,7 +190,7 @@ impl RenderOnce for Poll {
let ix = picked.expect("Vote waits for a pick");
log::info!("poll: voted for option {ix}");
on_vote(Some(ix), window, cx);
window.focus(&focus);
window.focus(&focus, cx);
})
}
Some(_) => Button::new((id.clone(), "change"), "Change vote")
+1 -1
View File
@@ -276,7 +276,7 @@ impl RenderOnce for Quiz {
if let (true, Some(on_score)) = (finishing, &on_score) {
on_score(score, count, window, cx);
}
window.focus(&focus);
window.focus(&focus, cx);
}),
),
)
+1 -1
View File
@@ -123,7 +123,7 @@ impl RenderOnce for Stopwatch {
cx.notify();
});
if let Some(then) = &then {
window.focus(then);
window.focus(then, cx);
}
}
};
+1 -1
View File
@@ -271,7 +271,7 @@ impl RenderOnce for Survey {
sheet.sent = true;
cx.notify();
});
window.focus(&focus);
window.focus(&focus, cx);
}),
),
)
+1 -1
View File
@@ -63,7 +63,7 @@ pub(super) fn stage(
let wakes = Rc::new(Cell::new(0));
let count = wakes.clone();
cx.update(|window, cx| {
window.focus(&root);
window.focus(&root, cx);
cx.observe(&view, move |_, _| count.set(count.get() + 1))
.detach();
});
+1 -1
View File
@@ -148,7 +148,7 @@ fn consent_hands_focus_back_to_its_opener(cx: &mut TestAppContext) {
button: cx.focus_handle(),
});
let button = view.read_with(cx, |opener, _| opener.button.clone());
cx.update(|window, _| window.focus(&button));
cx.update(|window, cx| window.focus(&button, cx));
settle(cx);
press("enter", cx);
press("tab", cx);
+1 -1
View File
@@ -268,7 +268,7 @@ fn answered_from_button(part: fn() -> AnyElement, tabs: usize, cx: &mut TestAppC
part,
});
let button = view.read_with(cx, |opener, _| opener.button.clone());
cx.update(|window, _| window.focus(&button));
cx.update(|window, cx| window.focus(&button, cx));
settle(cx);
press("enter", cx);
for _ in 0..tabs {