| Code-Review | +1 |
lgtm % web test failures that need fixing
<label><input type="radio" name="profile-type"I can never remember if `<input>` is one of those where it's ok to leave out the closing tag.
Slight preference of putting it, also to use `<label for=..>` as a sibling instead of nested.
#getControlButtonDisabled(): boolean {
return !(this.#isEnabled && this.#recordButtonEnabled);
}
#getControlButtonTooltip(): string {
return this.#recordButtonEnabled ? '' : UI.UIUtils.anotherProfilerActiveLabel();
}
#getHeaderText(): string {
return this.#profileTypes.size > 1 ? i18nString(UIStrings.selectProfilingType) :These 3 I'd just inline directly into `performUpdate` if they don't have another call-site.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
With this change, the memory panel doesn't render for me anymore:
```
Widget.ts:162 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'widgetClass')
at Re.createWidget (Widget.ts:162:51)
at s.getOrCreateWidget (Widget.ts:495:22)
at Widget.ts:328:27
```
constructor(element?: HTMLElement) {
super(element);What caused the need for this change?
.widgetConfig=${widgetConfig(IsolateSelector)}There is a newer way for this now: `${widget(IsolateSelector)}`
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
With this change, the memory panel doesn't render for me anymore:
```
Widget.ts:162 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'widgetClass')
at Re.createWidget (Widget.ts:162:51)
at s.getOrCreateWidget (Widget.ts:495:22)
at Widget.ts:328:27
```
gosh i missed that
What caused the need for this change?
This became necessary when `ProfileLauncherView` started creating `IsolateSelector` via `<devtools-widget>` (`widgetConfig(IsolateSelector)`). In that path the widget constructor is called with the host element, so `IsolateSelector` must accept `element?: HTMLElement` and pass it to `super(element)`; otherwise it would attach to a fresh `<div>` instead of the `devtools-widget` host. I added an inline constructor comment to make this explicit.
I can never remember if `<input>` is one of those where it's ok to leave out the closing tag.
Slight preference of putting it, also to use `<label for=..>` as a sibling instead of nested.
switched the radio markup to sibling elements with `id`/`for` (`<input ... />` + `<label for=...>`), instead of nesting the input inside the label.
There is a newer way for this now: `${widget(IsolateSelector)}`
Done
#getControlButtonDisabled(): boolean {
return !(this.#isEnabled && this.#recordButtonEnabled);
}
#getControlButtonTooltip(): string {
return this.#recordButtonEnabled ? '' : UI.UIUtils.anotherProfilerActiveLabel();
}
#getHeaderText(): string {
return this.#profileTypes.size > 1 ? i18nString(UIStrings.selectProfilingType) :These 3 I'd just inline directly into `performUpdate` if they don't have another call-site.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
${widget(input.isolateSelectorFactory)}Ah, you also need a ref to it. The canonical way to do this is a bit verbose at the moment but looks like:
```
<devtools-widget
${widget(IsolateSelector)}
${widgetRef(IsolateSelector, e => {output.isolateSelector = e;})}
></devtools-widget>
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
Ah, you also need a ref to it. The canonical way to do this is a bit verbose at the moment but looks like:
```
<devtools-widget
${widget(IsolateSelector)}
${widgetRef(IsolateSelector, e => {output.isolateSelector = e;})}
></devtools-widget>
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Extract presenter/view pattern for ProfileLauncherView
Migrate ProfileLauncherView from imperative DOM construction to the
declarative presenter/view pattern.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |