Frontend QA Polish Changes (#1703)
Fixes #1696 - Inverts the toggle button state for screenshot comparison, is now untoggled by default - Changes the Resources tab to a puzzle piece - Parity with the metaphor used in ReplayWeb.page. Would like to leave databases to represent actual databases... Which given the app could very well make their way in here! - Fixes the dashed boarder radius being applied to the text comparison tab - Sets the data table header row to `position: sticky;` so it's always visible if the table scrolls! - This applies to all data tables, tested the one in QA review, the overview page, and the org settings members list - Casing changes for parity with other dropdown sorting controls Co-authored-by: Emma Segal-Grossman <hi@emma.cafe>
This commit is contained in:
		
							parent
							
								
									ecaa851688
								
							
						
					
					
						commit
						a60f56b87a
					
				| @ -61,10 +61,12 @@ export class DataTable extends TailwindElement { | |||||||
|     }`;
 |     }`;
 | ||||||
|     return html` |     return html` | ||||||
|       <btrix-table |       <btrix-table | ||||||
|         class="overflow-auto rounded border" |         class="relative h-full w-full rounded border" | ||||||
|         style=${gridAutoColumnsStyle} |         style=${gridAutoColumnsStyle} | ||||||
|       > |       > | ||||||
|         <btrix-table-head class="rounded-t border-b bg-neutral-50"> |         <btrix-table-head | ||||||
|  |           class="sticky top-0 z-10 rounded-t-[0.1875rem] border-b bg-neutral-50" | ||||||
|  |         > | ||||||
|           ${this.columns.map( |           ${this.columns.map( | ||||||
|             (content, i) => html` |             (content, i) => html` | ||||||
|               <btrix-table-header-cell class=${i > 0 ? "border-l" : ""}> |               <btrix-table-header-cell class=${i > 0 ? "border-l" : ""}> | ||||||
| @ -73,7 +75,7 @@ export class DataTable extends TailwindElement { | |||||||
|             `,
 |             `,
 | ||||||
|           )} |           )} | ||||||
|         </btrix-table-head> |         </btrix-table-head> | ||||||
|         <btrix-table-body> |         <btrix-table-body class="overflow-auto"> | ||||||
|           ${this.rows.map( |           ${this.rows.map( | ||||||
|             (cells, i) => html` |             (cells, i) => html` | ||||||
|               <btrix-table-row class=${i > 0 ? "border-t" : ""}> |               <btrix-table-row class=${i > 0 ? "border-t" : ""}> | ||||||
|  | |||||||
| @ -244,14 +244,14 @@ export class PageList extends TailwindElement { | |||||||
|           }} |           }} | ||||||
|         > |         > | ||||||
|           <sl-option value="screenshotMatch" |           <sl-option value="screenshotMatch" | ||||||
|             >${msg("Worst screenshot match")}</sl-option |             >${msg("Worst Screenshot Match")}</sl-option | ||||||
|           > |           > | ||||||
|           <sl-option value="textMatch" |           <sl-option value="textMatch" | ||||||
|             >${msg("Worst extracted text match")}</sl-option |             >${msg("Worst Extracted Text Match")}</sl-option | ||||||
|           > |           > | ||||||
|           <sl-option value="comments">${msg("Most comments")}</sl-option> |           <sl-option value="comments">${msg("Most Comments")}</sl-option> | ||||||
|           <sl-option value="approved">${msg("Recently approved")}</sl-option> |           <sl-option value="approved">${msg("Recently Approved")}</sl-option> | ||||||
|           <sl-option value="notApproved">${msg("Not approved")}</sl-option> |           <sl-option value="notApproved">${msg("Not Approved")}</sl-option> | ||||||
|         </sl-select> |         </sl-select> | ||||||
|       </div> |       </div> | ||||||
|     `;
 |     `;
 | ||||||
| @ -310,7 +310,7 @@ export class PageList extends TailwindElement { | |||||||
|           <sl-option value="">${msg("Any")}</sl-option> |           <sl-option value="">${msg("Any")}</sl-option> | ||||||
|           <sl-option value="notReviewed">${msg("None")}</sl-option> |           <sl-option value="notReviewed">${msg("None")}</sl-option> | ||||||
|           <sl-option value="reviewed" |           <sl-option value="reviewed" | ||||||
|             >${msg("Approved, rejected, or commented")}</sl-option |             >${msg("Approved, Rejected, or Commented")}</sl-option | ||||||
|           > |           > | ||||||
|           <sl-option value="approved">${msg("Approved")}</sl-option> |           <sl-option value="approved">${msg("Approved")}</sl-option> | ||||||
|           <sl-option value="rejected">${msg("Rejected")}</sl-option> |           <sl-option value="rejected">${msg("Rejected")}</sl-option> | ||||||
|  | |||||||
| @ -484,7 +484,7 @@ export class ArchivedItemDetail extends TailwindElement { | |||||||
|               section: "qa", |               section: "qa", | ||||||
|               iconLibrary: "default", |               iconLibrary: "default", | ||||||
|               icon: "clipboard2-data-fill", |               icon: "clipboard2-data-fill", | ||||||
|               label: msg("QA"), |               label: msg("Quality Assurance"), | ||||||
|             })} |             })} | ||||||
|           `,
 |           `,
 | ||||||
|         )} |         )} | ||||||
|  | |||||||
| @ -592,11 +592,11 @@ export class ArchivedItemDetailQA extends TailwindElement { | |||||||
|           > |           > | ||||||
|             <sl-option value="title.1">${msg("Title")}</sl-option> |             <sl-option value="title.1">${msg("Title")}</sl-option> | ||||||
|             <sl-option value="url.1">${msg("URL")}</sl-option> |             <sl-option value="url.1">${msg("URL")}</sl-option> | ||||||
|             <sl-option value="notes.-1">${msg("Most comments")}</sl-option> |             <sl-option value="notes.-1">${msg("Most Comments")}</sl-option> | ||||||
|             <sl-option value="approved.-1" |             <sl-option value="approved.-1" | ||||||
|               >${msg("Recently approved")}</sl-option |               >${msg("Recently Approved")}</sl-option | ||||||
|             > |             > | ||||||
|             <sl-option value="approved.1">${msg("Not approved")}</sl-option> |             <sl-option value="approved.1">${msg("Not Approved")}</sl-option> | ||||||
|           </sl-select> |           </sl-select> | ||||||
|         </div> |         </div> | ||||||
|       </div> |       </div> | ||||||
|  | |||||||
| @ -377,7 +377,10 @@ export class ArchivedItemQA extends TailwindElement { | |||||||
|         <div |         <div | ||||||
|           class="grid--pageToolbar flex items-center justify-between overflow-hidden border-b py-2" |           class="grid--pageToolbar flex items-center justify-between overflow-hidden border-b py-2" | ||||||
|         > |         > | ||||||
|           <h2 class="mr-4 truncate text-base font-semibold text-neutral-700"> |           <h2 | ||||||
|  |             class="mr-4 truncate text-base font-semibold text-neutral-700" | ||||||
|  |             title="${this.page ? this.page.title : nothing}" | ||||||
|  |           > | ||||||
|             ${this.page ? this.page.title || msg("no page title") : nothing} |             ${this.page ? this.page.title || msg("no page title") : nothing} | ||||||
|           </h2> |           </h2> | ||||||
|           <div class="flex gap-4"> |           <div class="flex gap-4"> | ||||||
| @ -450,7 +453,7 @@ export class ArchivedItemQA extends TailwindElement { | |||||||
|               ?active=${this.tab === "resources"} |               ?active=${this.tab === "resources"} | ||||||
|               @click=${this.onTabNavClick} |               @click=${this.onTabNavClick} | ||||||
|             > |             > | ||||||
|               <sl-icon name="server"></sl-icon> |               <sl-icon name="puzzle-fill"></sl-icon> | ||||||
|               ${msg("Resources")} |               ${msg("Resources")} | ||||||
|             </btrix-navigation-button> |             </btrix-navigation-button> | ||||||
|             <btrix-navigation-button |             <btrix-navigation-button | ||||||
| @ -651,43 +654,45 @@ export class ArchivedItemQA extends TailwindElement { | |||||||
| 
 | 
 | ||||||
|   private renderPanelToolbar() { |   private renderPanelToolbar() { | ||||||
|     const buttons = html` |     const buttons = html` | ||||||
|       <div class="ml-1 flex"> |       ${choose(this.tab, [ | ||||||
|         ${choose(this.tab, [ |         // [
 | ||||||
|           [ |         //   "replay",
 | ||||||
|             "replay", |         //   () => html`
 | ||||||
|             () => html` |         //     <div class="flex">
 | ||||||
|               <!-- <sl-icon-button name="arrow-clockwise"></sl-icon-button> --> |         //        <sl-icon-button name="arrow-clockwise"></sl-icon-button>
 | ||||||
|             `,
 |         //     </div>
 | ||||||
|           ], |         //   `,
 | ||||||
|           [ |         // ],
 | ||||||
|             "screenshots", |         [ | ||||||
|             () => html` |           "screenshots", | ||||||
|  |           () => html` | ||||||
|  |             <div class="flex"> | ||||||
|               <sl-tooltip |               <sl-tooltip | ||||||
|                 content=${msg("Toggle view")} |                 content=${msg("Toggle screenshot wipe view")} | ||||||
|                 placement="bottom-start" |                 placement="bottom-start" | ||||||
|               > |               > | ||||||
|                 <btrix-button |                 <btrix-button | ||||||
|                   icon |                   icon | ||||||
|                   variant=${this.splitView ? "primary" : "neutral"} |                   variant=${!this.splitView ? "primary" : "neutral"} | ||||||
|                   @click="${() => (this.splitView = !this.splitView)}" |                   @click="${() => (this.splitView = !this.splitView)}" | ||||||
|                 > |                 > | ||||||
|                   <sl-icon name="vr" label=${msg("Split view")}></sl-icon> |                   <sl-icon name="vr" label=${msg("Split view")}></sl-icon> | ||||||
|                 </btrix-button> |                 </btrix-button> | ||||||
|               </sl-tooltip> |               </sl-tooltip> | ||||||
|             `,
 |             </div> | ||||||
|           ], |           `,
 | ||||||
|         ])} |         ], | ||||||
|       </div> |       ])} | ||||||
|     `;
 |     `;
 | ||||||
|     return html` |     return html` | ||||||
|       <div |       <div | ||||||
|         class="${this.tab === "replay" |         class="${this.tab === "replay" | ||||||
|           ? "rounded-t-lg" |           ? "rounded-t-lg" | ||||||
|           : "rounded-lg mb-3"} flex h-12 items-center border bg-neutral-50 text-base" |           : "rounded-lg mb-3"} flex h-12 items-center gap-2 border bg-neutral-50 p-2 text-base" | ||||||
|       > |       > | ||||||
|         ${buttons} |         ${buttons} | ||||||
|         <div |         <div | ||||||
|           class="mx-1.5 flex h-8 min-w-0 flex-1 items-center justify-between gap-2 overflow-hidden whitespace-nowrap rounded border bg-neutral-0 px-2 text-sm" |           class="flex h-8 min-w-0 flex-1 items-center justify-between gap-2 overflow-hidden whitespace-nowrap rounded border bg-neutral-0 px-2 text-sm" | ||||||
|         > |         > | ||||||
|           <div class="fade-out-r scrollbar-hidden flex-1 overflow-x-scroll"> |           <div class="fade-out-r scrollbar-hidden flex-1 overflow-x-scroll"> | ||||||
|             <span class="pr-2">${this.page?.url || "http://"}</span> |             <span class="pr-2">${this.page?.url || "http://"}</span> | ||||||
|  | |||||||
| @ -49,7 +49,7 @@ export const styles = css` | |||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   sl-image-comparer::part(divider) { |   sl-image-comparer::part(divider) { | ||||||
|     width: 1rem; |     --divider-width: 1rem; | ||||||
|     border-left: 1px solid var(--sl-panel-border-color); |     border-left: 1px solid var(--sl-panel-border-color); | ||||||
|     border-right: 1px solid var(--sl-panel-border-color); |     border-right: 1px solid var(--sl-panel-border-color); | ||||||
|     box-shadow: var(--sl-shadow-large); |     box-shadow: var(--sl-shadow-large); | ||||||
|  | |||||||
| @ -86,25 +86,24 @@ export function renderResources(crawlData: ReplayData, qaData: ReplayData) { | |||||||
| 
 | 
 | ||||||
|   return html` |   return html` | ||||||
|     <div class=${tw`flex h-full flex-col outline`}> |     <div class=${tw`flex h-full flex-col outline`}> | ||||||
|       <div class=${tw`flex-1 overflow-auto overscroll-contain pb-3`}> |       <div class=${tw`flex-1 overflow-auto overscroll-contain`}> | ||||||
|         ${crawlData && qaData |         ${crawlData && qaData | ||||||
|           ? crawlData.resources && qaData.resources |           ? crawlData.resources && qaData.resources | ||||||
|             ? renderDiff(crawlData.resources, qaData.resources) |             ? renderDiff(crawlData.resources, qaData.resources) | ||||||
|             : noData |             : noData | ||||||
|           : renderSpinner()} |           : renderSpinner()} | ||||||
|       </div> |       </div> | ||||||
|       <footer class=${tw`border-t pt-2 text-xs text-neutral-600`}> |       <footer class=${tw`pt-2 text-xs text-neutral-600`}> | ||||||
|         <p class=${tw`mb-2`}> |  | ||||||
|           ${msg('"Good" and "Bad" indicates the status code of the resource.')} |  | ||||||
|         </p> |  | ||||||
|         <dl> |         <dl> | ||||||
|           <div class=${tw`flex gap-1`}> |           <div class=${tw`flex gap-1`}> | ||||||
|             <dt class=${tw`font-semibold`}>${msg("Good:")}</dt> |             <dt class=${tw`font-semibold`}>${msg("Good:")}</dt> | ||||||
|             <dd>${msg("Status code between 200-399")}</dd> |             <dd>${msg("Success (2xx) and Redirection (3xx) status codes")}</dd> | ||||||
|           </div> |           </div> | ||||||
|           <div class=${tw`flex gap-1`}> |           <div class=${tw`flex gap-1`}> | ||||||
|             <dt class=${tw`font-semibold`}>${msg("Bad:")}</dt> |             <dt class=${tw`font-semibold`}>${msg("Bad:")}</dt> | ||||||
|             <dd>${msg("Status code between 400-599")}</dd> |             <dd> | ||||||
|  |               ${msg("Client error (4xx) and Server error (5xx) status codes")} | ||||||
|  |             </dd> | ||||||
|           </div> |           </div> | ||||||
|         </dl> |         </dl> | ||||||
|       </footer> |       </footer> | ||||||
|  | |||||||
| @ -25,7 +25,7 @@ function renderDiff( | |||||||
| 
 | 
 | ||||||
|       return html` |       return html` | ||||||
|         <div |         <div | ||||||
|           class=${tw`flex-1 overflow-hidden rounded-lg border-dashed p-4 first-of-type:border-r`} |           class=${tw`flex-1 overflow-hidden border-dashed p-4 first-of-type:border-r`} | ||||||
|           aria-labelledby="crawlTextHeading" |           aria-labelledby="crawlTextHeading" | ||||||
|         > |         > | ||||||
|           ${diff.map((part) => { |           ${diff.map((part) => { | ||||||
| @ -42,7 +42,7 @@ function renderDiff( | |||||||
|           })} |           })} | ||||||
|         </div> |         </div> | ||||||
|         <div |         <div | ||||||
|           class=${tw`flex-1 overflow-hidden rounded-lg border-dashed p-4 first-of-type:border-r`} |           class=${tw`flex-1 overflow-hidden border-dashed p-4 first-of-type:border-r`} | ||||||
|           aria-labelledby="qaTextHeading" |           aria-labelledby="qaTextHeading" | ||||||
|         > |         > | ||||||
|           ${diff.map((part) => { |           ${diff.map((part) => { | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user