Skip to content

Commit 56a634e

Browse files
Shrinks99emma-sgSuaYoo
committed
ui: Public Collections UI Nitpicks (#2287)
- Removes share link from the dialogue footer - Removes stickied collection navigation, replaces with improved viewport-based scaling! - Adds a max-width for the collection description in the logged in view. - Moves the markdown editor buttons to below the editor - Controls are now In-line with how we handle dialogue options elsewhere, fixes a minor responsive design issue. - Minor copy changes --------- Co-authored-by: emma <[email protected]> Co-authored-by: sua yoo <[email protected]>
1 parent d8655d3 commit 56a634e

File tree

10 files changed

+190
-116
lines changed

10 files changed

+190
-116
lines changed

frontend/src/components/ui/markdown-editor.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ export class MarkdownEditor extends BtrixElement {
2727
--ink-block-padding: var(--sl-input-spacing-small);
2828
}
2929
30+
.ink-mde-textarea {
31+
flex-grow: 1;
32+
}
33+
34+
.ink-mde {
35+
height: 100%;
36+
}
37+
3038
.ink-mde {
3139
border: solid var(--sl-input-border-width) var(--sl-input-border-color);
3240
}
@@ -56,7 +64,8 @@ export class MarkdownEditor extends BtrixElement {
5664
}
5765
5866
.cm-line:only-child {
59-
min-height: 8em;
67+
height: 100%;
68+
min-height: 20em;
6069
}
6170
`;
6271

@@ -111,7 +120,11 @@ export class MarkdownEditor extends BtrixElement {
111120
render() {
112121
const isInvalid = this.maxlength && this.value.length > this.maxlength;
113122
return html`
114-
<fieldset ?data-invalid=${isInvalid} ?data-user-invalid=${isInvalid}>
123+
<fieldset
124+
?data-invalid=${isInvalid}
125+
?data-user-invalid=${isInvalid}
126+
class="flex h-full flex-col"
127+
>
115128
${this.label && html`<label class="form-label">${this.label}</label>`}
116129
<textarea id="editor-textarea"></textarea>
117130
<div class="helpText flex items-baseline justify-between">

frontend/src/features/collections/collection-replay-dialog.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ export class CollectionStartPageDialog extends BtrixElement {
2525
{ label: string; icon: NonNullable<SlIcon["name"]>; detail: string }
2626
> = {
2727
[HomeView.Pages]: {
28-
label: msg("Default"),
28+
label: msg("List of Pages"),
2929
icon: "list-ul",
3030
detail: `${msg("ReplayWeb.Page default view")}`,
3131
},
3232
[HomeView.URL]: {
33-
label: msg("Page"),
34-
icon: "file-earmark",
35-
detail: msg("Load a single page URL"),
33+
label: msg("Start Page"),
34+
icon: "file-earmark-richtext",
35+
detail: msg("Show a single URL snapshot"),
3636
},
3737
};
3838

@@ -188,7 +188,7 @@ export class CollectionStartPageDialog extends BtrixElement {
188188
<form @submit=${this.onSubmit}>
189189
<sl-select
190190
name="homeView"
191-
label=${msg("Select View")}
191+
label=${msg("Select Initial View")}
192192
value=${this.homeView}
193193
hoist
194194
?disabled=${!this.replayLoaded}

frontend/src/features/collections/collections-grid.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ export class CollectionsGrid extends BtrixElement {
6363
href=${this.navigate.isPublicPage
6464
? `/${RouteNamespace.PublicOrgs}/${this.slug}/collections/${collection.id}`
6565
: `/${RouteNamespace.PrivateOrgs}/${this.slug}/collections/view/${collection.id}`}
66-
class="group block h-full rounded-lg transition-all hover:scale-[102%]"
66+
class="group block h-full rounded-lg"
6767
@click=${this.navigate.link}
6868
>
6969
<div
70-
class="relative mb-4 rounded-lg shadow-md shadow-stone-600/10 ring-1 ring-stone-600/10 transition-shadow group-hover:shadow-sm"
70+
class="relative mb-4 rounded-lg shadow-md shadow-stone-600/10 ring-1 ring-stone-600/10 transition group-hover:shadow-stone-800/20 group-hover:ring-stone-800/20"
7171
>
7272
<btrix-collection-thumbnail
7373
src=${ifDefined(

frontend/src/features/collections/share-collection.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,7 @@ export class ShareCollection extends BtrixElement {
252252
253253
<sl-tab-panel name=${Tab.Link}>
254254
<div class="px-4 pb-4">
255-
${when(
256-
showSettings && this.collection,
257-
this.renderSettings,
258-
this.renderShareLink,
259-
)}
255+
${when(showSettings && this.collection, this.renderSettings)}
260256
</div>
261257
</sl-tab-panel>
262258
@@ -266,7 +262,6 @@ export class ShareCollection extends BtrixElement {
266262
</sl-tab-group>
267263
268264
<div slot="footer">
269-
${when(showSettings, this.renderShareLink)}
270265
<sl-button size="small" @click=${() => (this.showDialog = false)}>
271266
${msg("Done")}
272267
</sl-button>
@@ -287,6 +282,10 @@ export class ShareCollection extends BtrixElement {
287282
);
288283
}}
289284
></btrix-select-collection-access>
285+
${when(
286+
this.collection?.access != CollectionAccess.Private,
287+
this.renderShareLink,
288+
)}
290289
${when(
291290
this.org &&
292291
!this.org.enablePublicProfile &&
@@ -389,7 +388,7 @@ export class ShareCollection extends BtrixElement {
389388
>
390389
${isSelected
391390
? html`<sl-icon
392-
class="size-10 text-white drop-shadow-md"
391+
class="size-10 stroke-black/50 text-white drop-shadow-md [paint-order:stroke]"
393392
name="check-lg"
394393
></sl-icon>`
395394
: nothing}
@@ -410,7 +409,7 @@ export class ShareCollection extends BtrixElement {
410409

411410
private readonly renderShareLink = () => {
412411
return html`
413-
<div class="text-left">
412+
<div class="mt-4 text-left">
414413
<div class="form-label">${msg("Link to Share")}</div>
415414
<btrix-copy-field
416415
class="mb-3"

frontend/src/features/qa/page-list/helpers/iconFor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ export const iconFor = cached(
1515
case "severe":
1616
return html`<sl-icon
1717
name="exclamation-triangle-fill"
18-
class=${clsx("text-red-600", baseClasses, classList)}
18+
class=${clsx("text-red-500", baseClasses, classList)}
1919
></sl-icon>`;
2020
case "moderate":
2121
return html`<sl-icon
2222
name="dash-square-fill"
23-
class=${clsx("text-yellow-600", baseClasses, classList)}
23+
class=${clsx("text-yellow-500", baseClasses, classList)}
2424
></sl-icon>`;
2525
case "good":
2626
return html`<sl-icon
@@ -37,7 +37,7 @@ export const iconFor = cached(
3737
case "rejected":
3838
return html`<sl-icon
3939
name="hand-thumbs-down-fill"
40-
class=${clsx("text-red-600", baseClasses, classList)}
40+
class=${clsx("text-red-500", baseClasses, classList)}
4141
></sl-icon>`;
4242
case "commentOnly":
4343
// Comment icons are rendered separately

frontend/src/features/qa/page-list/helpers/severity.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ export const textColorFromSeverity = cached((severity: Severity) => {
2929
case "good":
3030
return tw`text-green-600`;
3131
case "moderate":
32-
return tw`text-yellow-600`;
32+
return tw`text-yellow-500`;
3333
case "severe":
34-
return tw`text-red-600`;
34+
return tw`text-red-500`;
3535
default:
3636
return "";
3737
}

frontend/src/layouts/page.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export function page(
3939
></btrix-document-title>
4040
4141
<div
42-
class="mx-auto box-border flex min-h-full w-full max-w-screen-desktop flex-1 flex-col gap-3 p-3 lg:px-10"
42+
class="mx-auto box-border flex min-h-full w-full max-w-screen-desktop flex-1 flex-col gap-3 p-3 lg:px-10 lg:pb-10"
4343
>
4444
${header.breadcrumbs ? html` ${pageNav(header.breadcrumbs)} ` : nothing}
4545
${pageHeader(header)}

frontend/src/pages/collections/collection.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ export class Collection extends BtrixElement {
206206
`;
207207
}
208208

209+
// TODO Consolidate with collection-detail.ts
209210
private renderAbout(collection: PublicCollection) {
210211
const dateRange = () => {
211212
if (!collection.dateEarliest || !collection.dateLatest) {
@@ -243,13 +244,13 @@ export class Collection extends BtrixElement {
243244
return html`
244245
<div class="flex flex-1 flex-col gap-10 lg:flex-row">
245246
<section
246-
class="flex-1 py-3 leading-relaxed lg:rounded-lg lg:border lg:p-6"
247+
class="w-full max-w-4xl py-3 leading-relaxed lg:rounded-lg lg:border lg:p-6"
247248
>
248249
<btrix-markdown-viewer
249250
value=${collection.description}
250251
></btrix-markdown-viewer>
251252
</section>
252-
<section class="min-w-60 lg:-mt-8">
253+
<section class="flex-1 lg:-mt-8">
253254
<btrix-section-heading>
254255
<h3>${msg("Metadata")}</h3>
255256
</btrix-section-heading>

0 commit comments

Comments
 (0)