From 482ffe69e668c65413d6fb00d0c5b41436534df1 Mon Sep 17 00:00:00 2001 From: openclaw-bot Date: Mon, 25 May 2026 21:29:41 +0000 Subject: [PATCH] =?UTF-8?q?test(#1364):=20RED=20=E2=80=94=20assert=20.mc-p?= =?UTF-8?q?ill=20drops=20max-width:4ch=20clamp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Regression guard for #1362 over-aggressive defense-in-depth that ellipsizes multi-digit pill counts ('R…' instead of 'R60'). Also asserts overflow:hidden + text-overflow:ellipsis remain as graceful-degrade. Expected to FAIL on this commit (max-width: 4ch still present in style.css). --- .github/workflows/deploy.yml | 1 + test-issue-1364-pill-no-clamp.js | 53 ++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 test-issue-1364-pill-no-clamp.js diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 841f8d2d..4a5dec44 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -108,6 +108,7 @@ jobs: node test-issue-1293-marker-shapes.js node test-issue-1356-map-a11y.js node test-issue-1360-pill-letter-count.js + node test-issue-1364-pill-no-clamp.js - name: Verify proto syntax run: | diff --git a/test-issue-1364-pill-no-clamp.js b/test-issue-1364-pill-no-clamp.js new file mode 100644 index 00000000..634b1512 --- /dev/null +++ b/test-issue-1364-pill-no-clamp.js @@ -0,0 +1,53 @@ +/** + * #1364 — regression(map): #1362 pill max-width:4ch over-clamps multi-digit + * counts → `R…` instead of `R60`. + * + * The defense-in-depth `max-width: 4ch` added in #1362 ellipsizes pill + * content because the 4ch box includes left/right padding (1px 3px), + * leaving ~2.5ch for text — enough for `R6` but not `R60`. + * + * Fix (Option A from issue): drop `max-width` entirely. JS already caps + * at "999+" so CSS guard was overcaution. Keep `overflow:hidden` + + * `text-overflow:ellipsis` as graceful-degrade if JS ever fails. + */ +'use strict'; + +const fs = require('fs'); +const path = require('path'); + +let passed = 0, failed = 0; +function assert(cond, msg) { + if (cond) { passed++; console.log(' ✓ ' + msg); } + else { failed++; console.error(' ✗ ' + msg); } +} + +const cssSrc = fs.readFileSync(path.join(__dirname, 'public', 'style.css'), 'utf8'); +const pillRuleRe = /\.mc-cluster\s+\.mc-pill\s*\{([\s\S]*?)\}/; +const pillMatch = cssSrc.match(pillRuleRe); + +console.log('\n=== #1364: .mc-pill no longer clamps multi-digit counts ==='); + +assert(pillMatch, '.mc-cluster .mc-pill rule found in style.css'); + +if (pillMatch) { + const body = pillMatch[1]; + + // Primary regression guard: NO max-width: 4ch (or any max-width that would + // clamp `R999+`). Issue acceptance criterion: "assert .mc-pill CSS does + // NOT contain max-width: 4ch". + assert(!/max-width\s*:\s*4ch/.test(body), + '.mc-pill does NOT declare `max-width: 4ch` (regression guard for #1364)'); + + // Graceful degradation: keep belt-only overflow guards in case JS cap + // is bypassed by a hypothetical regression. + assert(/overflow\s*:\s*hidden/.test(body), + '.mc-pill keeps `overflow: hidden` as graceful-degrade'); + assert(/text-overflow\s*:\s*ellipsis/.test(body), + '.mc-pill keeps `text-overflow: ellipsis` as graceful-degrade'); +} + +console.log('\n=== Summary ==='); +console.log(' Passed: ' + passed); +console.log(' Failed: ' + failed); +console.log('\n#1364 ' + (failed === 0 ? 'PASS' : 'FAIL')); +process.exit(failed === 0 ? 0 : 1);