component-fixtures

Create themed UI component fixtures for screenshot testing in VS Code.

10|1|Updated Jul 13, 2026
One-click install
npx skills add https://github.com/KevinHuangIsLearning/shortestpath-ide --skill component-fixtures-kevinhuangislearning
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: component-fixtures
Source: https://github.com/KevinHuangIsLearning/shortestpath-ide/tree/main/.github/skills/component-fixtures
Command: npx skills add https://github.com/KevinHuangIsLearning/shortestpath-ide --skill component-fixtures-kevinhuangislearning

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Visual regression testing of isolated UI components requires rendering them outside the full workbench, but VS Code widgets depend on services, themes, and ancestor CSS selectors that are hard to reproduce. This Skill guides you through building component fixtures that render real widgets in a shadow DOM for screenshot comparison. ## Core Features & Use Cases - Fixture authoring patterns: Define themed fixture groups with defineThemedFixtureGroup and defineComponentFixture that automatically produce Dark and Light variants. - Service and theme setup: Use createEditorServices to pre-register editor services, inject mocks via additionalServices, and select file icon themes per fixture. - Component adaptation guidance: Refactor components to be fixture-friendly by decoupling CSS from ancestor selectors, injecting services via DI, exposing domNode, and disabling auto-focus. - Use Case: You built a new chat input widget and need screenshot coverage. Create a .fixture.ts file, render the widget with mocked services, and capture Dark/Light screenshots through the component explorer MCP tools. ## Quick Start Create a component fixture for my new widget and capture Dark and Light screenshots of it using the component explorer tools.

Frequently Asked Questions about component-fixtures

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a component fixture for screenshot testing in VS Code?▼

Create a file ending in .fixture.ts under src/vs/workbench/test/browser/componentFixtures that exports a default defineThemedFixtureGroup. Each entry uses defineComponentFixture with a render function that builds the widget via createEditorServices and appends its domNode to the container.

How do I screenshot a component fixture with the component explorer?▼

Start the Component Explorer Server task, then use the mcp_component-exp_list_fixtures tool to see available fixtures and mcp_component-exp_screenshot to capture images. The dev server auto-discovers fixtures via the glob src/**/*.fixture.ts.

Why does my component's CSS not apply inside a fixture?▼

Fixtures render in shadow DOM, so production selectors scoped to deep ancestors like .workbench .sidebar .my-view will not match. Recreate the expected ancestor DOM structure in the fixture, or refactor the component CSS to use self-contained class selectors.

How do I mock services for a component fixture?▼

Pass an additionalServices callback to createEditorServices and register implementations with reg.define or pre-built instances with reg.defineInstance. Use the mock<T>() helper from base/test/common/mock.js to create stub service instances with overridden methods.

Why do fixture screenshots flicker or capture the wrong layout?▼

Flickering usually comes from reparenting widgets in the DOM after an async wait, which triggers layout recalculation and focus loss. Build the final DOM structure synchronously up front and let the component explorer wait for the returned promise or two animation frames.