Skip to content

feat: Zed preview panel via the visual extension API (blocked upstream on zed-industries/zed#53403) #34

Description

@onokonem

Follow-up from #30.

#30 shipped with the issue's documented fallback because zed_extension_api 0.7.0 has no WebView/panel API — visual extensions are still an open RFC: zed-industries/zed#53403 (verified against the crate source at implementation time).

Current state (fallback, working today): render/export task templates running the CLI (byte-identical to c4drill <file>), drill-through via the SVG's own xlink:href navigation, live error state from LSP diagnostics.

When the API lands

  1. Add a WebView panel rendering the SVG from c4drill/renderDiagram (the wire shape is already documented in internal/lspRenderDiagramParams/RenderDiagramResult — and the intended wiring is sketched in zed-extension/README.md).
  2. Debounced auto-refresh on document change (~200 ms), matching feat: VS Code extension with syntax highlighting, autocomplete, and syntax checking for TOML and C4D #27's webview and feat: JetBrains IDE plugin with syntax highlighting, autocomplete, and syntax checking for TOML and C4D #29's tool window.
  3. Intercept the SVG's internal drill-down links (relative .svg URLs encoding the target unit path via ComputeExploreURL) → re-issue c4drill/renderDiagram for that path; breadcrumbs; external http(s) → system browser.
  4. Parse/validate failures render CLI-identical messages instead of a stale diagram.

Acceptance

  • Preview panel parity with the VS Code extension's webview: auto-refresh, drill-through, breadcrumbs, controls (expanded set, legend), error states.
  • Update zed-extension/README.md to move the preview from "fallback" to first-class.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions