diff --git a/Cargo.lock b/Cargo.lock index b90d638..c6aa091 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1922,7 +1922,7 @@ dependencies = [ [[package]] name = "ely-gpui-component" version = "0.1.1" -source = "git+https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components?rev=639521e109b3e2e46ad7410046fe3feb0a627c85#639521e109b3e2e46ad7410046fe3feb0a627c85" +source = "git+https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components?rev=bbb607106abcfd870e40874eb46d3ba698bfc0c5#bbb607106abcfd870e40874eb46d3ba698bfc0c5" dependencies = [ "alacritty_terminal", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 047bded..32b2920 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ jiff = "0.2" anyhow = "1" directories = "6" dunce = "1" -ely-gpui-component = { git = "https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components", rev = "639521e109b3e2e46ad7410046fe3feb0a627c85" } +ely-gpui-component = { git = "https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components", rev = "bbb607106abcfd870e40874eb46d3ba698bfc0c5" } env_logger = "0.11" gpui = { package = "gpui-pre", version = "=0.3.8", default-features = false, features = ["stacker"] } gpui_platform = { package = "gpui-pre-platform", version = "=0.3.8", features = ["font-kit", "wayland", "x11"] } diff --git a/agents.md b/agents.md index b99be73..bb5351e 100644 --- a/agents.md +++ b/agents.md @@ -40,7 +40,7 @@ site/ 官网(Vite 8、pnpm、TypeScript,无框架;等轴 SVG 积木 ## 组件映射 -依赖 `ely-gpui-component`(pin 639521e,gpui 为 crates.io 的 `gpui-pre` =0.3.8)。名字取自 `reference/Ely-GPUI-Components/src`。gpui 用法规则见该仓库 `AGENTS.md`。`tests/scripts/agents_md.py` 核对下表每个名字都是组件库公开项。 +依赖 `ely-gpui-component`(pin bbb6071,gpui 为 crates.io 的 `gpui-pre` =0.3.8)。名字取自 `reference/Ely-GPUI-Components/src`。gpui 用法规则见该仓库 `AGENTS.md`。`tests/scripts/agents_md.py` 核对下表每个名字都是组件库公开项。 | 需要 | 用 | | --- | --- | diff --git a/apps/ely-mark/src/view/tests.rs b/apps/ely-mark/src/view/tests.rs index 8c446c8..be87308 100644 --- a/apps/ely-mark/src/view/tests.rs +++ b/apps/ely-mark/src/view/tests.rs @@ -221,3 +221,24 @@ fn an_edit_keeps_the_rest_of_the_file_byte_for_byte(cx: &mut TestAppContext) { }); assert_eq!(written, b"\xEF\xBB\xBFx# A\r\n\r\nB\r\n"); } + +#[gpui::test] +fn a_web_link_opens_outside(cx: &mut TestAppContext) { + let (view, cx) = open("x\n", cx); + view.update(cx, |view, cx| view.follow("https://ely.dev", cx)); + assert_eq!(cx.opened_url().as_deref(), Some("https://ely.dev")); +} + +#[gpui::test] +fn a_file_link_is_refused_and_said(cx: &mut TestAppContext) { + let (view, cx) = open("x\n", cx); + let said = std::rc::Rc::new(std::cell::Cell::new(false)); + let heard = said.clone(); + cx.update(|_, cx| { + cx.subscribe(&view, move |_, _: &super::Failed, _| heard.set(true)) + .detach() + }); + view.update(cx, |view, cx| view.follow("file:///etc/hosts", cx)); + cx.run_until_parked(); + assert!(said.get() && cx.opened_url().is_none()); +} diff --git a/scripts/fetch-references.sh b/scripts/fetch-references.sh index 05ee856..b1c7513 100755 --- a/scripts/fetch-references.sh +++ b/scripts/fetch-references.sh @@ -36,7 +36,7 @@ fetch() { # name url rev [sparse paths...] echo "fetch $name $rev" } -fetch Ely-GPUI-Components https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components.git 639521e109b3e2e46ad7410046fe3feb0a627c85 +fetch Ely-GPUI-Components https://git.zacharyzhang.com/ZacharyZhang-NY/Ely-GPUI-Components.git bbb607106abcfd870e40874eb46d3ba698bfc0c5 fetch zed https://github.com/zed-industries/zed.git 1a28cff4b409169bac058bca40dfbfeb7621d19b fetch libreoffice-core https://github.com/LibreOffice/core.git 8221e31b3ac356a1623c672912a3d2b492f7e3d1 \ include/LibreOfficeKit libreofficekit desktop/source/lib desktop/inc \