component-fixtures

Creates themed UI component fixtures for screenshot testing in the VS Code component explorer.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Visual regression testing of isolated UI components requires rendering widgets outside the full workbench, which breaks CSS selectors, service dependencies, and theming. This Skill guides you through building fixture files that render components correctly in the component explorer for screenshot-based testing. ## Core Features & Use Cases - Fixture Authoring Patterns: Provides the standard defineThemedFixtureGroup and defineComponentFixture structure with automatic Dark/Light theme variants and shadow DOM isolation. - Service and CSS Guidance: Covers registering editor services via createEditorServices, mocking services with mock<T>(), and recreating ancestor DOM structure so production CSS selectors match. - Component Refactoring Advice: Explains how to adapt existing components for fixturability, including dependency injection, shallow CSS selectors, disabling auto-focus, and exposing domNode. - Use Case: You built a new chat widget and need screenshot tests. Use this Skill to write a .fixture.ts file with Empty, Loading, and Completed variants, then capture screenshots via the component explorer MCP tools. ## Quick Start Create a component fixture for my widget following the component-fixtures skill so I can screenshot it in 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?▼

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 inside the provided container.

How do I screenshot a component fixture?▼

Start the Component Explorer Server task, then use the mcp_component-exp_list_fixtures tool to find fixture URLs and mcp_component-exp_screenshot to capture images. The Vite 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 CSS rules scoped to deep ancestor selectors like .workbench .sidebar .my-widget will not match. Recreate the expected ancestor DOM structure in the fixture, or refactor the component's CSS to use self-contained class selectors.

How do I mock services in a component fixture?▼

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

Why do my fixture screenshots flicker or show 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 from the start and avoid moving widgets between parents.