Skip to content

Commit b4269e5

Browse files
committed
feat: Browser profiles list page UI consistency (#2971)
- Fixes browser profile list UI inconsistencies - Displays whether profile is in use in list - Adds "Mine" filter
1 parent e91dfa3 commit b4269e5

File tree

6 files changed

+381
-282
lines changed

6 files changed

+381
-282
lines changed

frontend/src/controllers/localize.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import { LocalizeController as SlLocalizeController } from "@shoelace-style/localize";
22
import { html } from "lit";
3+
import { ifDefined } from "lit/directives/if-defined.js";
34
import type { Options as PrettyMsOptions } from "pretty-ms";
45

56
import localize from "@/utils/localize";
67
import roundDuration from "@/utils/round-duration";
8+
import { tw } from "@/utils/tailwind";
79

810
export class LocalizeController extends SlLocalizeController {
911
/**
@@ -21,7 +23,7 @@ export class LocalizeController extends SlLocalizeController {
2123
*/
2224
readonly relativeDate = (
2325
dateStr: string,
24-
{ prefix }: { prefix?: string } = {},
26+
{ prefix, capitalize }: { prefix?: string; capitalize?: boolean } = {},
2527
) => {
2628
const date = new Date(dateStr);
2729
const diff = new Date().getTime() - date.getTime();
@@ -51,7 +53,11 @@ export class LocalizeController extends SlLocalizeController {
5153
day: "numeric",
5254
})
5355
: seconds > 60
54-
? html`<sl-relative-time sync date=${dateStr}></sl-relative-time>`
56+
? html`<sl-relative-time
57+
class=${ifDefined(capitalize ? tw`capitalize` : undefined)}
58+
sync
59+
date=${dateStr}
60+
></sl-relative-time>`
5561
: `<${this.relativeTime(-1, "minute", { style: "narrow" })}`}
5662
</span>
5763
</sl-tooltip>

frontend/src/features/archived-items/archived-item-list/archived-item-list-item.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export class ArchivedItemListItem extends BtrixElement {
107107
return html`
108108
<btrix-table-row
109109
class=${this.href || this.checkbox
110-
? "cursor-pointer select-none transition-colors hover:bg-neutral-50 focus-within:bg-neutral-50"
110+
? "cursor-pointer select-none transition-colors hover:bg-neutral-50 focus-within:bg-neutral-50 duration-fast"
111111
: ""}
112112
>
113113
${this.checkbox

frontend/src/features/crawls/crawl-list/crawl-list-item.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export class CrawlListItem extends BtrixElement {
104104
return html`
105105
<btrix-table-row
106106
class=${this.href
107-
? "cursor-pointer select-none transition-colors hover:bg-neutral-50 focus-within:bg-neutral-50"
107+
? "cursor-pointer select-none transition-colors hover:bg-neutral-50 focus-within:bg-neutral-50 duration-fast"
108108
: ""}
109109
@click=${async (e: MouseEvent) => {
110110
if (e.target === this.dropdownMenu) {

0 commit comments

Comments
 (0)