Skip to content

Commit cab822d

Browse files
committed
Merge remote-tracking branch 'upstream/main' into port-ce-generic-to-main
37 upstream commits (v0.7.0 -> v0.7.1), incl. gpui-pre 0.3.8 requirement. Conflict resolution, keeping the fork's deliberate divergences: - Cargo.toml: keep caret gpui-pre requirements so navop's [patch] to fork tags still resolves; bump them to 0.3.8 to match upstream's snapshot. - crates/shell/Cargo.toml, crates/shell/rquickjs-compat/Cargo.toml: keep the feigeCode/quickjs-jit revision (per-target interpreter-only split for 32-bit targets) instead of upstream's 0.12.11 move, which has no i686 bindings. - Cargo.lock: keep ours, then re-resolve. Re-pins rsa 0.10.0-rc.18 and pkcs1 0.8.0-rc.4, whose rc bumps break type inference in llrt_crypto. Also fixes a merged hunk in crates/base/src/input/editor/lsp/completions.rs: upstream's cursor-derived start offset replaced the fork's `range.end`, which left the range parameter dead; drop it from `request_completion` and delegate without it.
2 parents e66ec29 + af78e93 commit cab822d

179 files changed

Lines changed: 12949 additions & 1336 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Cargo.lock‎

Lines changed: 671 additions & 476 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ members = [
3636
"examples/table_in_scrollable",
3737
"examples/markdown_table",
3838
"examples/ai_recipes",
39+
"examples/speech",
3940
"crates/shell",
4041
"crates/shell/rquickjs-compat",
4142
"crates/component-shell",
@@ -47,29 +48,29 @@ publish = false
4748
edition = "2024"
4849

4950
[workspace.dependencies]
50-
gpui-kit = { path = "crates/kit", version = "0.7.0" }
51-
gpui-component = { path = "crates/component", version = "0.7.0" }
52-
gpui-base = { path = "crates/base", version = "0.7.0" }
53-
gpui-component-macros = { path = "crates/component-macros", version = "0.7.0" }
54-
gpui-kit-assets = { path = "crates/assets", version = "0.7.0" }
55-
gpui-fps = { path = "crates/fps", version = "0.7.0" }
56-
gpui-shell = { path = "crates/shell", version = "0.7.0" }
57-
gpui-wry = { path = "crates/webview", version = "0.7.0" }
58-
gpui-component-shell = { path = "crates/component-shell", version = "0.7.0" }
51+
gpui-kit = { path = "crates/kit", version = "0.7.1" }
52+
gpui-component = { path = "crates/component", version = "0.7.1" }
53+
gpui-base = { path = "crates/base", version = "0.7.1" }
54+
gpui-component-macros = { path = "crates/component-macros", version = "0.7.1" }
55+
gpui-kit-assets = { path = "crates/assets", version = "0.7.1" }
56+
gpui-fps = { path = "crates/fps", version = "0.7.1" }
57+
gpui-shell = { path = "crates/shell", version = "0.7.1" }
58+
gpui-wry = { path = "crates/webview", version = "0.7.1" }
59+
gpui-component-shell = { path = "crates/component-shell", version = "0.7.1" }
5960
story = { path = "crates/story" }
6061

6162
# GPUI comes from the `gpui-pre-*` snapshots of Zed's crates, and any snapshot
6263
# may change GPUI's API. Upstream pins these exactly so the weekly release
6364
# cannot move applications onto a newer snapshot (#3156). This fork relaxes
6465
# the pins to caret requirements: downstream (navop) resolves gpui-pre through
65-
# a [patch] section pointing at fork tags (0.3.123 > 0.3.7), which an exact pin
66+
# a [patch] section pointing at fork tags (0.3.124 > 0.3.8), which an exact pin
6667
# would reject. Bump every snapshot crate together with its Cargo.lock entry.
67-
gpui = { package = "gpui-pre", version = "0.3.7" }
68-
gpui_platform = { package = "gpui-pre-platform", version = "0.3.7", features = ["font-kit", "x11", "wayland", "runtime_shaders"] }
69-
gpui_web = { package = "gpui-pre-web", version = "0.3.7" }
70-
gpui_macros = { package = "gpui-pre-macros", version = "0.3.7" }
71-
reqwest_client = { package = "gpui-pre-reqwest-client", version = "0.3.7" }
72-
sum-tree = { package = "gpui-pre-sum-tree", version = "0.3.7" }
68+
gpui = { package = "gpui-pre", version = "0.3.8" }
69+
gpui_platform = { package = "gpui-pre-platform", version = "0.3.8", features = ["font-kit", "x11", "wayland", "runtime_shaders"] }
70+
gpui_web = { package = "gpui-pre-web", version = "0.3.8" }
71+
gpui_macros = { package = "gpui-pre-macros", version = "0.3.8" }
72+
reqwest_client = { package = "gpui-pre-reqwest-client", version = "0.3.8" }
73+
sum-tree = { package = "gpui-pre-sum-tree", version = "0.3.8" }
7374
reqwest = { package = "gpui-pre-reqwest", version = "=0.12.15", default-features = false, features = [
7475
"charset",
7576
"http2",
@@ -84,7 +85,7 @@ anyhow = "1"
8485
instant = { version = "0.1", features = ["wasm-bindgen"] }
8586
log = "0.4"
8687
lsp-types = { version = "0.97.0", features = ["proposed"] }
87-
notify = "7.0.0"
88+
notify = "8.2.0"
8889
raw-window-handle = "0.6.2"
8990
ropey = { version = "=2.0.0-beta.1", features = [
9091
"metric_chars",

‎crates/assets/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repository = "https://github.com/longbridge/gpui-kit"
99
readme = "README.md"
1010
edition.workspace = true
1111
publish = true
12-
version = "0.7.0"
12+
version = "0.7.1"
1313

1414
# Retain Cargo icon-directory metadata for existing build-script consumers.
1515
links = "gpui-kit-default-icons"

‎crates/assets/default-icons.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ icons/map.svg
6060
icons/maximize.svg
6161
icons/memory-stick.svg
6262
icons/menu.svg
63+
icons/mic.svg
6364
icons/minimize.svg
6465
icons/minus.svg
6566
icons/moon.svg
@@ -88,6 +89,7 @@ icons/settings.svg
8889
icons/sort-ascending.svg
8990
icons/sort-descending.svg
9091
icons/square-terminal.svg
92+
icons/square.svg
9193
icons/star-fill.svg
9294
icons/star-off.svg
9395
icons/star.svg

‎crates/assets/tests/icons.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ fn default_assets_preserve_the_component_bundle_without_all_lucide_icons() {
6262
.collect();
6363
let actual: BTreeSet<_> = Assets.list("icons/").unwrap().into_iter().collect();
6464
assert_eq!(actual, expected);
65-
assert_eq!(actual.len(), 104);
66-
assert_eq!(Assets::iter().count(), 104);
65+
assert_eq!(actual.len(), 106);
66+
assert_eq!(Assets::iter().count(), 106);
6767
assert!(Assets::get("icons/search.svg").is_some());
6868
assert!(Assets::get("icons/accessibility.svg").is_none());
6969
for path in actual {

‎crates/base/Cargo.toml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ exclude = ["examples/"]
99
repository = "https://github.com/longbridge/gpui-kit"
1010
homepage = "https://gpui-kit.com"
1111
documentation = "https://docs.rs/gpui-base"
12-
version = "0.7.0"
12+
version = "0.7.1"
1313
publish = true
1414
edition.workspace = true
1515

@@ -53,6 +53,7 @@ serde_json.workspace = true
5353
smallvec.workspace = true
5454
sum-tree.workspace = true
5555
tracing.workspace = true
56+
unicode-linebreak = "0.1.5"
5657
unicode-segmentation = "1.12.0"
5758
web-time = "1"
5859

‎crates/base/examples/native/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "gpui-base-examples"
33
default-run = "components"
4-
version = "0.7.0"
4+
version = "0.7.1"
55
publish = false
66
edition.workspace = true
77

‎crates/base/examples/wasm/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "gpui-base-examples-wasm"
3-
version = "0.7.0"
3+
version = "0.7.1"
44
publish = false
55
edition.workspace = true
66

‎crates/base/src/dock/dock_area.rs‎

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,24 @@ impl DockArea {
581581
self.commit(result, window, cx);
582582
}
583583

584+
/// Replace the slot sizes of the split at `node` in place.
585+
pub fn set_split_sizes(
586+
&mut self,
587+
node: NodeId,
588+
sizes: Vec<Pixels>,
589+
window: &mut Window,
590+
cx: &mut Context<Self>,
591+
) {
592+
let Some(placement) = self.placement_of_node(node) else {
593+
return;
594+
};
595+
let Some(tree) = self.tree_mut(placement) else {
596+
return;
597+
};
598+
let result = tree.set_sizes(node, sizes.into_iter().map(Some).collect());
599+
self.commit(result, window, cx);
600+
}
601+
584602
/// Put `panel` in a new tab group beside `node`.
585603
pub fn split_at(
586604
&mut self,
@@ -2439,6 +2457,63 @@ mod tests {
24392457
);
24402458
}
24412459

2460+
#[gpui::test]
2461+
fn set_split_sizes_restores_a_share_and_reports_it(cx: &mut TestAppContext) {
2462+
let (area, cx) = setup(cx);
2463+
cx.update(|window, cx| {
2464+
let alpha = TestPanel::new("Alpha", cx);
2465+
let beta = TestPanel::new("Beta", cx);
2466+
area.update(cx, |area, cx| {
2467+
area.set_center(
2468+
DockLayout::h_split()
2469+
.child(DockLayout::tabs().panel(alpha), Some(px(300.)))
2470+
.child(DockLayout::tabs().panel(beta), Some(px(300.))),
2471+
window,
2472+
cx,
2473+
);
2474+
});
2475+
});
2476+
cx.run_until_parked();
2477+
2478+
let root = cx.read(|cx| {
2479+
area.read(cx)
2480+
.layout(DockPlacement::Center)
2481+
.unwrap()
2482+
.root()
2483+
.id()
2484+
});
2485+
let events = Rc::new(Cell::new(0));
2486+
let observed = events.clone();
2487+
let _subscription = cx.update(|window, cx| {
2488+
window.subscribe(&area, cx, move |_, event: &DockEvent, _, _| {
2489+
if matches!(event, DockEvent::LayoutChanged) {
2490+
observed.set(observed.get() + 1);
2491+
}
2492+
})
2493+
});
2494+
2495+
cx.update(|window, cx| {
2496+
area.update(cx, |area, cx| {
2497+
area.set_split_sizes(root, vec![px(100.), px(300.)], window, cx);
2498+
});
2499+
});
2500+
cx.run_until_parked();
2501+
assert_eq!(events.get(), 1);
2502+
let measured = cx.read(|cx| area.read(cx).splits[&root].entity.read(cx).sizes().clone());
2503+
let share = measured[0].as_f32() / (measured[0].as_f32() + measured[1].as_f32());
2504+
assert!((share - 0.25).abs() < 0.01, "measured {measured:?}");
2505+
2506+
cx.update(|window, cx| {
2507+
area.update(cx, |area, cx| {
2508+
area.set_split_sizes(root, vec![px(10.)], window, cx);
2509+
});
2510+
});
2511+
cx.run_until_parked();
2512+
assert_eq!(events.get(), 1);
2513+
let after = cx.read(|cx| area.read(cx).splits[&root].entity.read(cx).sizes().clone());
2514+
assert_eq!(after, measured);
2515+
}
2516+
24422517
/// A drop that splits carries no size — `TabGroup` builds
24432518
/// `InsertTarget::Split { size: None }` — so the split has to decide one,
24442519
/// and sharing the container equally is the decision. Passing the `None`

0 commit comments

Comments
 (0)