component-fixtures

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

1|Updated Aug 27, 2026
One-click install
npx skills add https://github.com/Niiihuel/openide --skill component-fixtures-niiihuel
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: component-fixtures
Source: https://github.com/Niiihuel/openide/tree/main/vscode/.github/skills/component-fixtures
Command: npx skills add https://github.com/Niiihuel/openide --skill component-fixtures-niiihuel

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building isolated, screenshot-testable fixtures for VS Code workbench UI components is tricky: components often depend on deep CSS ancestor selectors, global services, auto-focus behavior, and async rendering, all of which cause flaky or unrepresentative screenshots. This Skill guides you through creating fixtures that render the real component reliably in the component explorer. ## Core Features & Use Cases - Fixture authoring patterns: Covers the .fixture.ts file structure, defineThemedFixtureGroup and defineComponentFixture helpers, and automatic Dark/Light theme variants. - Service and DI setup: Shows how to use createEditorServices, register additional or mock services, and avoid hard-coded global dependencies. - Rendering stability guidance: Explains CSS scoping in shadow DOM, async rendering pitfalls like DOM reparenting flicker, and how to adapt components (options for auto-focus, exposed domNode, pre-filled lifecycle states). - Use Case: You built a new chat widget and need visual regression screenshots. Use this Skill to write a fixture with multiple variants (empty, loading, completed) and capture stable Dark/Light screenshots via the component explorer MCP tools. ## Quick Start Create a component fixture for my new widget and screenshot it in both dark and light themes using the component explorer.

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

How do I screenshot component fixtures 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 screenshots. The explorer waits two animation frames, or for your render promise to resolve.

Why does my fixture screenshot flicker or show the wrong layout?▼

Flickering usually comes from reparenting DOM nodes after async waits, which recalculates layout and breaks absolute positioning. Render the widget in-place with the correct DOM structure from the start instead of moving it between parents.

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

Use createEditorServices with an additionalServices callback to register implementations or instances, and build mocks with the mock<T>() helper from base/test/common/mock.js. Pre-registered services include IThemeService, IConfigurationService, and IStorageService.

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

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

Should I copy a component into the fixture to modify it for testing?▼

No. Always adapt the original component to be fixture-friendly, for example by injecting services, exposing a domNode, or adding a shouldAutoFocus option. Copying hides integration bugs and stops testing the real component lifecycle.