mirror of
https://github.com/zed-industries/zed.git
synced 2026-07-10 00:13:29 +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 |
||
|---|---|---|
| .. | ||
| examples | ||
| src | ||
| Cargo.toml | ||
| LICENSE-GPL | ||