Files
navop/docs/gpui-component-external.md
T
胡飞 7815ce5a28 perf(deps): gpui-component 升级到 resvg 0.46,去掉重复的 usvg/tiny-skia
component fork 的 Windows 原生菜单固定 resvg 0.45.1,gpui-pre 用 0.46.0,
每个下游二进制都链两份 usvg/tiny-skia。fork 侧 6df86ef8 把 resvg 提到 0.46.0,
navop 侧 rev 跟到 6df86ef8(含 rquickjs)。

同时清掉脚本/文档里改名前的 gpui-ce 标识:
- sync-gpui-component.sh 的 -p 包名(原值实跑报 did not match any packages)
- update_gpui_component_revision.py 的包名映射
- gpui-component-external.md 的旧仓库地址与 rev
- gpui-shell-extension-design.md / home-theme-sidebar-refinement.md 的旧包名与 rev

验证:Cargo.lock 里 resvg/usvg/tiny-skia/tiny-skia-path 各只剩 1 个版本;
cargo check -p main 通过;resvg 调用序列探针对 0.46.0 编译通过。
未跑 Windows 构建:唯一调用点是 native_menu/windows.rs(Windows 专用)。
已知遗留:update_gpui_component_revision.py 仍不能跑(依赖行需含
gpui-component.git + version =,SHELL_VERSION_FILES 锚点已不存在)。
2026-09-17 15:51:15 +08:00

3.7 KiB

External GPUI Component

Navop no longer embeds gpui-component, its macros, or its assets in this workspace. CI, release, and normal development use the fork pinned in the workspace manifest:

https://github.com/feigeCode/gpui-component.git
rev 6df86ef82b4b5f3b04723c0d1cf82ff57cdc7078

The checkout belongs to https://github.com/feigeCode/gpui-component and the Navop compatibility branch is navop-gpui-ce. It is based on the upstream gpui-component adaptation and pins GPUI to:

https://github.com/feigeCode/gpui-pre.git
tag fork-0.3.108

Ownership Boundary

  • gpui-component: generic controls, assets, theme compatibility, icons, dialog lifecycle, and small backward-compatible builder aliases.
  • crates/one_ui: Navop composite UI including EditTable, LargeTextEditor, ContentState, PanelHeader, StatusBar, IconButton, resize handles, and date/time editors.
  • crates/extension-runtime: language extension manifests, installed extension discovery, SHA-256 verification, and lazy WASM language loading.
  • feature crates: page-specific presentation and business interactions.

one_ui must not depend on one-core. Settings persistence and shortcut resolution are injected by main.

Updating

Use the synchronization script from the Navop repository:

# Verify the merge in a temporary worktree without changing either branch.
script/sync-gpui-component.sh \
  --component-dir /path/to/gpui-component \
  --no-fetch \
  --dry-run

# Merge, verify, push the compatibility branch, and update Navop revisions,
# package versions, shell compatibility constants, examples, docs, and lockfile.
script/sync-gpui-component.sh \
  --component-dir /path/to/gpui-component \
  --fetch-source git@github.com:feigeCode/gpui-component.git \
  --push \
  --update-navop

The script merges in a temporary worktree first and enables Git rerere for known conflicts. Unknown conflicts or failed verification stop without changing the compatibility branch or Navop files. It never guesses a semantic conflict.

To update only Navop after an already-pushed component commit:

python3 script/update_gpui_component_revision.py \
  --component-dir /path/to/gpui-component \
  --revision <commit>

The updater reads actual package versions from cargo metadata; do not edit the five dependency versions or GPUI_SHELL_VERSION independently.

For network fetches on this machine, Clash is available at http://127.0.0.1:7897.

Verification

cargo check -p main
cargo test -p main --no-run
cargo test -p one-ui
cargo test -p extension-runtime
cargo test -p extension-wasm
cargo test -p extension-plugin-adapter
cargo check -p terminal_view --all-targets

The retired declarative UI crate is intentionally absent. Plugin UI uses gpui-component-shell; Navop keeps only the generic shell embedding lifecycle and provider HostModules.

SQL Editor Extensions

SQL Editor remains a first-class capability. The component fork exposes generic, SQL-neutral Editor contracts for:

  • monotonic document revision tracking;
  • gutter markers, stable lane layout, hitboxes, and click events;
  • continuous multi-line range fills and frames;
  • non-document inline widgets;
  • completion request invalidation and explicit metadata refresh.

one_ui::ExtendedEditor owns generic signature-help lifecycle and presentation. db_view owns all SQL parsing, metadata, statement execution, marker state, INSERT hints, diagnostics, completion, hover, signature providers, and SQL menu actions. Keep this split when syncing upstream: add generic Editor hooks to the component layer, reusable presentation to one_ui, and SQL behavior to db_view. Do not reintroduce a separate Navop Input engine.