Skip to content

Commit de58691

Browse files
ergunshDevtools-frontend LUCI CQ
authored andcommitted
[PatchWidget] Add info tooltip near to "Apply to workspace" button
Bug: none Change-Id: I77cdb03e629da6e8747e5475ec1cffd54362bfdf Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6318339 Reviewed-by: Alex Rudenko <[email protected]> Commit-Queue: Ergün Erdoğmuş <[email protected]> Auto-Submit: Ergün Erdoğmuş <[email protected]>
1 parent 2b5ba52 commit de58691

File tree

3 files changed

+31
-8
lines changed

3 files changed

+31
-8
lines changed

front_end/panels/ai_assistance/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ devtools_module("ai_assistance") {
6262
"../../third_party/marked:bundle",
6363
"../../ui/components/markdown_view:bundle",
6464
"../../ui/components/spinners:bundle",
65+
"../../ui/components/tooltips:bundle",
6566
"../../ui/legacy:bundle",
6667
"../../ui/lit:bundle",
6768
]

front_end/panels/ai_assistance/PatchWidget.ts

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import '../../ui/legacy/legacy.js';
66
import '../../ui/components/markdown_view/markdown_view.js';
77
import '../../ui/components/spinners/spinners.js';
8+
import '../../ui/components/tooltips/tooltips.js';
89

910
import * as Host from '../../core/host/host.js';
1011
import * as i18n from '../../core/i18n/i18n.js';
@@ -45,7 +46,11 @@ const UIStringsNotTranslate = {
4546
/**
4647
*@description Label for the selected workspace/folder
4748
*/
48-
selectedFolder: 'Selected folder:'
49+
selectedFolder: 'Selected folder:',
50+
/**
51+
*@description Tooltip text for the info icon beside the "Apply to workspace" button
52+
*/
53+
applyToWorkspaceTooltip: 'Source code from the selected folder is sent to Google to generate code suggestions'
4954
} as const;
5055

5156
const lockedString = i18n.i18n.lockedString;
@@ -117,13 +122,17 @@ export class PatchWidget extends UI.Widget.Widget {
117122
${lockedString(UIStringsNotTranslate.change)}
118123
</devtools-button>
119124
</div>
120-
<devtools-button
121-
class='apply-to-workspace'
122-
@click=${input.onApplyToWorkspace}
123-
.jslogContext=${'stage-to-workspace'}
124-
.variant=${Buttons.Button.Variant.OUTLINED}>
125-
${lockedString(UIStringsNotTranslate.applyToWorkspace)}
126-
</devtools-button>
125+
<div class="apply-to-workspace-container">
126+
<devtools-button
127+
class="apply-to-workspace"
128+
@click=${input.onApplyToWorkspace}
129+
.jslogContext=${'stage-to-workspace'}
130+
.variant=${Buttons.Button.Variant.OUTLINED}>
131+
${lockedString(UIStringsNotTranslate.applyToWorkspace)}
132+
</devtools-button>
133+
<devtools-icon aria-describedby="info-tooltip" .name=${'info'}></devtools-icon>
134+
<devtools-tooltip id="info-tooltip">${lockedString(UIStringsNotTranslate.applyToWorkspaceTooltip)}</devtools-tooltip>
135+
</div>
127136
</div>` : nothing}
128137
${input.patchSuggestion ? html`<div class="patch-tmp-message">
129138
${input.patchSuggestion}

front_end/panels/ai_assistance/components/chatView.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,19 @@ main {
831831
flex-direction: row;
832832
}
833833

834+
.apply-to-workspace-container {
835+
display: flex;
836+
align-items: center;
837+
gap: var(--sys-size-3);
838+
839+
devtools-icon {
840+
/* var(--sys-size-8) is too small and var(--sys-size-9) is too big. */
841+
width: 18px;
842+
height: 18px;
843+
margin-left: var(--sys-size-2);
844+
}
845+
}
846+
834847
.patch-tmp-message {
835848
padding: var(--sys-size-4);
836849
}

0 commit comments

Comments
 (0)