Migrate Change Method Signature webview off deprecated webview-ui-toolkit#4449
Open
wenytang-ms wants to merge 1 commit into
Open
Conversation
Contributor
Author
Contributor
Author
|
1.55 issue beforefix.mp4new webview afterfix.mp4 |
Contributor
Author
|
@datho7561 @jjohnstn please help review this PR, thanks! |
bb08893 to
e93e599
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Fixes #4417
This PR is the complete fix: it both resolves the editable-cell bug and migrates the dialog off the deprecated toolkit.
Background
On Change Method Signature, editing a parameter Type (or Name / Default, or an exception Type) showed nothing while typing, and on OK the typed text was appended to the original value instead of replacing it. Root cause: the cells set
contentEditabledirectly on the deprecated@vscode/webview-ui-toolkitvscode-data-grid-cell, whose shadow root is only<slot>— typed text became a bare text node on the host, outside the slot, so it never rendered and was read back viaouterText(concatenated).What this PR does
<input>while editing and read its.valueon commit (visible typing + correct replace semantics).--vscode-*theme variables, and removes the dependency.Scope
This change only touches the Change Method Signature refactoring dialog. It was the only webview in the extension that depended on @vscode/webview-ui-toolkit, so it is the only one affected by this migration. Other webviews (e.g. the dashboard) never used the toolkit and are left completely untouched.
Component mapping
VSCodeButton<button>+btn/btn-primary/btn-secondary/btn-iconVSCodeTextField<input type=text>VSCodeDropdown/VSCodeOption<select>/<option>VSCodeCheckbox<label>+<input type=checkbox>VSCodeTextArea<textarea>VSCodePanels/Tab/ViewactiveTabstate + conditional renderVSCodeDataGrid/Row/Cell<table>/<thead>/<tbody>/<tr>/<th>/<td>Notes
parameterRow-N,parameterButton-N,parameterType-N…) so hover-to-reveal-buttons and edit/confirm/cancel logic is unchanged.delegatecheckbox handling moved fromonClicktoonChange.setTextAreaCursorStyleshadow-DOM hack.style-src 'unsafe-inline'(only the toolkit needed it; CSS is now loaded via<link>and the codicon font is adata:URL covered byfont-src).@vscode/webview-ui-toolkitfrompackage.json+package-lock.json.Validation
tsc --noEmit— passeseslinton changed files — cleanchangeSignaturebundle — builds successfully; built bundle contains novscode-data-gridreferences