From 7710be0f6e6d64dada453f6ba905a2564e1c32d2 Mon Sep 17 00:00:00 2001 From: Emma Segal-Grossman Date: Mon, 22 Apr 2024 20:02:07 -0400 Subject: [PATCH] More Frontend QA Polish Changes (#1709) Sort of relevant to #1696 - Improves a number of layout elements at smaller viewport sizes (specifically, letting button groups wrap onto next lines & ensure titles can't shrink to 0 width) - Adds "No page title" to places where there'd normally be a page title but isn't - Applies grid styling to page list area to fix overflow issues - When selecting or loading with a page selected that's farther down on the page list, the top of the page header could be scrolled away from, and there'd be no way to scroll back because the area had `overflow: hidden` applied - Adds default width and height to image comparer element, so that it displays correctly when images haven't loaded and doesn't change layout when images load --------- Co-authored-by: Henry Wilkinson --- frontend/src/features/qa/page-list/ui/page.ts | 5 +- .../org/archived-item-qa/archived-item-qa.ts | 38 ++++++++----- .../src/pages/org/archived-item-qa/styles.ts | 10 ++-- .../org/archived-item-qa/ui/resources.ts | 51 ++++++++++-------- .../org/archived-item-qa/ui/screenshots.ts | 53 +++++++++++-------- .../src/pages/org/archived-item-qa/ui/text.ts | 2 +- 6 files changed, 94 insertions(+), 65 deletions(-) diff --git a/frontend/src/features/qa/page-list/ui/page.ts b/frontend/src/features/qa/page-list/ui/page.ts index 7460419f..c5b48768 100644 --- a/frontend/src/features/qa/page-list/ui/page.ts +++ b/frontend/src/features/qa/page-list/ui/page.ts @@ -1,4 +1,4 @@ -import { localized } from "@lit/localize"; +import { localized, msg } from "@lit/localize"; import type { SlTooltip } from "@shoelace-style/shoelace"; import clsx from "clsx"; import { html, type PropertyValues } from "lit"; @@ -174,7 +174,8 @@ export class QaPage extends TailwindElement {
- ${page.title} + ${page.title || + html`${msg("No page title")}`}
${page.url} diff --git a/frontend/src/pages/org/archived-item-qa/archived-item-qa.ts b/frontend/src/pages/org/archived-item-qa/archived-item-qa.ts index 2c2ad0d0..d9f44fe1 100644 --- a/frontend/src/pages/org/archived-item-qa/archived-item-qa.ts +++ b/frontend/src/pages/org/archived-item-qa/archived-item-qa.ts @@ -326,12 +326,14 @@ export class ArchivedItemQA extends TailwindElement { return html` ${this.renderHidden()} -
+
-

+

${itemName}

${when( @@ -351,7 +353,7 @@ export class ArchivedItemQA extends TailwindElement { `, )}
-
+

- ${this.page ? this.page.title || msg("no page title") : nothing} + ${this.page?.title || + html`${msg("No page title")}`}

-
+
${msg("Previous Page")} @@ -403,6 +409,7 @@ export class ArchivedItemQA extends TailwindElement { "Approvals are temporarily disabled during analysis runs.", )} ?disabled=${!disableReview} + class="order-3 mx-auto flex w-full justify-center @lg:order-2 @lg:mx-0 @lg:w-auto" > ${msg("Next Page")} @@ -427,8 +435,10 @@ export class ArchivedItemQA extends TailwindElement {
-
-