Skip to content

Port fluent-primitives to the vendored upstream gpui (WI-1426) - #12

Open
thedancingdeveloper wants to merge 1 commit into
wi-1425-port-fluent-corefrom
wi-1426-port-fluent-primitives
Open

thedancingdeveloper wants to merge 1 commit into
wi-1425-port-fluent-corefrom
wi-1426-port-fluent-primitives

Conversation

@thedancingdeveloper

Copy link
Copy Markdown
Owner

Summary

Stacked on #10 (wi-1425-port-fluent-core). Do not merge until #10 lands; this PR's base is that branch, not gpui-upstream.

Ports crates/fluent-primitives to the vendored zed gpui. The symbol-location drift report called every symbol this crate uses "unchanged", but five signatures moved. Each adaptation is mechanical and forced by the vendored gpui:

  • Window::focus, focus_next and focus_prev now take &mut App.
  • ShapedLine::paint takes a TextAlign and an optional align width. The call passes TextAlign::Left and None, which is what the old four-argument paint did.
  • Styled::text_style() returns &mut TextStyleRefinement directly instead of an Option, so the get_or_insert_with is gone.
  • ElementId::NamedChild holds an Arc<ElementId> instead of a Box.
  • gpui::Corner is removed. The crate now exports its own four-variant Corner (TopLeft/TopRight/BottomLeft/BottomRight) that converts into gpui::Anchor, so the popover anchor API that ribbon, layout and app build on does not change.

No other widget behaviour changes. The element-scale and font pre-warm patches (#7, #6) were not needed.

Public API

fluent_primitives::Corner is new and replaces the re-export of gpui::Corner. Its four variants and the .anchor(...) builders keep their old shapes. Nothing else in the public API moved.

Operator check

None. This is a compile-level port; nothing here needs a visual check.

Gates (Linux)

  • cargo check -p fluent-primitives — clean
  • cargo test -p fluent-primitives — 27 passed, 0 failed
  • cargo clippy -p fluent-primitives --all-targets --no-deps -- -D warnings — clean. --no-deps because the vendored ztracing crate fails -D warnings on its own unexpected_cfg lint, which is outside this crate.

WI-1426.

Five signature changes the symbol-location check missed: Window focus
methods now take &mut App, ShapedLine::paint takes alignment,
Styled::text_style returns the refinement directly, ElementId::NamedChild
holds an Arc, and Corner is replaced by a local four-variant enum that
converts into gpui::Anchor so the popover anchor API stays stable.
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.

1 participant