Skip to content

Commit 12b6f87

Browse files
wolfibDevtools-frontend LUCI CQ
authored andcommitted
[Console Insights] Improve feedback button UX
- Show which button was clicked - Make it obvious once button has been clicked, that buttons can't be clicked anymore. Screencast: https://i.imgur.com/Jt31ljt.mp4 Fixed: 384874056 Change-Id: I9248702151e16bf2e25c9ef0fd86b8f294e395ad Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6097818 Commit-Queue: Alex Rudenko <[email protected]> Reviewed-by: Alex Rudenko <[email protected]> Auto-Submit: Wolfgang Beyer <[email protected]>
1 parent 72691fd commit 12b6f87

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

front_end/panels/explain/components/ConsoleInsight.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -788,10 +788,14 @@ export class ConsoleInsight extends HTMLElement {
788788
data-rating=${'true'}
789789
.data=${
790790
{
791-
variant: Buttons.Button.Variant.ICON,
791+
variant: Buttons.Button.Variant.ICON_TOGGLE,
792792
size: Buttons.Button.Size.SMALL,
793793
iconName: 'thumb-up',
794-
active: this.#selectedRating !== undefined && this.#selectedRating,
794+
toggledIconName: 'thumb-up',
795+
toggleOnClick: false,
796+
toggleType: Buttons.Button.ToggleType.PRIMARY,
797+
disabled: this.#selectedRating !== undefined,
798+
toggled: this.#selectedRating === true,
795799
title: i18nString(UIStrings.goodResponse),
796800
jslogContext: 'thumbs-up',
797801
} as Buttons.Button.ButtonData
@@ -802,10 +806,14 @@ export class ConsoleInsight extends HTMLElement {
802806
data-rating=${'false'}
803807
.data=${
804808
{
805-
variant: Buttons.Button.Variant.ICON,
809+
variant: Buttons.Button.Variant.ICON_TOGGLE,
806810
size: Buttons.Button.Size.SMALL,
807811
iconName: 'thumb-down',
808-
active: this.#selectedRating !== undefined && !this.#selectedRating,
812+
toggledIconName: 'thumb-down',
813+
toggleOnClick: false,
814+
toggleType: Buttons.Button.ToggleType.PRIMARY,
815+
disabled: this.#selectedRating !== undefined,
816+
toggled: this.#selectedRating === false,
809817
title: i18nString(UIStrings.badResponse),
810818
jslogContext: 'thumbs-down',
811819
} as Buttons.Button.ButtonData

0 commit comments

Comments
 (0)