Skip to content

Fix/storybook typescript errors#25

Merged
marklearst merged 20 commits into
mainfrom
fix/storybook-typescript-errors
Feb 9, 2026
Merged

Fix/storybook typescript errors#25
marklearst merged 20 commits into
mainfrom
fix/storybook-typescript-errors

Conversation

@marklearst
Copy link
Copy Markdown
Owner

Description

Storybook Helpers fixes / updates

Checklist

  • Change increases quality
  • Change is validated by tests
  • Change is readable and easy to understand
  • Documentation is updated
  • Security impact has been considered
  • Changes validated in runtime

marklearst and others added 20 commits February 9, 2026 16:01
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI review requested due to automatic review settings February 9, 2026 21:07
@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hailstorm-design-sytstem Ready Ready Preview, Comment Feb 9, 2026 9:07pm

@marklearst marklearst merged commit bedc244 into main Feb 9, 2026
9 of 12 checks passed
@marklearst marklearst deleted the fix/storybook-typescript-errors branch February 9, 2026 21:08
Copy link
Copy Markdown

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 updates Storybook stories/helpers (and one component test) to resolve TypeScript typing issues by introducing explicit story args types and tightening Storybook control definitions.

Changes:

  • Refactors many *.stories.tsx files to use explicit Meta<...Args> / StoryObj<typeof meta> typings and updated argTypes.control shapes.
  • Updates MultiCombobox story helpers/stories to use shared MultiComboboxStoryArgs types and simplified args plumbing.
  • Adjusts TableVirtualized test typings to satisfy @tanstack/* type expectations.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/components/table-virtualized/table-virtualized.test.tsx Adds explicit react-table types/casts and updates virtualizer callback invocation to satisfy TS.
src/components/table-key-value-pair/table-key-value-pair.stories.tsx Introduces explicit story args typing and updates Storybook control definitions.
src/components/slot/slot.stories.tsx Introduces explicit story args typing and updates Storybook control definitions.
src/components/sidebar/sidebar.stories.tsx Introduces explicit story args typing and updates Storybook control definitions.
src/components/sidebar-container/sidebar-container.stories.tsx Introduces explicit story args typing and updates Storybook control definitions.
src/components/section/section.stories.tsx Introduces explicit story args typing and updates Storybook control definitions.
src/components/page/page.stories.tsx Introduces explicit story args typing and updates Storybook control definitions.
src/components/menu/menu-title/menu-title.stories.tsx Introduces explicit story args typing and updates Storybook control definitions.
src/components/menu/menu-separator/menu-separator.stories.tsx Introduces explicit story args typing and refactors render args usage.
src/components/menu/menu-info-item/menu-info-item.stories.tsx Introduces explicit story args typing and refactors render args usage.
src/components/form-field/textarea/textarea.stories.tsx Introduces explicit story args typing and updates Storybook control definitions.
src/components/form-field/text-input/text-input.stories.tsx Introduces explicit story args typing and updates Storybook control definitions.
src/components/form-field/search-input/search-input.stories.tsx Introduces explicit story args typing and updates Storybook control definitions.
src/components/form-field/radio-input/radio-input.stories.tsx Introduces explicit story args typing and updates controls (select control config adjusted).
src/components/form-field/radio-box/radio-box.stories.tsx Introduces explicit story args typing and updates controls (select control config adjusted).
src/components/form-field/multi-combobox/multi-combobox.story-helpers.tsx Tightens argTypes typing for shared MultiCombobox story args/helpers.
src/components/form-field/multi-combobox/multi-combobox.stories.tsx Switches to typed shared args/helpers and simplifies render arg handling.
src/components/form-field/multi-combobox/multi-combobox-tags.stories.tsx Switches to typed shared args/helpers and simplifies render arg handling.
src/components/form-field/multi-combobox/multi-combobox-custom-value.stories.tsx Switches to typed shared args/helpers and simplifies render arg handling.
src/components/form-field/multi-combobox/multi-combobox-badges.stories.tsx Switches to typed shared args/helpers and simplifies render arg handling.
src/components/featured-tag/featured-tag.stories.tsx Introduces explicit story args typing and updates Storybook control definitions.
src/components/divider-line/divider-line.stories.tsx Introduces explicit story args typing and refactors render args usage.
src/components/disclosure/disclosure.stories.tsx Introduces explicit story args typing and updates Storybook control definitions.
src/components/button-group/button-group.stories.tsx Introduces explicit story args typing and updates Storybook control definitions.

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

},
observeElementOffset: (_instance, callback) => {
callback(0)
;(callback as (offset: number, sync?: boolean) => void)(0, false)
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

The observeElementOffset callback is being invoked via a type assertion. If the intent is just to satisfy the expected callback signature, prefer calling it directly with the correct argument list instead of casting (this keeps the virtualizer types checked and avoids drifting from the actual library signature).

Suggested change
;(callback as (offset: number, sync?: boolean) => void)(0, false)
callback(0, false)

Copilot uses AI. Check for mistakes.
defaultValue: {
control: 'select',
options: ['value_1', 'value_2', 'value_3'],
control: { type: 'select', options: ['value_1', 'value_2', 'value_3'] },
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

For Storybook controls, options should be defined on the argType (same level as control), not nested inside the control object. As written, Storybook may ignore the options and the select control won’t be configured correctly.

Suggested change
control: { type: 'select', options: ['value_1', 'value_2', 'value_3'] },
control: { type: 'select' },
options: ['value_1', 'value_2', 'value_3'],

Copilot uses AI. Check for mistakes.
defaultValue: {
control: 'select',
options: ['value_1', 'value_2', 'value_3'],
control: { type: 'select', options: ['value_1', 'value_2', 'value_3'] },
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

For Storybook controls, options should be defined on the argType (same level as control), not nested inside the control object. Keeping the existing pattern used elsewhere (e.g. control: 'select' + options: [...]) avoids Storybook ignoring the options.

Suggested change
control: { type: 'select', options: ['value_1', 'value_2', 'value_3'] },
control: 'select',
options: ['value_1', 'value_2', 'value_3'],

Copilot uses AI. Check for mistakes.
<TableVirtualized<RowData>
data={data}
columnDefs={columnDefs}
columnDefs={columnDefs as ColumnDef<RowData>[]}
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

columnDefs is being force-cast to ColumnDef<RowData>[], which hides the underlying generic mismatch between createColumnHelper() column defs (typed with a concrete cell value type) and TableVirtualized's columnDefs prop. Prefer to fix the typing so the test can pass columnDefs without an assertion (e.g., by updating TableVirtualized to preserve the TableValue generic, or by typing columnDefs to match the component’s expected value type).

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