Skip to content

Point gpui dependencies at gpui-kit and randomize screenshot-safe display data - #241

Merged
feigeCode merged 3 commits into
mainfrom
chore/gpui-kit-rename-and-screenshot-safe
Sep 20, 2026
Merged

feigeCode merged 3 commits into
mainfrom
chore/gpui-kit-rename-and-screenshot-safe

Conversation

@feigeCode

Copy link
Copy Markdown
Owner

Description

Two maintenance changes on top of main.

1. Follow the upstream rename to gpui-kit

longbridge/gpui-component has been renamed to longbridge/gpui-kit, and the fork to feigeCode/gpui-kit. Every gpui-* dependency URL, the [patch] entry, the docs page and the two sync scripts now point at the new repository. While updating them, three matchers in script/update_gpui_component_revision.py that were still pinned to the old repository name were fixed:

  • The guard required the literal gpui-component.git, which never appears in the manifest — the check was dead code. It now matches the repository slug.
  • lock_matches() only matched .git?rev=, but Cargo.lock sources have no .git, so the regex is now (?:\.git)?.
  • Dependency lines that pin only rev and have no version raised cannot update dependency line for gpui-component. version is now optional.

Side effect: --update-navop now actually rewrites the five rev lines it was supposed to rewrite before.

2. Make screenshot-safe emit plausible, non-identifying data

The feature used to render one fixed placeholder per connection type, so every card looked the same and a screenshot showed nothing realistic. Display data is now derived deterministically from the connection ID:

  • The same connection renders identically on every frame, while two different connections never share a name.
  • Hosts are limited to example.com and the documentation ranges 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24, so a screenshot can never point at a real host.
  • Names mix English and Chinese technical styles (prod-mysql-07, stage-bastion-03, 订单系统-12).

Only display strings are replaced. HomePage.connections and HomePage.workspaces are left untouched, so encrypted storage, cloud sync and the actual connections keep using real data. app1.png is refreshed with a capture taken from a --features screenshot-safe build.

Screenshot

Captured with cargo run -p main --features screenshot-safe:

after

How to Test

cargo check --tests                                  # default features
cargo check --tests --features screenshot-safe
cargo test -p main --features screenshot-safe --bin navop -- screenshot_safe
python3 script/tests/test_update_gpui_component_revision.py
cargo metadata --locked

Expected: the two cargo check runs pass, screenshot_safe reports 6 passed, the revision script reports 4 passed, and cargo metadata --locked resolves the new repository URL.

Then run cargo run -p main --features screenshot-safe and confirm the home cards and the connection tree only show example.com or documentation-range hosts, with no repeated placeholder.

Checklist

  • I have read the CONTRIBUTING document and followed the guidelines.
  • Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate.
  • Passed cargo run for story tests related to the changes.
  • Tested macOS, Windows and Linux platforms performance (if the change is platform-specific)

Only macOS was exercised; nothing here is platform-specific.

上游 longbridge/gpui-component 已改名为 longbridge/gpui-kit,fork 同步改名,
所有 gpui-* 依赖、patch、文档与同步脚本里的仓库地址一并更新。

同步脚本同时修掉了三处与旧仓库名绑定的匹配逻辑:守卫条件改为按 gpui-kit
仓库名匹配、Cargo.lock 校验的 rev 正则允许缺少 ".git"、依赖行允许只锁定
rev 而没有 version 字段。
screenshot-safe 之前对所有连接使用同一套固定占位符,截图里每张卡片都长一样。
现在改为按连接 ID 生成稳定的假数据:同一个连接每次渲染结果一致,不同连接之间
互不重名,地址只使用 example.com 与文档专用网段(192.0.2.x / 198.51.100.x /
203.0.113.x),不会指向真实主机。

新增 main/src/screenshot_safe.rs 统一提供脱敏数据,首页卡片、连接信息行以及
左侧连接树里的最近连接名、分组名都改为经过它。只替换展示字符串,
HomePage.connections / workspaces 保持原样,因此加密存储、云同步与实际连接
仍然使用真实数据。
@feigeCode
feigeCode merged commit e8ce41d into main Sep 20, 2026
8 checks passed
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