Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions design/system/screens/screens.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@
color: var(--fl-color-warning-solid);
}

/* Dashboard (System): the term and its value on one line in a card of a side
column. The description list puts them side by side only from 30rem of its
own width. Unnecessary with a modifier that keeps a pair on one line. */
/* Dashboard (System), entry editor (Status, Info): the term and its value on
one line in a card of a side column. The description list puts them side by
side only from 30rem of its own width. The term keeps its width, and the
value takes the rest, at its end, and wraps when it is long. Unnecessary
with a modifier that keeps a pair on one line. */
.screen-facts > .fl-description-list__item {
grid-template-columns: minmax(0, 1fr) auto;
grid-template-columns: auto minmax(0, 1fr);
align-items: baseline;

& > dd {
text-align: end;
}
}

/* Frame (entry editor): the trail ends with the title of the entry, which
Expand Down
9 changes: 7 additions & 2 deletions gallery/Gallery.Client/wwwroot/gallery.css
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,15 @@ body.gallery {
color: var(--fl-color-warning-solid);
}

/* Dashboard (System): the term and its value on one line in a card of a side column. */
/* Dashboard (System), entry editor (Status, Info): the term and its value on one line in a card of a side column. The
term keeps its width, and the value takes the rest, at its end, and wraps when it is long. */
.gallery-screen-facts > .fl-description-list__item {
grid-template-columns: minmax(0, 1fr) auto;
grid-template-columns: auto minmax(0, 1fr);
align-items: baseline;

& > dd {
text-align: end;
}
}

/* Entry editor: the order of the blocks as the draft holds it, under the list. */
Expand Down
35 changes: 35 additions & 0 deletions tests/FluentCMS.Components.Browser/Screens/FactsTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using FluentCMS.Components.Browser.Harness;
using Microsoft.Playwright;

namespace FluentCMS.Components.Browser.Screens;

// The facts of a side card: a term and its value on one line. A long value must not take the place of its term.
public sealed class FactsTests(GalleryFixture gallery)
{
private const string Overlaps = """
list => [...list.querySelectorAll(':scope > .fl-description-list__item')].filter(item => {
const term = item.querySelector(':scope > dt'), value = item.querySelector(':scope > dd');
const range = document.createRange();
range.selectNodeContents(term);
const text = range.getBoundingClientRect(), box = value.getBoundingClientRect();
return text.right > box.left + 0.5 && text.left < box.right - 0.5 && text.bottom > box.top && text.top < box.bottom;
}).map(item => item.querySelector(':scope > dt').textContent)
""";

[Theory]
[ModeData(Check = PageCheck.Look, Pages = ["content-list/entry", "dashboard"])]
public async Task NoTermIsDrawnUnderItsValue(RenderMode mode, string path)
{
foreach (int width in new[] { 1280, 320 })
{
await using GalleryPage sample = await gallery.OpenAsync(mode, path, new() { Width = width });
// The dashboard has the System card; the editor has the Status and the Info card.
IReadOnlyList<ILocator> lists = await sample.Page.Locator("dl.gallery-screen-facts").AllAsync();
Assert.Equal(path == "dashboard" ? 1 : 2, lists.Count);
foreach (ILocator list in lists)
{
Assert.Empty(await list.EvaluateAsync<string[]>(Overlaps));
}
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.