Point gpui dependencies at gpui-kit and randomize screenshot-safe display data - #241
Merged
Merged
Conversation
上游 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 保持原样,因此加密存储、云同步与实际连接 仍然使用真实数据。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Two maintenance changes on top of
main.1. Follow the upstream rename to
gpui-kitlongbridge/gpui-componenthas been renamed tolongbridge/gpui-kit, and the fork tofeigeCode/gpui-kit. Everygpui-*dependency URL, the[patch]entry, the docs page and the two sync scripts now point at the new repository. While updating them, three matchers inscript/update_gpui_component_revision.pythat were still pinned to the old repository name were fixed: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=, butCargo.locksources have no.git, so the regex is now(?:\.git)?.revand have noversionraisedcannot update dependency line for gpui-component.versionis now optional.Side effect:
--update-navopnow actually rewrites the fiverevlines it was supposed to rewrite before.2. Make
screenshot-safeemit plausible, non-identifying dataThe 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:
example.comand the documentation ranges192.0.2.0/24,198.51.100.0/24and203.0.113.0/24, so a screenshot can never point at a real host.prod-mysql-07,stage-bastion-03,订单系统-12).Only display strings are replaced.
HomePage.connectionsandHomePage.workspacesare left untouched, so encrypted storage, cloud sync and the actual connections keep using real data.app1.pngis refreshed with a capture taken from a--features screenshot-safebuild.Screenshot
Captured with
cargo run -p main --features screenshot-safe:How to Test
Expected: the two
cargo checkruns pass,screenshot_safereports 6 passed, the revision script reports 4 passed, andcargo metadata --lockedresolves the new repository URL.Then run
cargo run -p main --features screenshot-safeand confirm the home cards and the connection tree only showexample.comor documentation-range hosts, with no repeated placeholder.Checklist
cargo runfor story tests related to the changes.Only macOS was exercised; nothing here is platform-specific.