Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/fluent-layout/src/command_palette.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ impl Render for CommandPalette {

// Self-focus on the first frame after opening
if !self.focus_handle.is_focused(window) {
window.focus(&self.focus_handle);
window.focus(&self.focus_handle, cx);
}

let theme = cx.theme();
Expand Down
4 changes: 2 additions & 2 deletions crates/fluent-layout/src/context_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ impl Render for ContextMenu {
self.ensure_selection();
}
if !self.closing && !focus_handle.is_focused(window) {
window.focus(&focus_handle);
window.focus(&focus_handle, cx);
}

let theme = cx.theme();
Expand Down Expand Up @@ -714,7 +714,7 @@ mod tests {
use std::time::Duration;

use fluent_test_utils::init_fluent_test;
use gpui::{point, px, AppContext as _, TestAppContext};
use gpui::{point, px, TestAppContext};

use super::*;

Expand Down
4 changes: 2 additions & 2 deletions crates/fluent-layout/src/menu_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ impl Render for MenuBar {
}
})
.on_mouse_down(MouseButton::Left, move |_, win, cx| {
win.focus(&focus_handle);
win.focus(&focus_handle, cx);
sw_click
.update(cx, |bar, cx| {
if bar.open_index == Some(idx) && !bar.closing {
Expand Down Expand Up @@ -788,7 +788,7 @@ mod tests {
use std::time::Duration;

use fluent_test_utils::init_fluent_test;
use gpui::{AppContext as _, TestAppContext};
use gpui::TestAppContext;

use super::*;

Expand Down
10 changes: 5 additions & 5 deletions crates/fluent-layout/src/menu_button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::sync::{Arc, Mutex};

use fluent_core::{Theme, ThemeProvider as _};
use gpui::{
anchored, canvas, deferred, div, point, prelude::*, px, svg, App, Bounds, ClickEvent, Context,
Corner, ElementId, FocusHandle, IntoElement, KeyDownEvent, MouseButton, Pixels, Point, Render,
anchored, canvas, deferred, div, point, prelude::*, px, svg, Anchor, App, Bounds, ClickEvent,
Context, ElementId, FocusHandle, IntoElement, KeyDownEvent, MouseButton, Pixels, Point, Render,
SharedString, WeakEntity, Window,
};

Expand Down Expand Up @@ -628,7 +628,7 @@ impl Render for MenuButton {
})
.on_click(cx.listener(
move |button: &mut MenuButton, ev: &ClickEvent, window, cx| {
window.focus(&focus_handle);
window.focus(&focus_handle, cx);
button.update_origin(point(
ev.position().x,
ev.position().y + px(cx.theme().components.dropdown_height),
Expand Down Expand Up @@ -682,7 +682,7 @@ impl Render for MenuButton {
root = root.child(deferred(
overlay.child(
anchored()
.anchor(Corner::TopLeft)
.anchor(Anchor::TopLeft)
.position(self.popup_origin)
.snap_to_window()
.child(menu),
Expand All @@ -699,7 +699,7 @@ mod tests {
use std::time::Duration;

use fluent_test_utils::init_fluent_test;
use gpui::{AppContext as _, ClickEvent, TestAppContext};
use gpui::{ClickEvent, TestAppContext};

use super::*;

Expand Down
8 changes: 4 additions & 4 deletions crates/fluent-layout/src/popover.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use fluent_core::ThemeProvider as _;
use gpui::{
anchored, deferred, div, prelude::*, px, AnyElement, Corner, IntoElement, Point, RenderOnce,
anchored, deferred, div, prelude::*, px, Anchor, AnyElement, IntoElement, Point, RenderOnce,
Window,
};

Expand All @@ -9,7 +9,7 @@ use gpui::{
pub struct Popover {
open: bool,
position: Point<gpui::Pixels>,
anchor: Corner,
anchor: Anchor,
content: AnyElement,
}

Expand All @@ -18,7 +18,7 @@ impl Popover {
Self {
open: true,
position,
anchor: Corner::TopLeft,
anchor: Anchor::TopLeft,
content: content.into_any_element(),
}
}
Expand All @@ -28,7 +28,7 @@ impl Popover {
self
}

pub fn anchor(mut self, anchor: Corner) -> Self {
pub fn anchor(mut self, anchor: Anchor) -> Self {
self.anchor = anchor;
self
}
Expand Down
2 changes: 1 addition & 1 deletion crates/fluent-layout/src/toast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl ToastStack {
if let Some(timeout) = timeout {
cx.spawn(async move |cx| {
cx.background_executor().timer(timeout).await;
cx.update(|cx| ToastStack::dismiss(id.as_ref(), cx)).ok();
cx.update(|cx| ToastStack::dismiss(id.as_ref(), cx));
})
.detach();
}
Expand Down
1 change: 1 addition & 0 deletions docs/gpui-api-drift.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,5 @@ signature diff. The rows known to matter are called out under "Notes".
|---|---|---|
| `fluent-core` | WI-1425 | No source change. Every symbol it imports is in "unchanged" above, and `cargo check`, `cargo test` (22 unit tests) and `cargo clippy --no-deps -D warnings` pass against `vendor/zed` with the public API untouched. |
| `fluent-primitives` | WI-1426 | Compiles, 27 unit tests pass, `cargo clippy --all-targets --no-deps -D warnings` is clean. The location check above missed five signature changes, all forced by the vendored gpui and each a mechanical adaptation: `Window::focus`, `focus_next` and `focus_prev` now take `&mut App`; `ShapedLine::paint` takes a `TextAlign` and an optional align width (passed `Left` and `None`, the previous implicit behaviour); `Styled::text_style()` returns the refinement directly instead of an `Option`; `ElementId::NamedChild` holds an `Arc` instead of a `Box`; and `Corner` is gone, replaced by `gpui::Anchor`. The crate re-exports its own four-variant `Corner` that converts into `Anchor`, so the popover anchor API the later crates use does not change. |
| `fluent-layout` | WI-1428 | Compiles, 37 unit tests pass, `cargo clippy --all-targets --no-deps -D warnings` is clean. Three changes, all forced by the vendored gpui: `Window::focus` takes `&mut App`; `AsyncApp::update` returns its value directly instead of a `Result`, so the toast timeout's `.ok()` is gone; and `gpui::Corner` is gone. `Popover::anchor` now takes `gpui::Anchor` instead of `Corner`, and the menu button anchors its popup at `Anchor::TopLeft`. |
| `fluent-ribbon` | WI-1427 | No source change. Every gpui symbol it uses (`App`, `AnyElement`, `ClickEvent`, `Context`, `FontWeight`, `IntoElement`, `Render`, `SharedString`, `Window`, `div`, `prelude`, `px`, `svg`) is in "unchanged" above, and `cargo check`, `cargo test` (no unit tests; one ignored doc-test) and `cargo clippy --all-targets --no-deps -D warnings` pass against `vendor/zed` with the public API untouched. |
Loading