pandorga 2.3.16 → 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.
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # PLT-AC-102 — strength/pool independence, caps < 1, charcoal shade, no /0.6 overscale.
3
+ # PLT-AC-102 — strength/pool independence, caps < 1, pool charcoal, strength true-black.
4
+ # PLT-AC-103 (structure half) — strength peak coeff ≥ 0.50; strength-cap ≥ 0.50; no shade on ::after.
4
5
 
5
6
  require "pathname"
6
7
 
@@ -29,10 +30,14 @@ unless cap_p && cap_p.to_f > 0 && cap_p.to_f < 1
29
30
  errors << "pool-cap must be in (0,1), got #{cap_p.inspect} (PLT-AC-102)"
30
31
  end
31
32
 
33
+ # PLT-AC-103: strength-cap high enough for perceptible darkening
34
+ if cap_s && cap_s.to_f < 0.50
35
+ errors << "strength-cap must be ≥ 0.50 for perceptible strength range, got #{cap_s} (PLT-AC-103)"
36
+ end
37
+
32
38
  # Independence: pool only on ::before backgrounds; vignette only on ::after; mask on ::after.
33
39
  pool_before = css.scan(/\.home-hero-portrait::before \{.*?^\}/m)
34
40
  vig_after = css.scan(/\.home-hero-portrait::after \{.*?^\}/m)
35
- # Prefer the rule bodies that actually paint gradients (skip the shared content/inset rule).
36
41
  before_paint = pool_before.find { |c| c.include?("linear-gradient") && c.include?("--home-hero-pool") }
37
42
  after_paint = vig_after.find { |c| c.include?("linear-gradient") && c.include?("--home-hero-vignette") }
38
43
  unless before_paint
@@ -50,11 +55,9 @@ end
50
55
  unless css.match?(/\.home-hero-portrait::after[\s\S]*?mask-image:\s*linear-gradient/)
51
56
  errors << "::after must mask off the text band (PLT-AC-102)"
52
57
  end
53
- # Stack media also keeps the split (comment marker from home.css)
54
- unless css.include?("PLT-AC-100…102: stack") && css.include?("var(--home-hero-pool)") && css.include?("var(--home-hero-vignette)")
58
+ unless css.include?("PLT-AC-100…103: stack") && css.include?("var(--home-hero-pool)") && css.include?("var(--home-hero-vignette)")
55
59
  errors << "stack overlay marker + pool/strength vars required (PLT-AC-102)"
56
60
  end
57
- # At least two pool ::before paints (desk + stack) and two strength ::after paints
58
61
  pool_paints = css.scan(/--home-hero-pool\)/).length
59
62
  vig_paints = css.scan(/--home-hero-vignette\)/).length
60
63
  if pool_paints < 4
@@ -64,7 +67,6 @@ if vig_paints < 4
64
67
  errors << "expected multiple strength stops (desk+stack), got #{vig_paints} (PLT-AC-102)"
65
68
  end
66
69
 
67
- # Every stop clamped
68
70
  unless css.include?("min(var(--home-hero-strength-cap)")
69
71
  errors << "strength stops must use min(strength-cap, …) (PLT-AC-102)"
70
72
  end
@@ -72,32 +74,50 @@ unless css.include?("min(var(--home-hero-pool-cap)")
72
74
  errors << "pool stops must use min(pool-cap, …) (PLT-AC-102)"
73
75
  end
74
76
 
75
- # No historic overscale that pushed alpha > 1
76
77
  if css.match?(%r{var\(--home-hero-vignette\)\s*/\s*0\.6})
77
78
  errors << "home.css must not use vignette/0.6 overscale (PLT-AC-102)"
78
79
  end
79
80
 
80
- # Shade is not pure black RGB(0,0,0)
81
+ # Pool shade is not pure black RGB(0,0,0)
81
82
  shade = css[/--home-hero-shade:\s*([^;]+);/, 1].to_s.strip
82
83
  parts = shade.split(",").map { |x| x.strip.to_i }
83
84
  if parts.length != 3 || parts.all?(&:zero?)
84
85
  errors << "--home-hero-shade must be non-zero charcoal RGB, got #{shade.inspect} (PLT-AC-102)"
85
86
  end
86
- unless css.include?("rgba(var(--home-hero-shade)")
87
- errors << "overlay stops must paint with rgba(var(--home-hero-shade), …) (PLT-AC-102)"
87
+ unless before_paint&.include?("rgba(var(--home-hero-shade)")
88
+ errors << "pool ::before stops must paint with rgba(var(--home-hero-shade), …) (PLT-AC-102)"
89
+ end
90
+
91
+ # PLT-AC-103: strength MUST use true black rgba(0, 0, 0, …) — charcoal brightens dark photos.
92
+ strength_paints = vig_after.select { |c| c.include?("linear-gradient") && c.include?("--home-hero-vignette") }
93
+ strength_paints.each_with_index do |body, i|
94
+ if body.include?("rgba(var(--home-hero-shade)")
95
+ errors << "::after strength paint ##{i} must NOT use charcoal shade (brightens dark photos) (PLT-AC-103)"
96
+ end
97
+ unless body.match?(/rgba\(\s*0\s*,\s*0\s*,\s*0\s*,/)
98
+ errors << "::after strength paint ##{i} must use rgba(0, 0, 0, …) (PLT-AC-103)"
99
+ end
100
+ end
101
+
102
+ # Peak strength coefficient (largest multiplier of vignette) must be ≥ 0.50
103
+ coeffs = css.scan(/calc\(\s*([\d.]+)\s*\*\s*var\(--home-hero-vignette\)\s*\)/).map { |m| m[0].to_f }
104
+ peak = coeffs.max || 0
105
+ if peak < 0.50
106
+ errors << "peak strength coefficient must be ≥ 0.50 for perceptible range, got #{peak} (PLT-AC-103)"
88
107
  end
89
108
 
90
- # Layout still emits both vars
91
109
  home_layout = ROOT.join("_layouts/home.html").read
92
110
  unless home_layout.include?("--home-hero-pool:")
93
111
  errors << "home.html must emit --home-hero-pool (PLT-AC-102)"
94
112
  end
95
113
 
96
- # Docs + schema mention independence / caps
97
114
  docs = ROOT.join("docs/features/home-hero-scale-overlay.md").read
98
115
  unless docs.include?("PLT-AC-102")
99
116
  errors << "docs/features/home-hero-scale-overlay.md must document PLT-AC-102"
100
117
  end
118
+ unless docs.include?("PLT-AC-103")
119
+ errors << "docs/features/home-hero-scale-overlay.md must document PLT-AC-103"
120
+ end
101
121
 
102
122
  schema = ROOT.join("lib/pandorga/registry/schema.yml").read
103
123
  unless schema.include?("strength") && schema.include?("pool")
@@ -105,7 +125,7 @@ unless schema.include?("strength") && schema.include?("pool")
105
125
  end
106
126
 
107
127
  if errors.empty?
108
- puts "OK home-hero-overlay-split (PLT-AC-102)"
128
+ puts "OK home-hero-overlay-split (PLT-AC-102/103 structure)"
109
129
  else
110
130
  warn "FAIL test-home-hero-overlay-split:\n#{errors.join("\n")}"
111
131
  exit 1
@@ -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
@@ -83,6 +83,8 @@ TESTS=(
83
83
  scripts/test/test-home-hero-scale.rb
84
84
  scripts/test/test-home-hero-overlay-strength.rb
85
85
  scripts/test/test-home-hero-overlay-split.rb
86
+ scripts/test/test-home-hero-overlay-monotonic.rb
87
+ scripts/test/test-home-desk-layout.rb
86
88
  scripts/test/test-detail-action-icons.rb
87
89
  scripts/test/test-parallel-content-publish.rb
88
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.16
4
+ version: 2.3.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Pandorga contributors
@@ -444,7 +444,11 @@ 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
450
+ - scripts/test/test-home-hero-overlay-monotonic.mjs
451
+ - scripts/test/test-home-hero-overlay-monotonic.rb
448
452
  - scripts/test/test-home-hero-overlay-split.rb
449
453
  - scripts/test/test-home-hero-overlay-strength.rb
450
454
  - scripts/test/test-home-hero-scale.rb