mirror of
https://github.com/zed-industries/zed.git
synced 2026-08-24 00:16:18 +00:00
`cargo run -p component_preview --example component_preview` does not work. On current main it panics at startup: ``` thread 'main' panicked at crates/gpui/src/action.rs:296:13: Action with name `zed::Quit` already registered ``` With that panic fixed, the window opens but renders no text and no icons (see Showcase below).s ## Solution Root cause for the blank window: `component_preview` package resolves `gpui_platform` with just `"screen-capture"`. On macOS the missing `font-kit` feature makes `MacPlatform` fall back to `gpui::NoopTextSystem`, as mentiond also in README (or CONTRIBUTE) file. On Linux the missing `wayland`/`x11` features leave no windowing backend at all. list of changes: - Enable the same `gpui_platform` features as the `zed` binary. - Attach `Assets` and load the embedded fonts. - Initialize `env_logger` so platform warnings reach the terminal. - Fix three startup panics: move the example's `Quit` action to the `component_preview` namespace. ## Testing Tested on macOS/Linux, not tested on Windows. I use Parallel VMs. ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) ## Showcase Before: <img width="1312" height="945" alt="cp_pr1_before" src="https://github.com/user-attachments/assets/4611596f-6775-4863-bd4a-5f4d8c642e35" /> After: <img width="1312" height="945" alt="cp_pr1_after" src="https://github.com/user-attachments/assets/8f8082e6-c8cd-48f5-946a-032ce8186d30" /> --- Release Notes: - N/A
50 lines
1.1 KiB
TOML
50 lines
1.1 KiB
TOML
[package]
|
|
name = "component_preview"
|
|
version = "0.1.0"
|
|
edition.workspace = true
|
|
publish.workspace = true
|
|
license = "GPL-3.0-or-later"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[lib]
|
|
path = "src/component_preview.rs"
|
|
|
|
[features]
|
|
default = []
|
|
test-support = ["db/test-support"]
|
|
|
|
[dependencies]
|
|
anyhow.workspace = true
|
|
client.workspace = true
|
|
collections.workspace = true
|
|
component.workspace = true
|
|
db.workspace = true
|
|
fs.workspace = true
|
|
gpui.workspace = true
|
|
language.workspace = true
|
|
log.workspace = true
|
|
node_runtime.workspace = true
|
|
notifications.workspace = true
|
|
project.workspace = true
|
|
release_channel.workspace = true
|
|
reqwest_client.workspace = true
|
|
session.workspace = true
|
|
settings.workspace = true
|
|
theme.workspace = true
|
|
theme_settings.workspace = true
|
|
ui.workspace = true
|
|
ui_input.workspace = true
|
|
uuid.workspace = true
|
|
workspace.workspace = true
|
|
|
|
[dev-dependencies]
|
|
assets.workspace = true
|
|
editor.workspace = true
|
|
env_logger.workspace = true
|
|
gpui_platform = { workspace = true, features = ["screen-capture", "font-kit", "wayland", "x11"] }
|
|
|
|
[[example]]
|
|
name = "component_preview"
|
|
path = "examples/component_preview.rs"
|