You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ad655c8
Browse filesBrowse the repository at this point in the historyBrowse files
This commit fixes TypeScript type errors in view components caused by
breaking changes in the @vscode-elements/react-elements library that
was updated as part of the Storybook 10 upgrade.
Problem:
The @vscode-elements/react-elements library changed its event handler
types and component prop APIs:
1. Event handlers now expect native DOM Event types (Event, InputEvent)
instead of React's synthetic event types (ChangeEvent<T>). The
library uses Lit web components which emit native events, not React
synthetic events.
2. VscodeButton's API changed from `appearance="primary"` to
`secondary={false}` for primary button styling.
3. Component refs must use specific element types (HTMLDivElement)
instead of generic HTMLElement | undefined.
TypeScript Errors Fixed:
- 11 event handler type mismatches where code used ChangeEvent or
InputEvent when Event was expected
- 1 VscodeButton prop error (appearance doesn't exist)
- 4 ref type errors (HTMLElement | undefined vs HTMLDivElement)
Changes by Category:
Event Handler Fixes:
- CodeFlowsDropdown.tsx: Changed ChangeEvent<HTMLSelectElement> to Event
- ModelTypeTextbox.tsx: Changed ChangeEvent<HTMLSelectElement> to InputEvent
- ModelAlertsSort.tsx: Changed InputEvent to Event
- RepositoriesFilter.tsx: Changed InputEvent to Event
- RepositoriesResultFormat.tsx: Changed InputEvent to Event
- RepositoriesSort.tsx: Changed InputEvent to Event
- RepoRow.tsx: Changed ChangeEvent<HTMLInputElement> to Event
All event handlers now cast e.target to the appropriate element type
(HTMLSelectElement, HTMLInputElement) to access properties like .value
and .checked.
Component API Fixes:
- VariantAnalysisActions.tsx: Changed `appearance="primary"` to
`secondary={false}` on VscodeButton
Ref Type Fixes:
- DataGrid.tsx: Changed DataGridRow and DataGridCell ref types from
`React.Ref<HTMLElement | undefined>` to `React.Ref<HTMLDivElement>`
- TextButton.tsx: Made $size prop optional in styled component
- MethodRow.tsx: Changed ModelableMethodRow and UnmodelableMethodRow
forwardRef types from `HTMLElement | undefined` to `HTMLDivElement`,
and changed useRef from `useRef<HTMLElement | undefined>(undefined)`
to `useRef<HTMLDivElement>(null)`
These changes align the codebase with the updated @vscode-elements
library APIs while maintaining the same runtime behavior.
Files modified:
- extensions/ql-vscode/src/view/common/CodePaths/CodeFlowsDropdown.tsx
- extensions/ql-vscode/src/view/common/DataGrid.tsx
- extensions/ql-vscode/src/view/common/TextButton.tsx
- extensions/ql-vscode/src/view/model-alerts/ModelAlertsSort.tsx
- extensions/ql-vscode/src/view/model-editor/MethodRow.tsx
- extensions/ql-vscode/src/view/model-editor/ModelTypeTextbox.tsx
- extensions/ql-vscode/src/view/variant-analysis/RepoRow.tsx
- extensions/ql-vscode/src/view/variant-analysis/RepositoriesFilter.tsx
- extensions/ql-vscode/src/view/variant-analysis/RepositoriesResultFormat.tsx
- extensions/ql-vscode/src/view/variant-analysis/RepositoriesSort.tsx
- extensions/ql-vscode/src/view/variant-analysis/VariantAnalysisActions.tsx
0 commit comments