Repository navigation
fix(i18n): drop orphan TerminalPane.minimumContrast entries that broke main static analysis - #19566
Conversation
…e main #18126 added a `auto.components.settings.TerminalPane.minimumContrast` block to en.json alongside the `settings.contrast.*` keys the shipped TerminalContrastSetting component actually reads. Nothing references the TerminalPane block: zero call sites, zero tests, zero other locales, and no dynamic key builder under `auto.components.settings.*` can produce it (the only template-literal builder in that namespace is a test consumer that reads paths from the catalog, not one that constructs them). An unreferenced entry is treated as runtime-required by generate-runtime-required-english-catalog (possible dynamic key), so the seven orphans made `verify:localization-runtime-catalog` demand they ship in en-runtime-required.json. #18126 never regenerated it, and its own static-analysis gate was cancelled rather than run, so main has failed that step for every PR since 53852c9 merged. Delete the orphans rather than regenerate the catalog around them: regenerating would enshrine seven keys nothing reads.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe English locale removes all translation entries for the Merge Risk: ⚪ Minimal · up to This change removes unused English localization entries and has no identified merge-readiness risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Delete orphan
TerminalPane.minimumContrastblock — removes the 7 unused entries (plus their enclosing braces and the predecessor's trailing comma) fromen.json, leaving the file valid JSON.
Confirmed the root-cause claim: the shipped TerminalContrastSetting.tsx reads auto.components.settings.contrast.*, not TerminalPane.minimumContrast.*, so the deleted block had no reader. The sibling terminal.search.minimumContrast.* block (used by terminal-typography-search.ts) and TerminalPane.scrollSpeed.* (used by TerminalInteractionSection.tsx) are untouched, and a repo-wide search turns up no literal or dynamic reference to the deleted keys. Deleting rather than regenerating the runtime catalog is the right call — regenerating would have shipped dead data.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

ELI5
mainhas failed thestatic analysischeck for every PR since 07:39Z today. #18126 added seven English strings toen.jsonthat no code reads, and a CI check that decides which English strings must ship in the app's boot bundle treats "no code reads it" as "might be built dynamically, so it must ship." It then noticed those seven were not in the shipped catalog and failed. This PR deletes the seven unused strings — the actual problem — rather than the catalog that correctly flagged them.Relationship to #19544 / #19337 (read this first)
Two open PRs currently carry a regenerated
en-runtime-required.jsonthat adds these 7 orphans to the shipped catalog. If either merges first,maingoes green — and this PR becomes the follow-up cleanup, not the fix. Stated plainly and without blame (those PRs were fixing their own red, not making a policy choice): the regenerate variant makes the check pass by adding the dead keys to the list of things that must ship. That is the tool built to prevent boot-bundle dead weight being used to authorise it.This PR is safe to land in either order:
en.json.en.jsonleaves their 7 shipped entries classified by the generator assuperfluous— explicitly "harmless; sync to drop them" — notmissingorcontradicting, so the check stays green. No second break.Root cause
#18126 (
53852c9, "make the contrast floor user-configurable") added twominimumContrastblocks toen.json:auto.components.settings.terminal.search.minimumContrast.*— referenced byterminal-typography-search.ts. Kept.auto.components.settings.TerminalPane.minimumContrast.*(7 entries) — referenced by nothing. The shippedTerminalContrastSetting.tsxreadsauto.components.settings.contrast.*instead. These are the orphans this PR removes.generate-runtime-required-english-catalog.mjskeeps an entry as runtime-required when no call site with a literal default references it (its own doc comment: a dynamic key could still resolve it). So an unreferenced entry is by construction runtime-required —literalFallbacksByKey.get(key)isundefinedand it lands inrequired. The seven orphans therefore became required,en-runtime-required.jsonwas never regenerated in #18126, andverify:localization-runtime-cataloghas failed on every merge-ref since.This failure mode recurs on any rename that leaves leftovers behind — every unreferenced key is silently promoted to runtime-required. Whether that deserves a lint is a separate call; it is worth naming.
Why delete rather than regenerate
Regenerating would also turn the check green — by shipping seven strings nothing will ever read, which is precisely the "dead weight in the boot bundle" the generator's comment says it exists to prevent. Deleting is the root cause.
Before deleting, I established there is no dynamic path that can produce
auto.components.settings.TerminalPane.minimumContrast.*(the exact hazard the check guards against):src/,mobile/,tests/(.ts/.tsx/.json/.snap), excludingen.jsonitself.auto.components.settings.: exactly one in the whole tree —plugin-chrome-allowlist.test.ts:43, a consumer (path.startsWith(...)over paths read from the catalog), not a producer.minimumContrasttoken near anytranslate/t(/key usage: only the keptterminal.search.minimumContrast.*literals and the unrelatedterminalMinimumContrastRatiosetting-value reads.es/fr/ja/ko/zh) and mobile catalogs: none carry the block; no translation is stranded.ts.isStringLiteralLikeinverify-localization-catalog.mjs) classifies keys the same way, so what it can't see, neither can i18next via a literal.git blameattributes the block solely to53852c9; the siblingTerminalPane.scrollSpeed.*follows the normal pattern (literal refs inTerminalInteractionSection.tsx), which is what the orphans were evidently meant to be before the component was pointed atsettings.contrast.*.The "10 insertions vs 7 orphans" question, closed
A regenerate dry-run reports 10 insertions / 1 deletion. Key-level diff over the flattened JSON: ADDED 7 (exactly the orphans), REMOVED 0, CHANGED 0. The line count is 7 leaves + 2 brace lines + the predecessor line rewritten to add a trailing comma (−1/+1). There are no "other 3." Decisive control: on
main+ this delete,--fixregenerates a byte-identicalen-runtime-required.json(cmpexit 0). Nothing remains to add.Evidence this is a main break, not a PR-side one
main@53852c9with no other changes →verify:localization-runtime-catalogexits 1 with exactly these 7 keys.96c6aa2— the commit before53852c9. Every run merged against53852c9or later fails the identical step with the identical 7 keys.mainHEAD (d346d6f) still has zerominimumContrastentries inen-runtime-required.json.Systemic: three gaps that compound
#18126's own
static analysisjob wascancelledat 05:48Z and it was merged at 07:39Z anyway. On its head SHA:cancelled:17, failure:1, skipped:4— zero required checks reachedsuccess, and no later run was created for that head. Had the job run, this step would have failed and the break would never have reachedmain. Twenty-four minutes later a second, independent break landed (#19542 + #19551, 16 seconds apart; fixed in the companion orchestration PR). The full cause:main—pr.ymlispull_request-only;maingets no CI on push, so neither break was ever red onmainitself.The first two are fixed by branch protection with strict status checks, which
maincannot have because it has no branch protection and no rulesets at all. The third needs a push trigger onmain.Verification
On the fixed tree (
origin/maind346d6f+ this commit), locally and confirmed identically in this PR's own CI (static analysis→success):verify:localization-runtime-catalog(the failing step)verify:localization-catalogverify:localization-extractionverify:localization-coverageen.jsonoxfmt --check en.jsonDiff is exactly the 9 lines of the orphan block and the trailing comma on its predecessor;
en-runtime-required.jsonis untouched; the referencedterminal.search.minimumContrastblock is intact.This PR's
verifyis red only because of the second, unrelatedmainbreak (shard 3/8), fixed in the companion PR.