pandorga 2.3.17 → 2.3.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,15 +18,67 @@ def fail!(msg)
18
18
  true
19
19
  end
20
20
 
21
- # PLT-AC-88 — Projects island centered in desktop column
21
+ # PLT-AC-88 — Contents page from 1024px
22
+ unless HOME.include?("PLT-AC-88 contents")
23
+ failed = 1 if fail!("PLT-AC-88: home.css must document the contents page")
24
+ end
25
+ unless HOME.match?(/\.home-project-inventory-body\s*\{[^}]*display:\s*contents/)
26
+ failed = 1 if fail!("PLT-AC-88: the row body must participate in the line")
27
+ end
28
+ unless HOME.match?(/width:\s*11rem/)
29
+ failed = 1 if fail!("PLT-AC-88: the opened picture must be 11rem wide")
30
+ end
31
+ if HOME.match?(/--home-specimen-plate-height:\s*15\.3125rem/)
32
+ failed = 1 if fail!("PLT-AC-88: desktop must not keep the 15.3125rem specimen cap")
33
+ end
34
+ if HOME.match?(/\.home-project-inventory-title\s*\{[^}]*text-overflow:\s*ellipsis/)
35
+ failed = 1 if fail!("PLT-AC-88: inventory titles must not ellipsize")
36
+ end
37
+ unless HOME.match?(/\.home-project-inventory-title\s*\{[^}]*white-space:\s*normal/)
38
+ failed = 1 if fail!("PLT-AC-88: inventory titles must wrap")
39
+ end
40
+ unless HOME.match?(/\.home-project-inventory-title\s*\{[^}]*font-family:\s*var\(--font-body\)/)
41
+ failed = 1 if fail!("PLT-AC-88: inventory titles must use --font-body")
42
+ end
43
+ unless HOME.match?(/\.home-project-inventory-title\s*\{[^}]*font-weight:\s*var\(--weight-body\)/)
44
+ failed = 1 if fail!("PLT-AC-88: inventory titles must use --weight-body")
45
+ end
46
+ unless HOME.match?(/font-size:\s*clamp\(1\.45rem,\s*2\.2vw,\s*2\.05rem\)/)
47
+ failed = 1 if fail!("PLT-AC-88: names must use the contents size clamp")
48
+ end
49
+ if HOME.match?(/\.home-project-inventory-title\s*\{[^}]*font-family:\s*var\(--font-(?:title|label)\)/)
50
+ failed = 1 if fail!("PLT-AC-88: inventory titles must not use the serif title or label face")
51
+ end
52
+ unless HOME.match?(/\.home-project-specimen[^{]*\{[^}]*display:\s*none/)
53
+ failed = 1 if fail!("PLT-AC-88: the specimen card must be hidden")
54
+ end
22
55
  unless HOME.match?(/\.home-projects-bench[\s\S]{0,800}?margin-inline:\s*auto/)
23
- failed = 1 if fail!("PLT-AC-88: .home-projects-bench must use margin-inline: auto")
56
+ failed = 1 if fail!("PLT-AC-88: tablet island must keep margin-inline: auto")
57
+ end
58
+ unless SPEC.include?("Contents") && SPEC.include?("11rem")
59
+ failed = 1 if fail!("PLT-AC-88: spec must describe the contents page and the 11rem picture")
24
60
  end
25
- unless HOME.match?(/\.home-projects-bench[\s\S]{0,800}?width:\s*max-content/)
26
- failed = 1 if fail!("PLT-AC-88: .home-projects-bench must use width: max-content")
61
+ unless HOME.match?(/\.home-project-inventory-row\s*>\s*\.home-project-inventory-glyph[^{]*\{[^}]*grid-area:\s*icon/) ||
62
+ HOME.match?(/\.home-project-inventory-glyph[^{]*\{[^}]*grid-area:\s*icon/)
63
+ failed = 1 if fail!("PLT-AC-88: the project icon glyph must occupy the icon cell")
27
64
  end
28
- unless HOME.include?("PLT-AC-88") || SPEC.include?("PLT-AC-88")
29
- failed = 1 if fail!("PLT-AC-88: spec must name PLT-AC-88")
65
+ unless HOME.match?(/\.home-project-inventory-code[^{]*\{[^}]*display:\s*none/)
66
+ failed = 1 if fail!("PLT-AC-88: folio/meta code must be hidden on the contents page")
67
+ end
68
+ unless HOME.match?(/\.home-project-inventory-year[^{]*\{[^}]*display:\s*none/)
69
+ failed = 1 if fail!("PLT-AC-88: year must be hidden on collapsed contents rows")
70
+ end
71
+ unless HOME.match?(/\.home-project-inventory-tags[^{]*\{[^}]*display:\s*none/)
72
+ failed = 1 if fail!("PLT-AC-88: tags must be hidden on collapsed contents rows")
73
+ end
74
+ unless HOME.match?(/home-project-inventory-excerpt/)
75
+ failed = 1 if fail!("PLT-AC-88: home.css must style the presentation excerpt")
76
+ end
77
+ unless HOME.match?(/-webkit-line-clamp:\s*[2-6]/)
78
+ failed = 1 if fail!("PLT-AC-88: the excerpt must clamp to a few lines")
79
+ end
80
+ unless SPEC.include?("icon glyph") || SPEC.include?("project icon")
81
+ failed = 1 if fail!("PLT-AC-88: spec must describe the icon-plus-name collapsed row")
30
82
  end
31
83
 
32
84
  # PLT-AC-89 — soft edgeless overlay, no panel behind copy
@@ -107,6 +159,26 @@ unless HOME.match?(/\.home-hero-actions-contacts[\s\S]{0,120}?flex-wrap:\s*nowra
107
159
  failed = 1 if fail!("PLT-AC-94: .home-hero-actions-contacts must keep flex-wrap: nowrap")
108
160
  end
109
161
 
162
+ # PLT-AC-104 / PLT-AC-105 / PLT-AC-106 — icon/name center + gray wash + pad balance
163
+ unless HOME.include?("PLT-AC-104")
164
+ failed = 1 if fail!("PLT-AC-104: home.css must document icon/name vertical center")
165
+ end
166
+ if HOME.include?("data-contents-select")
167
+ failed = 1 if fail!("PLT-AC-105: home.css must not keep data-contents-select selection switch")
168
+ end
169
+ if HOME.match?(/--mk-h:\s*0\.42em/)
170
+ failed = 1 if fail!("PLT-AC-105: selected title must not keep the thin 0.42em mark bar")
171
+ end
172
+ unless HOME.include?("PLT-AC-105") && HOME.include?("color-surface-high")
173
+ failed = 1 if fail!("PLT-AC-105: home.css must document gray --color-surface-high selection wash")
174
+ end
175
+ unless HOME.include?("PLT-AC-106")
176
+ failed = 1 if fail!("PLT-AC-106: home.css must document selected-row padding balance")
177
+ end
178
+ unless SPEC.include?("PLT-AC-104") && SPEC.include?("PLT-AC-105") && SPEC.include?("PLT-AC-106")
179
+ failed = 1 if fail!("spec docs/features/home-hero-c4.md must cover PLT-AC-104/105/106")
180
+ end
181
+
110
182
  # Spec + validate wiring
111
183
  unless SPEC.include?("PLT-AC-94") && SPEC.include?("2.3.6")
112
184
  failed = 1 if fail!("spec docs/features/home-hero-c4.md must cover PLT-AC-88…94 and 2.3.6")
@@ -116,7 +188,7 @@ unless VALIDATE.include?("test-home-hero-c4.rb")
116
188
  end
117
189
 
118
190
  if failed.zero?
119
- puts "PASS test-home-hero-c4 (PLT-AC-88…94)"
191
+ puts "PASS test-home-hero-c4 (PLT-AC-88…94, 104/105/106)"
120
192
  else
121
193
  exit 1
122
194
  end
@@ -1,16 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # PLT-AC-98…100 — hero name = band title + 2pt; overlay lighter than 2.3.7.
3
+ # PLT-AC-98…100 — hero name = band title + 4pt; overlay lighter than 2.3.7.
4
4
 
5
5
 
6
6
  errors = []
7
7
  home = File.read(File.expand_path("../../assets/css/ledger/home.css", __dir__))
8
8
 
9
- unless home.include?("font-size: calc(var(--type-section) + 2pt)")
10
- errors << "home.css: base .home-hero-title must be calc(var(--type-section) + 2pt) (PLT-AC-98)"
9
+ unless home.include?("font-size: calc(var(--type-section) + 4pt)")
10
+ errors << "home.css: base .home-hero-title must be calc(var(--type-section) + 4pt) (PLT-AC-98)"
11
11
  end
12
- unless home.include?("font-size: calc(var(--type-section-lg) + 2pt)")
13
- errors << "home.css: ≥768 .home-hero-title must be calc(var(--type-section-lg) + 2pt) (PLT-AC-98)"
12
+ unless home.include?("font-size: calc(var(--type-section-lg) + 4pt)")
13
+ errors << "home.css: ≥768 .home-hero-title must be calc(var(--type-section-lg) + 4pt) (PLT-AC-98)"
14
14
  end
15
15
  if home.match?(/\.home-hero-title[^{]*\{[^}]*100cqi/) || home.include?("1.85rem, 2.6vw") || home.include?("1.9rem, 7vw")
16
16
  errors << "home.css: .home-hero-title must not size from cqi/vw (PLT-AC-98)"
@@ -277,18 +277,71 @@ const ASSERT_EXPRESSION = `
277
277
  if (!isInitial && window.innerWidth >= 900 && gfs < 22) {
278
278
  errors.push('Desktop inventory icon glyph too small (' + gfs.toFixed(2) + 'px); Material Symbols inherit must not win (PLT-AC-75)');
279
279
  }
280
- // CR-21c: glyph fills most of the button (>= ~70% of row height)
281
- if (window.innerWidth >= 900 && !isInitial && gr.height + 1.5 < 0.70 * rowH) {
280
+ if (window.innerWidth >= 900 && window.innerWidth < 1024 && !isInitial && gr.height + 1.5 < 0.70 * rowH) {
282
281
  errors.push('Desktop glyph height (' + gr.height.toFixed(2) + 'px) < 70% of button (' + rowH.toFixed(2) + 'px) (PLT-AC-76)');
283
282
  }
284
283
  }
285
284
  const rcs = getComputedStyle(first);
286
- if (Math.abs(parseFloat(rcs.borderTopWidth) - 1) > 0.5 || rcs.borderTopStyle !== 'solid') {
287
- errors.push('Inventory row border is ' + rcs.borderTopWidth + ' ' + rcs.borderTopStyle + ', expected 1px solid (PLT-AC-75)');
285
+ if (window.innerWidth < 1024) {
286
+ if (Math.abs(parseFloat(rcs.borderTopWidth) - 1) > 0.5 || rcs.borderTopStyle !== 'solid') {
287
+ errors.push('Inventory row border is ' + rcs.borderTopWidth + ' ' + rcs.borderTopStyle + ', expected 1px solid (PLT-AC-75)');
288
+ }
289
+ }
290
+ if (window.innerWidth >= 1024) {
291
+ document.querySelectorAll('.home-project-inventory-title').forEach(function (title, idx) {
292
+ if (title.scrollWidth > title.clientWidth + 1) {
293
+ errors.push('Contents name ' + idx + ' is truncated (PLT-AC-88)');
294
+ }
295
+ const tcs = getComputedStyle(title);
296
+ if (tcs.whiteSpace === 'nowrap' || tcs.textOverflow === 'ellipsis') {
297
+ errors.push('Contents name ' + idx + ' ellipsizes (PLT-AC-88)');
298
+ }
299
+ });
300
+ document.querySelectorAll('.home-project-inventory-row').forEach(function (row, idx) {
301
+ const glyph = row.querySelector('.home-project-inventory-glyph');
302
+ if (!glyph || getComputedStyle(glyph).display === 'none' || glyph.getBoundingClientRect().width < 1) {
303
+ errors.push('Contents row ' + idx + ' missing visible icon glyph (PLT-AC-88)');
304
+ } else {
305
+ const gcs = getComputedStyle(glyph);
306
+ const ox = gcs.overflowX || gcs.overflow;
307
+ if (ox !== 'hidden' && ox !== 'clip') {
308
+ errors.push('Contents icon cell ' + idx + ' must clip overflow (PLT-AC-88)');
309
+ }
310
+ if (/\d{2}\s*\//.test((glyph.textContent || '').trim())) {
311
+ errors.push('Contents icon cell ' + idx + ' leaks folio text (PLT-AC-88)');
312
+ }
313
+ }
314
+ ['home-project-inventory-code', 'home-project-inventory-year', 'home-project-inventory-tags'].forEach(function (cls) {
315
+ const el = row.querySelector('.' + cls);
316
+ if (!el) return;
317
+ const cs = getComputedStyle(el);
318
+ const r = el.getBoundingClientRect();
319
+ if (cs.display !== 'none' && cs.visibility !== 'hidden' && r.width > 0.5 && r.height > 0.5) {
320
+ errors.push('Contents row ' + idx + ' still shows .' + cls + ' (PLT-AC-88)');
321
+ }
322
+ });
323
+ });
324
+ const opened = document.querySelector('.home-project-inventory-row.is-selected .home-project-inventory-media');
325
+ if (opened && opened.getBoundingClientRect().width > 8) {
326
+ const fr = opened.getBoundingClientRect();
327
+ const want = 11 * rootFs;
328
+ if (Math.abs(fr.width - want) > 3) {
329
+ errors.push('Opened picture width ' + fr.width.toFixed(1) + ' want ~' + want.toFixed(1) + ' (PLT-AC-88)');
330
+ }
331
+ const ratio = fr.width / fr.height;
332
+ if (Math.abs(ratio - (16 / 9)) / (16 / 9) > 0.02) {
333
+ errors.push('Opened picture ratio ' + ratio.toFixed(3) + ' not 16:9 (PLT-AC-88)');
334
+ }
335
+ }
288
336
  }
289
337
  }
290
338
 
291
- if (window.innerWidth >= 900 && bench) {
339
+ if (window.innerWidth >= 1024 && bench) {
340
+ const specimen = document.querySelector('.home-project-specimen');
341
+ if (specimen && getComputedStyle(specimen).display !== 'none') {
342
+ errors.push('Specimen card is still shown on the contents page (PLT-AC-88)');
343
+ }
344
+ } else if (window.innerWidth >= 900 && bench) {
292
345
  const rawSize = getComputedStyle(bench).getPropertyValue('--home-icon-btn-size').trim();
293
346
  let iconSizePx = parseFloat(rawSize);
294
347
  if (rawSize.endsWith('rem')) {
data/scripts/validate.sh CHANGED
@@ -84,6 +84,7 @@ TESTS=(
84
84
  scripts/test/test-home-hero-overlay-strength.rb
85
85
  scripts/test/test-home-hero-overlay-split.rb
86
86
  scripts/test/test-home-hero-overlay-monotonic.rb
87
+ scripts/test/test-home-desk-layout.rb
87
88
  scripts/test/test-detail-action-icons.rb
88
89
  scripts/test/test-parallel-content-publish.rb
89
90
  scripts/test/test-mobile-density-home-measure.rb
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pandorga
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.17
4
+ version: 2.3.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Pandorga contributors
@@ -444,6 +444,8 @@ files:
444
444
  - scripts/test/test-home-articles.rb
445
445
  - scripts/test/test-home-band-art.rb
446
446
  - scripts/test/test-home-band-intro.rb
447
+ - scripts/test/test-home-desk-layout.mjs
448
+ - scripts/test/test-home-desk-layout.rb
447
449
  - scripts/test/test-home-hero-c4.rb
448
450
  - scripts/test/test-home-hero-overlay-monotonic.mjs
449
451
  - scripts/test/test-home-hero-overlay-monotonic.rb