Kim PTAL, from implementation perspective I think this accomplishes the both cases we discussed, and also show cases them in the AI Assistance panel.
Can you review and then I can work on tests.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
if (Common.ParsedURL.schemeIs(href, 'chrome:')) {@bme...@chromium.org Should move this logic in the `UI.UIUtils.openInNewTab` helper function call together?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Hi Nik! Thanks for the link, I've added a few comments 😊
class="toolbar-feedback-link devtools-link"There's a `.devtools-link` css class in `inspectorCommon.css`, the one that is used here. I think we should have the same styles in the `devtools-link`, so either we can import `inspectorCommon.css` into the component or at least use the same styles applied to it. For ensuring consistency for now, I'd say let's do the first.
"../../../core/host:bundle",Do we need this import?
// Copyright 2025 The Chromium AuthorsCould you also add a LinkImpl.docs.ts file for documentation? You can build the doc using `scripts/component_docs` as target, it creates an `index.html` in the `gen` directory which you can serve. A README.md entry on this will come soon.
export class Link extends HTMLElement {Could you please add JSDoc for this component? 😊
if (Common.ParsedURL.schemeIs(href, 'chrome:')) {@bme...@chromium.org Should move this logic in the `UI.UIUtils.openInNewTab` helper function call together?
+1, yes please let's move this out of the UI, ideally we want to have the UI as lightweight as possible.
display: inline;As mentioned above, let's use the same styles as in `inspectorCommon.css`
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
I de
if (Common.ParsedURL.schemeIs(href, 'chrome:')) {Kim-Anh Tran@bme...@chromium.org Should move this logic in the `UI.UIUtils.openInNewTab` helper function call together?
+1, yes please let's move this out of the UI, ideally we want to have the UI as lightweight as possible.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
if (Common.ParsedURL.schemeIs(href, 'chrome:')) {Kim-Anh Tran@bme...@chromium.org Should move this logic in the `UI.UIUtils.openInNewTab` helper function call together?
Benedikt Meurer+1, yes please let's move this out of the UI, ideally we want to have the UI as lightweight as possible.
Yep
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Do we need this import?
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// Copyright 2025 The Chromium AuthorsCould you also add a LinkImpl.docs.ts file for documentation? You can build the doc using `scripts/component_docs` as target, it creates an `index.html` in the `gen` directory which you can serve. A README.md entry on this will come soon.
I did add it, but do I understand correctly that I need to add a new tab to the page to see the docs?
Could you please add JSDoc for this component? 😊
Done
As mentioned above, let's use the same styles as in `inspectorCommon.css`
Done
<!-- TODO: REMOVE once its show that is verified that this works -->I think we can remove this by now? 😊 I tried it out and it worked 😄
# found in the LICENSE file.super nit: please add a new line 😄
function linkExample(): HTMLElement {Can we use `lit-html` to render this instead? Since we want to switch to lit in general.
// Copyright 2025 The Chromium AuthorsNikolay VitkovCould you also add a LinkImpl.docs.ts file for documentation? You can build the doc using `scripts/component_docs` as target, it creates an `index.html` in the `gen` directory which you can serve. A README.md entry on this will come soon.
I did add it, but do I understand correctly that I need to add a new tab to the page to see the docs?
Awesome, thanks! No need, but there is the `front_end/BUILD.gn` file that need to be edited: see the [README.md](https://source.chromium.org/chromium/chromium/src/+/main:third_party/devtools-frontend/src/scripts/component_docs/README.md) for details
* @property href - The href to the place the link wants to navigateCan we add the `href` attribute too? See example with [Tooltip](https://source.chromium.org/chromium/chromium/src/+/main:third_party/devtools-frontend/src/front_end/ui/components/tooltips/Tooltip.ts). Even if wordy, it fully documents the API.
readonly #shadow = this.attachShadow({mode: 'open'});Instead of directly calling `#render` when setting the attribute, can we switch to `observedAttributes` and `attributeChangedCallback` instead? See example in [Cards](https://source.chromium.org/chromium/chromium/src/+/main:third_party/devtools-frontend/src/front_end/ui/components/cards/Card.ts?q=Card.ts%20devtools&ss=chromium%2Fchromium%2Fsrc)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
<!-- TODO: REMOVE once its show that is verified that this works -->I think we can remove this by now? 😊 I tried it out and it worked 😄
Done
super nit: please add a new line 😄
Done
Can we use `lit-html` to render this instead? Since we want to switch to lit in general.
Done
// Copyright 2025 The Chromium AuthorsNikolay VitkovCould you also add a LinkImpl.docs.ts file for documentation? You can build the doc using `scripts/component_docs` as target, it creates an `index.html` in the `gen` directory which you can serve. A README.md entry on this will come soon.
Kim-Anh TranI did add it, but do I understand correctly that I need to add a new tab to the page to see the docs?
Awesome, thanks! No need, but there is the `front_end/BUILD.gn` file that need to be edited: see the [README.md](https://source.chromium.org/chromium/chromium/src/+/main:third_party/devtools-frontend/src/scripts/component_docs/README.md) for details
Done
* @property href - The href to the place the link wants to navigateCan we add the `href` attribute too? See example with [Tooltip](https://source.chromium.org/chromium/chromium/src/+/main:third_party/devtools-frontend/src/front_end/ui/components/tooltips/Tooltip.ts). Even if wordy, it fully documents the API.
Done
Instead of directly calling `#render` when setting the attribute, can we switch to `observedAttributes` and `attributeChangedCallback` instead? See example in [Cards](https://source.chromium.org/chromium/chromium/src/+/main:third_party/devtools-frontend/src/front_end/ui/components/cards/Card.ts?q=Card.ts%20devtools&ss=chromium%2Fchromium%2Fsrc)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
import("../../../../scripts/build/ninja/component_doc.gni")The new line seems to be gone again. Is this the auto formatter?
* <devtools-link href=""></devtools-icon>This should be `</devtools-link>` 😄
static readonly observedAttributes = ['href', 'tabindex', 'jslogcontext'];I noticed that the casing is different here and when setting the attribute (not a big deal, as it will lowercase anyway as far as I understand, but we should keep it the same). Afterwards I was wondering about casing, and as far as I can see, attributes should be lower case and hyphened, I.e. `jslog-context` instead of `jslogcontext` [css/html guide](go/htmlcssstyle#Capitalization).
if (Common.ParsedURL.schemeIs(href, 'chrome:')) {I just noticed now, we don't need this code block anymore, do we? Or am I missing something? Can't it be entirely replaced by `UIHelpers.openInNewTab(href)`?
/* eslint-disable @devtools/no-a-tags-in-lit */nit: formatting
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
import("../../../../scripts/build/ninja/component_doc.gni")The new line seems to be gone again. Is this the auto formatter?
There were two missing lines, I only added one (the one after import).
* <devtools-link href=""></devtools-icon>Nikolay VitkovThis should be `</devtools-link>` 😄
Done
static readonly observedAttributes = ['href', 'tabindex', 'jslogcontext'];I noticed that the casing is different here and when setting the attribute (not a big deal, as it will lowercase anyway as far as I understand, but we should keep it the same). Afterwards I was wondering about casing, and as far as I can see, attributes should be lower case and hyphened, I.e. `jslog-context` instead of `jslogcontext` [css/html guide](go/htmlcssstyle#Capitalization).
In some places we already use `jslogcontext` do you think the hyphened vs not is a blocker here? I will fix the casing?
if (Common.ParsedURL.schemeIs(href, 'chrome:')) {I just noticed now, we don't need this code block anymore, do we? Or am I missing something? Can't it be entirely replaced by `UIHelpers.openInNewTab(href)`?
Yes!
/* eslint-disable @devtools/no-a-tags-in-lit */| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
There's a `.devtools-link` css class in `inspectorCommon.css`, the one that is used here. I think we should have the same styles in the `devtools-link`, so either we can import `inspectorCommon.css` into the component or at least use the same styles applied to it. For ensuring consistency for now, I'd say let's do the first.
Done
static readonly observedAttributes = ['href', 'tabindex', 'jslogcontext'];Nikolay VitkovI noticed that the casing is different here and when setting the attribute (not a big deal, as it will lowercase anyway as far as I understand, but we should keep it the same). Afterwards I was wondering about casing, and as far as I can see, attributes should be lower case and hyphened, I.e. `jslog-context` instead of `jslogcontext` [css/html guide](go/htmlcssstyle#Capitalization).
In some places we already use `jslogcontext` do you think the hyphened vs not is a blocker here? I will fix the casing?
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
jslogContext=${'freestyler.send-feedback'}Wront casing here.
| 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. |
jslogContext=${'freestyler.send-feedback'}Nikolay VitkovWront casing here.
Done
"../components/link:*",Nikolay VitkovTODO: Remove
Done
| 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. |
TODO: Add at least 1 test
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
"icons/Icon.docs.ts",You need to add the link docs here too for it to show up.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
"icons/Icon.docs.ts",You need to add the link docs here too for it to show up.
Very likely lost in the rebase.
// DO We need thisNikolay Vitkovnit: leftover comment
Done
| 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. |
| Commit-Queue | +2 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
13 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: front_end/ui/kit/BUILD.gn
Insertions: 1, Deletions: 0.
@@ -66,6 +66,7 @@
sources = [
"cards/Card.docs.ts",
"icons/Icon.docs.ts",
+ "link/Link.docs.ts",
]
deps = [
":bundle",
```
```
The name of the file: front_end/ui/kit/link/Link.ts
Insertions: 0, Deletions: 1.
@@ -41,7 +41,6 @@
this.#setDefaultTitle();
this.setAttribute('role', 'link');
- // DO We need this
this.setAttribute('target', '_blank');
this.addEventListener('click', this.#onClick);
```
[uikit] DevTools Link
Provides a new component to link to external links, as we can't use a tags from DevTools.
This is a replacement for the XLink and should be used moving forward.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |