-
Notifications
You must be signed in to change notification settings - Fork 222
Fix TypeScript type errors in VSCode Elements event handlers and refs #4264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix TypeScript type errors in VSCode Elements event handlers and refs #4264
Conversation
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>
| })} | ||
| </Button> | ||
| <Button | ||
| appearance="primary" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Why was this line deleted? Is there another attribute that would be equivalent, such as <Button primary .../>?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The appearance attribute is not supported by VscodeButton in @vscode-elements v0.9.0. The button has primary appearance by default. To make it secondary, you add the secondary boolean attribute. Since this button doesn't have secondary, it already has the primary appearance. No changes needed - the fix in commit 42b1cb7 is correct.
|
@copilot There appear to be test failures and |
I've investigated the test results: View tests: All 39 test suites pass (364 tests passed, 2 skipped). ✅ Console errors: The warnings are pre-existing issues unrelated to my changes:
I verified these same console.error warnings exist on the base commit (ad70ecd) before my changes. None of the files with warnings were modified by my TypeScript type fixes. Vscode-integration tests: Fail due to network connectivity issues (ENOTFOUND update.code.visualstudio.com) in the test environment, not related to code changes. My changes only fixed TypeScript event handler and ref types, which don't affect the runtime behavior that causes these pre-existing HTML validation warnings. 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:
If you need me to access, download, or install something from one of these locations, you can either:
|
e01f33c
into
copilot/fix-github-actions-workflow-again
There was a problem hiding this 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 fixes TypeScript compilation errors caused by type mismatches between React synthetic events and native DOM events expected by @vscode-elements/react-elements@0.9.0.
Changes:
- Updated event handler types from React synthetic events (
ChangeEvent,InputEvent) to native DOMEventtype with appropriate type assertions - Corrected ref types from
React.Ref<HTMLElement | undefined>toReact.Ref<HTMLDivElement>to match the actual DOM element types - Fixed component prop issues: made
$sizeoptional in TextButton styled component and removed unsupportedappearanceprop from VscodeButton
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| CodeFlowsDropdown.tsx | Changed event handler from ChangeEvent<HTMLSelectElement> to Event with type assertion |
| ModelTypeTextbox.tsx | Changed event handler from ChangeEvent<HTMLSelectElement> to Event and corrected type assertion to HTMLInputElement |
| RepoRow.tsx | Changed event handler from ChangeEvent<HTMLInputElement> to Event with type assertion |
| ModelAlertsSort.tsx | Changed event handler from InputEvent to Event |
| RepositoriesFilter.tsx | Changed event handler from InputEvent to Event |
| RepositoriesResultFormat.tsx | Changed event handler from InputEvent to Event |
| RepositoriesSort.tsx | Changed event handler from InputEvent to Event |
| DataGrid.tsx | Updated ref types from React.Ref<HTMLElement | undefined> to React.Ref<HTMLDivElement> |
| MethodRow.tsx | Updated ref types to HTMLDivElement and changed useRef initialization to null |
| TextButton.tsx | Made $size prop optional in styled component to match component props |
| VariantAnalysisActions.tsx | Removed unsupported appearance prop from VscodeButton |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
TypeScript compilation was failing due to type mismatches between React synthetic events and native DOM events expected by
@vscode-elements/react-elements@0.9.0.Changes
Event handler type corrections (7 files):
ChangeEvent<T>andInputEventto nativeEventtype in:CodeFlowsDropdown.tsx,ModelTypeTextbox.tsx(also fixed HTMLSelectElement → HTMLInputElement cast)RepoRow.tsx,ModelAlertsSort.tsx,RepositoriesFilter.tsx,RepositoriesResultFormat.tsx,RepositoriesSort.tsxRef type corrections (3 files):
React.Ref<HTMLElement | undefined>→React.Ref<HTMLDivElement>in:DataGrid.tsx(DataGridRow and DataGridCell components)MethodRow.tsx(ModelableMethodRow, UnmodelableMethodRow, and parent useRef)Component prop fixes (2 files):
$sizeprop optional inTextButton.tsxstyled componentappearanceprop fromVscodeButtoninVariantAnalysisActions.tsxWarning
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:
https://api.github.com/repos/github/vscode-codeql/actions/runs/21145906696/jobs/usr/bin/curl curl -s -H Authorization: Bearer REDACTED tsc --noEmit(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.