summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilutin Kristofic <milutin@google.com>2024-04-17 09:26:38 +0200
committerPaladox none <thomasmulhall410@yahoo.com>2024-04-17 11:39:20 +0000
commit0bb63c6d688ebf66bd4e985198eb49d314abf72d (patch)
tree451d2a538be53049b2a6d92a86a870dacefc9024
parentc2a195022f0224deb96f7c7c7f64e4e7e79ba887 (diff)
Prevent automatic expansion of attention section for large account list
For long account lists, avoid automatic expansion of the attention section as it can obscure the reply dialog. Google-Bug-Id: b/334736859 Release-Notes: skip Change-Id: Ica631b4e8807c4822c78580b6c70493b79bf01ab (cherry picked from commit 6b78a5910a0425da9980a5e305c39d46a560b3bb)
-rw-r--r--polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.ts13
1 files changed, 8 insertions, 5 deletions
diff --git a/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.ts b/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.ts
index 0bf49db467..720403540a 100644
--- a/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.ts
+++ b/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.ts
@@ -787,8 +787,11 @@ export class GrReplyDialog extends LitElement {
name="change"
.value=${this.change}
></gr-endpoint-param>
- ${this.renderAttentionSummarySection()}
- ${this.renderAttentionDetailsSection()}
+ ${when(
+ this.attentionExpanded,
+ () => this.renderAttentionDetailsSection(),
+ () => this.renderAttentionSummarySection()
+ )}
<gr-endpoint-slot name="above-actions"></gr-endpoint-slot>
${this.renderActionsSection()}
</gr-endpoint-decorator>
@@ -989,7 +992,6 @@ export class GrReplyDialog extends LitElement {
}
private renderAttentionSummarySection() {
- if (this.attentionExpanded) return;
return html`
<section class="attention">
<div class="attentionSummary">
@@ -1056,7 +1058,6 @@ export class GrReplyDialog extends LitElement {
}
private renderAttentionDetailsSection() {
- if (!this.attentionExpanded) return;
return html`
<section class="attention-detail">
<div class="attentionDetailsTitle">
@@ -1722,8 +1723,10 @@ export class GrReplyDialog extends LitElement {
),
]);
// Possibly expand if need be, never collapse as this is jarring to the user.
+ // For long account lists (10 or more), avoid automatic expansion.
this.attentionExpanded =
- this.attentionExpanded || this.computeShowAttentionTip(1);
+ this.attentionExpanded ||
+ (allAccountIds.length < 10 && this.computeShowAttentionTip(1));
}
computeShowAttentionTip(minimum: number) {