component-fixtures

Creates and updates component fixtures for screenshot testing of VS Code UI components.

Updated Aug 30, 2026
One-click install
npx skills add https://github.com/Tyrizx/Tyrizx --skill component-fixtures-tyrizx
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: component-fixtures
Source: https://github.com/Tyrizx/Tyrizx/tree/main/.github/skills/component-fixtures
Command: npx skills add https://github.com/Tyrizx/Tyrizx --skill component-fixtures-tyrizx

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building isolated, screenshot-testable fixtures for VS Code UI components requires knowledge of fixture file structure, theming, service mocking, CSS scoping, and async rendering pitfalls that are easy to get wrong. ## Core Features & Use Cases - Fixture Authoring Guidance: Covers the .fixture.ts file pattern, defineThemedFixtureGroup and defineComponentFixture helpers, and automatic Dark/Light theme variants. - Service Setup and Mocking: Explains createEditorServices, registering additional DI services, and creating mock service instances for isolated rendering. - Component Adaptation Advice: Shows how to refactor components to be fixture-friendly, including shallow CSS selectors, dependency injection, disabling auto-focus, and exposing domNode. - Use Case: When adding a new workbench widget, use this Skill to write a fixture with multiple variants (empty, loading, completed states) and capture stable screenshots via the component explorer MCP tools. ## Quick Start Create a component fixture for my new widget and capture screenshots of its dark and light themed variants.

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. Use defineComponentFixture with a render function, and the Vite dev server auto-discovers it via the glob src/**/*.fixture.ts.

How do I mock services for a VS Code component fixture?▼

Use createEditorServices with an additionalServices callback to register implementations or instances via reg.define and reg.defineInstance. For mocks, extend the mock<T>() helper from base/test/common/mock.js and override the methods your component calls.

Why does my fixture screenshot flicker or show unstable layout?▼

Flickering usually comes from reparenting DOM nodes after async waits, which triggers layout recalculation and focus loss. Render the widget in-place with the correct DOM structure from the start, and disable auto-focus via component options.

Why do my component styles not apply inside a fixture?▼

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

How do I capture screenshots of component fixtures?▼

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 them. defineThemedFixtureGroup automatically produces Dark and Light variants of each fixture.