Commit-Queue | +1 |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
this.#lcpPhasesToggled = false;
Maybe `lcpPhasesExpanded`?
.insight-closed {
what do you think about making the closed view a bit darker on hover? to give it more of a button look
something like
```
&.closed:hover {
background-color: \\something a bit darker\\;
}
```
.insight {
display: block;
width: auto;
height: auto;
margin: 10px 0;
border: 1px solid var(--sys-color-outline);
padding: 10px;
border-radius: 3px;
overflow: hidden;
background-color: var(--sys-color-base);
}
.insight-closed {
display: block;
width: auto;
height: auto;
margin: 10px 0;
padding: 10px;
border-radius: 3px;
overflow: hidden;
background-color: var(--sys-color-neutral-container);
}
Most of the css for `.insight` and `.insight-closed` is the same. We can use ampersand (&) selector to overwrite the few differences that apply to the `closed` element.
Something like this should work:
```suggestion
.insight {
display: block;
width: auto;
height: auto;
margin: 10px 0;
padding: 10px;
border-radius: 3px;
overflow: hidden;
border: 1px solid var(--sys-color-outline);
background-color: var(--sys-color-base);
&.closed {
background-color: var(--sys-color-neutral-container);
border: none;
}
}
```
And then on the `.closed` component it would be
`<div class="insight closed">`
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
LGTM with a few suggestions 😊
Thanks so much! :)
this.#lcpPhasesToggled = false;
Adriana IxbaMaybe `lcpPhasesExpanded`?
Done
what do you think about making the closed view a bit darker on hover? to give it more of a button look
something like
```
&.closed:hover {
background-color: \\something a bit darker\\;
}
```
yes, i like this! Done
.insight {
display: block;
width: auto;
height: auto;
margin: 10px 0;
border: 1px solid var(--sys-color-outline);
padding: 10px;
border-radius: 3px;
overflow: hidden;
background-color: var(--sys-color-base);
}
.insight-closed {
display: block;
width: auto;
height: auto;
margin: 10px 0;
padding: 10px;
border-radius: 3px;
overflow: hidden;
background-color: var(--sys-color-neutral-container);
}
Most of the css for `.insight` and `.insight-closed` is the same. We can use ampersand (&) selector to overwrite the few differences that apply to the `closed` element.
Something like this should work:```suggestion
.insight {
display: block;
width: auto;
height: auto;
margin: 10px 0;
padding: 10px;
border-radius: 3px;
overflow: hidden;
border: 1px solid var(--sys-color-outline);
background-color: var(--sys-color-base);&.closed {
background-color: var(--sys-color-neutral-container);
border: none;
}
}
```And then on the `.closed` component it would be
`<div class="insight closed">`
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
2 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: front_end/panels/timeline/components/SidebarInsight.ts
Insertions: 5, Deletions: 5.
@@ -9,7 +9,7 @@
export interface InsightDetails {
title: string;
- toggled: boolean;
+ expanded: boolean;
}
export class SidebarInsight extends HTMLElement {
@@ -17,11 +17,11 @@
readonly #shadow = this.attachShadow({mode: 'open'});
readonly #boundRender = this.#render.bind(this);
#insightTitle: string = '';
- #toggled: boolean = false;
+ #expanded: boolean = false;
set data(data: InsightDetails) {
this.#insightTitle = data.title;
- this.#toggled = data.toggled;
+ this.#expanded = data.expanded;
}
connectedCallback(): void {
@@ -31,9 +31,9 @@
#render(): void {
let output: LitHtml.TemplateResult;
- if (!this.#toggled) {
+ if (!this.#expanded) {
output = LitHtml.html`
- <div class="insight-closed">
+ <div class="insight closed">
<h3 class="insight-title">${this.#insightTitle}</h3>
</div>`;
} else {
```
```
The name of the file: front_end/panels/timeline/components/Sidebar.ts
Insertions: 6, Deletions: 6.
@@ -88,7 +88,7 @@
#activeTab: SidebarTabsName = SidebarTabsName.INSIGHTS;
selectedCategory: InsightsCategories = InsightsCategories.ALL;
#expanded: boolean = false;
- #lcpPhasesToggled: boolean = false;
+ #lcpPhasesExpanded: boolean = false;
#traceParsedData?: TraceEngine.Handlers.Types.TraceParseData|null;
#inpMetric: {
@@ -167,7 +167,7 @@
this.#insights = insights;
this.#phaseData = this.getLCPInsightData();
// Reset toggled insights.
- this.#lcpPhasesToggled = false;
+ this.#lcpPhasesExpanded = false;
void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);
}
@@ -288,7 +288,7 @@
}
#toggleLCPPhaseClick(): void {
- this.#lcpPhasesToggled = !this.#lcpPhasesToggled;
+ this.#lcpPhasesExpanded = !this.#lcpPhasesExpanded;
this.dispatchEvent(new ToggleSidebarInsights());
void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#renderBound);
}
@@ -323,12 +323,12 @@
const showLCPPhases = this.#phaseData ? this.#phaseData.length > 0 : false;
// clang-format off
- if (this.#lcpPhasesToggled) {
+ if (this.#lcpPhasesExpanded) {
return LitHtml.html`${
showLCPPhases ? LitHtml.html`
<${SidebarInsight.SidebarInsight.litTagName} .data=${{
title: lcpTitle,
- toggled: this.#lcpPhasesToggled,
+ expanded: this.#lcpPhasesExpanded,
} as SidebarInsight.InsightDetails}>
<div slot="insight-description" class="insight-description">
Each
@@ -350,7 +350,7 @@
return LitHtml.html`
<${SidebarInsight.SidebarInsight.litTagName} .data=${{
title: lcpTitle,
- toggled: this.#lcpPhasesToggled,
+ expanded: this.#lcpPhasesExpanded,
} as SidebarInsight.InsightDetails}>
</${SidebarInsight.SidebarInsight}>`;
```
```
The name of the file: front_end/panels/timeline/components/sidebarInsight.css
Insertions: 11, Deletions: 13.
@@ -9,22 +9,20 @@
width: auto;
height: auto;
margin: 10px 0;
+ padding: 10px;
+ border-radius: 3px;
+ overflow: hidden;
border: 1px solid var(--sys-color-outline);
- padding: 10px;
- border-radius: 3px;
- overflow: hidden;
background-color: var(--sys-color-base);
-}
-.insight-closed {
- display: block;
- width: auto;
- height: auto;
- margin: 10px 0;
- padding: 10px;
- border-radius: 3px;
- overflow: hidden;
- background-color: var(--sys-color-neutral-container);
+ &.closed {
+ background-color: var(--sys-color-neutral-container);
+ border: none;
+ }
+
+ &.closed:hover {
+ background-color: var(--sys-color-state-disabled-container);
+ }
}
.insight-title {
```
```
The name of the file: front_end/panels/timeline/components/SidebarInsight.test.ts
Insertions: 3, Deletions: 3.
@@ -14,7 +14,7 @@
it('renders insight title', async () => {
const component = new SidebarInsight();
- component.data = {title: 'LCP by Phase', toggled: true};
+ component.data = {title: 'LCP by Phase', expanded: true};
renderElementIntoDOM(component);
await coordinator.done();
@@ -27,7 +27,7 @@
it('renders only insight title when not toggled', async () => {
const component = new SidebarInsight();
- component.data = {title: 'LCP by Phase', toggled: false};
+ component.data = {title: 'LCP by Phase', expanded: false};
renderElementIntoDOM(component);
await coordinator.done();
@@ -44,7 +44,7 @@
it('renders title, description and content when toggled', async () => {
const component = new SidebarInsight();
- component.data = {title: 'LCP by Phase', toggled: true};
+ component.data = {title: 'LCP by Phase', expanded: true};
renderElementIntoDOM(component);
await coordinator.done();
```
[RPP] Make sidebar insight clickable to toggle.
When clicked, the insight will expand to show its contents.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |