Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 19, 2026

Completes the Storybook v10 migration by restoring MDX documentation pages that were temporarily disabled in the previous fix.

Changes

  • Install @storybook/addon-docs: Required for MDX support in Storybook v10 (no longer included by default)
  • Update .storybook/main.ts: Add addon-docs to addons array and re-enable *.mdx files in stories glob
  • Fix import path in Overview.mdx: Change from @storybook/blocks to @storybook/addon-docs/blocks (blocks are now exported as subpath)
// .storybook/main.ts
const config: StorybookConfig = {
-  stories: ["../src/**/*.stories.@(js|jsx|ts|tsx)"],
+  stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
   addons: [
+    "@storybook/addon-docs",
     "@storybook/addon-links",
     "@storybook/addon-a11y",
     "./vscode-theme-addon/preset.ts",
   ],
};

Screenshot

Overview documentation page now renders correctly with all content, images, and links:

Storybook Overview MDX

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • storybook.js.org
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/vscode-codeql/vscode-codeql/extensions/ql-vscode/node_modules/.bin/storybook build (dns block)
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/vscode-codeql/vscode-codeql/extensions/ql-vscode/node_modules/.bin/storybook dev -p 6006 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Fix the failing GitHub Actions workflow build
Analyze the workflow logs, identify the root cause of the failure, and implement a fix.
Job ID: 60801511444
Job URL: https://github.com/github/vscode-codeql/actions/runs/21141448950/job/60801511444


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…rily disabling MDX

- Convert require.resolve() to ES module syntax using import.meta.url
- Remove MDX files from stories config to fix build (MDX support needs proper addon configuration)

Co-authored-by: d10c <9970661+d10c@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions workflow build Fix Storybook build failure - convert preset.ts to ES modules Jan 19, 2026
Copilot AI requested a review from d10c January 19, 2026 15:41
- Install @storybook/addon-docs package
- Add addon-docs to the addons configuration in main.ts
- Update Overview.mdx to use @storybook/addon-docs/blocks import path
- Re-enable MDX files in stories configuration
- Verify build succeeds with MDX documentation included

Co-authored-by: d10c <9970661+d10c@users.noreply.github.com>
Copilot AI changed the title Fix Storybook build failure - convert preset.ts to ES modules Re-enable MDX documentation support in Storybook v10 Jan 19, 2026
Copilot AI and others added 5 commits January 19, 2026 16:07
Co-authored-by: d10c <9970661+d10c@users.noreply.github.com>
Co-authored-by: d10c <9970661+d10c@users.noreply.github.com>
Co-authored-by: d10c <9970661+d10c@users.noreply.github.com>
…low-lint-again

Fix TypeScript type errors in VSCode Elements event handlers and refs
@d10c d10c marked this pull request as ready for review January 20, 2026 16:26
@d10c d10c requested review from a team as code owners January 20, 2026 16:26
Copilot AI review requested due to automatic review settings January 20, 2026 16:26
@d10c d10c merged commit 849f2a4 into copilot/fix-github-actions-workflow-lint Jan 20, 2026
15 checks passed
@d10c d10c deleted the copilot/fix-github-actions-workflow-again branch January 20, 2026 16:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR completes the Storybook v10 migration by re-enabling MDX documentation support and fixing TypeScript compatibility issues introduced by the upgrade. The changes include adding the @storybook/addon-docs package, updating import paths, and addressing various TypeScript type errors in React components.

Changes:

  • Added @storybook/addon-docs dependency and re-enabled MDX files in Storybook configuration
  • Updated MDX import path from @storybook/blocks to @storybook/addon-docs/blocks for Storybook v10 compatibility
  • Fixed TypeScript type errors in event handlers and React refs across multiple components

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
extensions/ql-vscode/.storybook/main.ts Added @storybook/addon-docs to addons array to enable MDX support
extensions/ql-vscode/.storybook/vscode-theme-addon/preset.ts Converted from CommonJS require.resolve to ESM join(__dirname, ...)
extensions/ql-vscode/src/stories/Overview.mdx Updated import path to @storybook/addon-docs/blocks for Storybook v10
extensions/ql-vscode/package.json Added @storybook/addon-docs ^10.1.11 dependency
extensions/ql-vscode/package-lock.json Updated lock file with new addon-docs dependency and related packages
extensions/ql-vscode/src/view/variant-analysis/VariantAnalysisActions.tsx Removed appearance="primary" prop from export button
extensions/ql-vscode/src/view/variant-analysis/RepositoriesSort.tsx Changed event handler type from InputEvent to Event
extensions/ql-vscode/src/view/variant-analysis/RepositoriesResultFormat.tsx Changed event handler type from InputEvent to Event
extensions/ql-vscode/src/view/variant-analysis/RepositoriesFilter.tsx Changed event handler type from InputEvent to Event
extensions/ql-vscode/src/view/variant-analysis/RepoRow.tsx Changed event handler from ChangeEvent<HTMLInputElement> to Event
extensions/ql-vscode/src/view/model-editor/ModelTypeTextbox.tsx Changed event handler from ChangeEvent<HTMLSelectElement> to Event with HTMLInputElement cast
extensions/ql-vscode/src/view/model-editor/MethodRow.tsx Updated ref types from HTMLElement | undefined to HTMLDivElement with null
extensions/ql-vscode/src/view/model-alerts/ModelAlertsSort.tsx Changed event handler type from InputEvent to Event
extensions/ql-vscode/src/view/common/TextButton.tsx Made $size prop optional in styled component
extensions/ql-vscode/src/view/common/DataGrid.tsx Updated ref types from HTMLElement | undefined to HTMLDivElement
extensions/ql-vscode/src/view/common/CodePaths/CodeFlowsDropdown.tsx Changed event handler from ChangeEvent<HTMLSelectElement> to Event
Files not reviewed (1)
  • extensions/ql-vscode/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +35 to +36
const handleChange = useCallback((e: Event) => {
const target = e.target as HTMLInputElement;
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The event handler type has been changed from ChangeEvent<HTMLSelectElement> to Event with a cast to HTMLInputElement. This is inconsistent - VscodeTextfield is an input element, so the type should be ChangeEvent<HTMLInputElement> to be both accurate and consistent with other similar input handlers in the codebase (e.g., in RenamingInput.tsx).

Copilot uses AI. Check for mistakes.
filteredText: "Copy filtered repositories as a list",
})}
</Button>
<Button
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The appearance prop has been removed from this Button component. However, this removal changes the visual appearance of the "Export results" button. Consider whether this was intentional or if this button should maintain its primary appearance for consistency with the UI design. If this change is intentional due to a design update, it should be documented in the PR description.

Suggested change
<Button
<Button
appearance="primary"

Copilot uses AI. Check for mistakes.
export const RepositoriesSort = ({ value, onChange, className }: Props) => {
const handleInput = useCallback(
(e: InputEvent) => {
(e: Event) => {
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The event handler type has been changed from ChangeEvent<HTMLSelectElement> to Event, which is inconsistent with other similar components in the codebase (e.g., ModelInputDropdown.tsx, ModelKindDropdown.tsx, ModelOutputDropdown.tsx, ModelTypeDropdown.tsx). The more specific ChangeEvent<HTMLSelectElement> type provides better type safety and is the standard React type for select element change handlers. Consider using the same type as other similar components for consistency.

Copilot uses AI. Check for mistakes.
}: Props) => {
const handleInput = useCallback(
(e: InputEvent) => {
(e: Event) => {
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The event handler type has been changed from ChangeEvent<HTMLSelectElement> to Event, which is inconsistent with other similar components in the codebase. The more specific ChangeEvent<HTMLSelectElement> type provides better type safety and is the standard React type for select element change handlers. Consider using the same type as other similar components for consistency.

Copilot uses AI. Check for mistakes.
Comment on lines +231 to +242
(e: Event) => {
const target = e.target as HTMLInputElement;
// This is called on first render, but we don't really care about this value
if (e.target.checked === undefined) {
if (target.checked === undefined) {
return;
}

if (!repository.id) {
return;
}

onSelectedChange?.(repository.id, e.target.checked);
onSelectedChange?.(repository.id, target.checked);
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The event handler type has been changed from ChangeEvent<HTMLInputElement> to Event, which is inconsistent with other similar components in the codebase. The more specific ChangeEvent<HTMLInputElement> type provides better type safety and is the standard React type for checkbox change handlers. Additionally, the original code that imported ChangeEvent from React should be retained for this purpose.

Copilot uses AI. Check for mistakes.
Comment on lines +28 to +29
(e: Event) => {
const selectedOption = e.target as HTMLSelectElement;
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The event handler type has been changed from ChangeEvent<HTMLSelectElement> to Event, which is inconsistent with other similar components in the codebase. The more specific ChangeEvent<HTMLSelectElement> type provides better type safety and is the standard React type for select element change handlers. Consider using the same type as other similar components for consistency.

Copilot uses AI. Check for mistakes.
"@storybook/addon-a11y": "^10.1.11",
"@storybook/addon-docs": "^10.1.11",
"@storybook/addon-links": "^10.1.11",
"@storybook/components": "^8.6.14",
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @storybook/components package is at version 8.6.14, which is incompatible with Storybook v10.1.11. This package should be upgraded to a version that is compatible with Storybook v10 (e.g., ^10.1.11) to avoid potential runtime issues and compatibility problems.

Suggested change
"@storybook/components": "^8.6.14",
"@storybook/components": "^10.1.11",

Copilot uses AI. Check for mistakes.
export const RepositoriesFilter = ({ value, onChange, className }: Props) => {
const handleInput = useCallback(
(e: InputEvent) => {
(e: Event) => {
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The event handler type has been changed from ChangeEvent<HTMLSelectElement> to Event, which is inconsistent with other similar components in the codebase. The more specific ChangeEvent<HTMLSelectElement> type provides better type safety and is the standard React type for select element change handlers. Consider using the same type as other similar components for consistency.

Copilot uses AI. Check for mistakes.
export const ModelAlertsSort = ({ value, onChange, className }: Props) => {
const handleInput = useCallback(
(e: InputEvent) => {
(e: Event) => {
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The event handler type has been changed from ChangeEvent<HTMLSelectElement> to Event, which is inconsistent with other similar components in the codebase. The more specific ChangeEvent<HTMLSelectElement> type provides better type safety and is the standard React type for select element change handlers. Consider using the same type as other similar components for consistency.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants