Skip to content

Commit 8413a04

Browse files
committed
feat: Browser profile configuration UI rehaul (#2972)
This change is a rewrite of the browser profile detail page UI to support a consistent UX flow for creating and configuring profiles. Additional features: - Displays workflows associated with browser profile and enables filtering by failed due to not logged in - Enables changing crawler channel on profile - Easily add site to profile - Displays when and how a profile was last modified
1 parent 542121b commit 8413a04

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2511
-1802
lines changed

frontend/src/components/ui/code/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class Code extends TailwindElement {
7171
language: Language = Language.XML;
7272

7373
@property({ type: Boolean })
74-
wrap = true;
74+
noWrap = false;
7575

7676
async connectedCallback() {
7777
const languageFn = (await langaugeFiles[this.language]).default;
@@ -94,7 +94,7 @@ export class Code extends TailwindElement {
9494
part="base"
9595
class=${clsx(
9696
tw`font-monospace m-0 text-neutral-600`,
97-
this.wrap ? tw`whitespace-pre-wrap` : tw`whitespace-nowrap`,
97+
this.noWrap ? tw`whitespace-nowrap` : tw`whitespace-pre-wrap`,
9898
)}
9999
><code>${staticHtml`${unsafeStatic(htmlStr)}`}</code></pre>`;
100100
}

frontend/src/components/ui/desc-list.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export class DescList extends LitElement {
127127
vertical: !this.horizontal,
128128
horizontal: this.horizontal,
129129
})}
130+
part="base"
130131
>
131132
<slot></slot>
132133
</dl>`;

frontend/src/components/ui/dialog.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import {
1010
* <sl-dialog> with custom CSS
1111
*
1212
* Usage: see https://shoelace.style/components/dialog
13+
*
14+
* @attr label
15+
* @attr open
16+
* @attr noHeader
1317
*/
1418
@customElement("btrix-dialog")
1519
export class Dialog extends SlDialog {
@@ -27,8 +31,7 @@ export class Dialog extends SlDialog {
2731
}
2832
2933
.dialog__header {
30-
background-color: var(--sl-color-neutral-50);
31-
border-bottom: 1px solid var(--sl-color-neutral-100);
34+
border-bottom: 1px solid var(--sl-panel-border-color);
3235
}
3336
3437
.dialog__title {
@@ -50,7 +53,7 @@ export class Dialog extends SlDialog {
5053
.dialog__footer {
5154
padding-top: var(--sl-spacing-small);
5255
padding-bottom: var(--sl-spacing-small);
53-
border-top: 1px solid var(--sl-color-neutral-100);
56+
border-top: 1px solid var(--sl-panel-border-color);
5457
}
5558
`,
5659
];

frontend/src/components/ui/table/table-header-cell.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ export class TableHeaderCell extends TableCell {
1616
@property({ type: String, reflect: true, noAccessor: true })
1717
role = "columnheader";
1818

19+
@property({ type: String, reflect: true, noAccessor: true })
20+
scope?: "row" | "col";
21+
1922
@property({ type: String, reflect: true })
2023
ariaSort: SortValues = "none";
2124

frontend/src/components/ui/url-input.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ export class UrlInput extends SlInput {
4242
this.addEventListener("sl-change", this.onChange);
4343
}
4444

45+
setCustomValidity(message: string): void {
46+
super.setCustomValidity(message);
47+
if (!this.hideHelpText) this.helpText = message;
48+
}
49+
4550
disconnectedCallback(): void {
4651
super.disconnectedCallback();
4752

@@ -61,7 +66,6 @@ export class UrlInput extends SlInput {
6166

6267
if (value && !validURL(value)) {
6368
const text = msg("Please enter a valid URL.");
64-
if (!this.hideHelpText) this.helpText = text;
6569
this.setCustomValidity(text);
6670
} else if (
6771
value &&

frontend/src/controllers/localize.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ export class LocalizeController extends SlLocalizeController {
3737
year: "numeric",
3838
month: "long",
3939
day: "numeric",
40-
hour: "2-digit",
41-
minute: "2-digit",
40+
hour: "numeric",
41+
minute: "numeric",
4242
timeZoneName: "short",
43+
weekday: "long",
4344
})}
4445
hoist
4546
placement="bottom"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export type BtrixUserGuideShowEvent = CustomEvent<{ path?: string }>;
2+
3+
declare global {
4+
interface GlobalEventHandlersEventMap {
5+
"btrix-user-guide-show": BtrixUserGuideShowEvent;
6+
}
7+
}

frontend/src/features/archived-items/crawl-logs.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@ export class CrawlLogs extends BtrixElement {
222222
`,
223223
() =>
224224
this.filter
225-
? emptyMessage({ message: emptyMessageFor[this.filter] })
225+
? emptyMessage({
226+
classNames: tw`border-y`,
227+
message: emptyMessageFor[this.filter],
228+
})
226229
: nothing,
227230
)}
228231
`;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
import("./new-browser-profile-dialog");
2+
import("./profile-browser-dialog");
23
import("./profile-browser");
4+
import("./profile-metadata-dialog");
35
import("./select-browser-profile");
6+
import("./start-browser-dialog");

0 commit comments

Comments
 (0)