From a7e250926c8f11e4a22a909697d0dfb7e2ac4330 Mon Sep 17 00:00:00 2001 From: Varna Sri Raman Date: Wed, 23 Sep 2026 02:28:52 +0000 Subject: [PATCH 1/2] Keep stack.css in step, and correct a test count stale since the day it tripled The CSS change is the family's, not this repository's. `.row span { opacity: .7 }` matched more than the tag it was written for, because `.t` is itself a span wrapping the title and the tag, so the opacity compounded on the tag (0.7 x 0.7 = 0.49) and dimmed the title. Scoped now to `.row .t > span`. This landing page had none of it. Counted before the fix: InsightStack 18 elements at 3.43:1, EquityStack 12, SignalStack 7, FieldStack 0, because this page uses different markup. The file is carried here because assets/css/stack.css is byte-identical across the four stack repositories by design and CLAUDE.md says to change it in one place and copy it. Verified after on all four landing pages: 0 serious or critical axe violations at 1280x900 and 390x844, no overflow. The count. CLAUDE.md said "6 files, 37 checks". The suite is 7 files and 55 test_that blocks. Commit f4ec67d added field_ops/ together with tests/test_field_ops.R and its 41 test_that blocks, rewrote 41 lines of CLAUDE.md, and left that comment alone, so the repository has understated its own suite by roughly a factor of three since the day the suite tripled. Not verified by running it: R is not available in this environment, so the 55 is counted from the source rather than reported by testthat. CI runs Rscript tests/run_all_tests.R and is green. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01MrvR2NXsJFVRCeJZFCPuNL --- CLAUDE.md | 7 ++++++- assets/css/stack.css | 11 ++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 570365e..e0dec0a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -31,9 +31,14 @@ assuming a file exports something. main. No schedule: nothing here touches an external service. ```r -source("tests/run_all_tests.R") # 6 files, 37 checks +source("tests/run_all_tests.R") # 7 files, 55 test_that blocks ``` +That count was 6 and 37 until 2026-09-23. `field_ops/` and its 41 `test_that` +blocks arrived in the same commit that rewrote 41 lines of this file and left +the comment alone, so the repository understated its own suite by a factor of +three from the day the suite tripled. Nothing compares the two. + Two things to know before adding a test. **testthat runs from `tests/`, not the repository root.** Use `fs_path()` from diff --git a/assets/css/stack.css b/assets/css/stack.css index d44bd78..cb49da2 100644 --- a/assets/css/stack.css +++ b/assets/css/stack.css @@ -129,7 +129,16 @@ a { color: inherit; text-decoration: none; } transition: background .12s, color .12s; } .row:hover, .row:focus-visible { background: var(--ink); color: var(--bg); } .row b { font-weight: 600; font-size: .95rem; } -.row span { font-family: var(--mono); font-size: .66rem; opacity: .7; white-space: nowrap; } +.row span { font-family: var(--mono); font-size: .66rem; white-space: nowrap; } +/* Opacity belongs on the tag, not on every span in the row. `.t` is itself a + span wrapping the title and the tag, so `.row span { opacity: .7 }` applied + twice to the tag (0.7 x 0.7 = 0.49) and once to the title. Measured on the + InsightStack landing page: the tag came out #84827f on #f6f2ea, 3.43:1 at + 10.56px, failing AA on 18 elements, and every row title rendered at 70% + opacity, which is the opposite of what `.row b { font-weight: 600 }` is for. + The comment below already records the same selector doing the same thing to + white-space; that was scoped and this was not. */ +.row .t > span { opacity: .7; } /* --- calculator layout --------------------------------------------------- */ .calc { display: grid; grid-template-columns: 1.05fr .95fr; gap: 0; From b24f36d5a9a6f2623092ddafff807c0cd1740337 Mon Sep 17 00:00:00 2001 From: Varna Sri Raman Date: Wed, 23 Sep 2026 02:34:30 +0000 Subject: [PATCH 2/2] Take the count from testthat, not from a grep The PR said testthat wins if it disagreed, and it does. CI ran the suite on this branch and its summary reporter printed 119 dots across 7 files: climate_index 3, dhs_stunting 14, education_outcomes 2, field_ops 82, health_access_index 3, mel_reshape 2, survey_summary 13. 119, not the 55 test_that blocks I counted from the source, and not the 112 expect_ calls a grep finds either: the reporter prints one character per expectation, and some expectations sit inside loops and run more than once. So a static count of this suite undercounts it, in both units. That also settles the unit. The original comment said 'checks', which is expectations, so 37 -> 119 compares like with like. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01MrvR2NXsJFVRCeJZFCPuNL --- CLAUDE.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index e0dec0a..1dc6a40 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -31,13 +31,21 @@ assuming a file exports something. main. No schedule: nothing here touches an external service. ```r -source("tests/run_all_tests.R") # 7 files, 55 test_that blocks +source("tests/run_all_tests.R") # 7 files, 119 checks ``` -That count was 6 and 37 until 2026-09-23. `field_ops/` and its 41 `test_that` -blocks arrived in the same commit that rewrote 41 lines of this file and left -the comment alone, so the repository understated its own suite by a factor of -three from the day the suite tripled. Nothing compares the two. +That count was 6 and 37 until 2026-09-23. `field_ops/` arrived in the same +commit that rewrote 41 lines of this file and left the comment alone, so the +repository understated its own suite by more than threefold from the day the +suite tripled. Nothing compares the two. + +119 is what testthat reports, not what a grep counts. `run_all_tests.R` uses +the summary reporter, which prints one character per **expectation**, and the +run breaks down as climate_index 3, dhs_stunting 14, education_outcomes 2, +field_ops 82, health_access_index 3, mel_reshape 2, survey_summary 13. A grep +for `expect_` in the same files finds 112, because some expectations sit +inside loops and run more than once. If you update this number, read it off a +run rather than off the source. Two things to know before adding a test.