๐ (lists): Keep trailing row meta off the badges
Changes
2 files changed, +28 -2
MODIFY
src/main/resources/META-INF/resources/shark.css
+4 -2
@@ -2335,7 +2335,6 @@
2335
2335
align-items: center;
2336
2336
gap: var(--s2);
2337
2337
min-width: 0;
2338
- flex: 1;
2339
2338
color: inherit;
2340
2339
}
2341
2340
@@ -2355,7 +2354,6 @@
2355
2354
gap: var(--s4);
2356
2355
flex: none;
2357
2356
font: 500 12.5px/1 var(--mono);
2358
- margin-left: var(--s4);
2359
2357
}
2360
2358
2361
2359
.asset-upload {
@@ -2371,6 +2369,7 @@
2371
2369
.frow {
2372
2370
display: flex;
2373
2371
align-items: center;
2372
+ gap: var(--s4);
2374
2373
padding: 12px 18px;
2375
2374
border-bottom: 1px solid var(--border-soft);
2376
2375
color: inherit;
@@ -2391,6 +2390,9 @@
2391
2390
align-items: center;
2392
2391
gap: 11px;
2393
2392
min-width: 0;
2393
+ /* takes the free space so trailing meta (timestamp, commit) sits at the right edge instead of
2394
+ butting against the last badge */
2395
+ flex: 1;
2394
2396
}
2395
2397
2396
2398
.frow .fname .g {
MODIFY
src/test/java/de/workaround/web/DesignSystemTest.java
+24 -0
@@ -14,6 +14,7 @@
14
14
import static io.restassured.RestAssured.given;
15
15
import static org.hamcrest.CoreMatchers.containsString;
16
16
import static org.hamcrest.CoreMatchers.not;
17
+import static org.junit.jupiter.api.Assertions.assertTrue;
17
18
18
19
@QuarkusTest
19
20
class DesignSystemTest
@@ -140,6 +141,29 @@
140
141
}
141
142
142
143
@Test
144
+ void listRowsSeparateTheirNameGroupFromTrailingMeta()
145
+ {
146
+ String css = given()
147
+ .when().get("/shark.css")
148
+ .then().statusCode(200)
149
+ .extract().body().asString();
150
+
151
+ // without a growing name group the trailing meta (a release's timestamp, a run's commit)
152
+ // butts straight up against the last badge instead of sitting at the right edge
153
+ assertTrue(rule(css, ".frow .fname {").contains("flex: 1"),
154
+ "the row's name group must take the free space: " + rule(css, ".frow .fname {"));
155
+ assertTrue(rule(css, ".frow {").contains("gap:"),
156
+ "the row needs a gap so its groups never touch: " + rule(css, ".frow {"));
157
+ }
158
+
159
+ private static String rule(String css, String selector)
160
+ {
161
+ int start = css.indexOf(selector);
162
+ assertTrue(start >= 0, selector + " missing from the stylesheet");
163
+ return css.substring(start, css.indexOf('}', start));
164
+ }
165
+
166
+ @Test
143
167
void fontsAreSelfHostedWithoutCdnRequests()
144
168
{
145
169
given().when().get("/")