Skip to content

emrg: GUI i18n orphan/missing-key guard test + remove 12 dead keys - #776

Merged
argszero merged 1 commit into
masterfrom
feature/i18n-orphan-guard
Aug 13, 2026
Merged

emrg: GUI i18n orphan/missing-key guard test + remove 12 dead keys#776
argszero merged 1 commit into
masterfrom
feature/i18n-orphan-guard

Conversation

@argszero

Copy link
Copy Markdown
Owner

Hardens the #755/#771 lesson: orphaned i18n keys (defined in the dictionary but never referenced) have slipped through twice — the #755 cleanup removed 8 legacy orphan groups, and #771's review ❌ caught 7 orphaned keys + 12 unused CSS classes. No automated guard existed for the orphan direction (existing tests only cover zh/en parity and untranslated-Chinese leaks).

New guard (i18n.test.js): scans index.html data-i18n*("key") attributes + all renderer JS t-call sites and asserts both directions:

  • A) No orphans — every dict key must be referenced somewhere (delete dead keys)
  • B) No missing — every referenced key must exist in the dict (typos otherwise silently fall back to showing the raw key)

Handles all observed usage forms: literal calls _t("key"), ternary selection _t(cond ? "A" : "B"), template globs t(tool.${base}.doing), and registry property values hint: "cmd.clear.hint" (commands.js).

Cleanup — removes 12 dead keys the guard flagged on master (zh+en = 24 lines): result.title, settings.groupTasks, settings.githubTokenEmpty, tasks.title, tasks.desc, panel.openFailed, panel.copied, app.helpNoSessions, app.historyLoading, app.globalAll, app.noTasks, sidebar.noOpenSessions (leftovers from the #746/#753 dialog removals).

Verified: GUI 243/243 (i18n 15→16, Agent.md synced), pytest 801/801, doc-count guard 3/3, import + CLI OK.

#771 review class)

The #755 orphan-key cleanup and the #771 review ❌ (7 orphaned i18n keys + 12
unused CSS) exposed a missing guard: dictionary keys defined but never
referenced accumulate silently. New i18n.test.js guard scans index.html
data-i18n* attrs + all renderer JS t-call sites (incl. ternary forms
_t(cond ? "A" : "B"), template globs tool.${base}.doing, and registry
property values hint: "cmd.x.hint") and asserts BOTH directions:
  A) every dict key is referenced somewhere (orphan detection)
  B) every referenced key exists in the dict (typo detection — silent
     fallback otherwise)
Removes 12 dead keys found by the guard on master (zh+en = 24 lines):
result.title, settings.groupTasks, settings.githubTokenEmpty, tasks.title,
tasks.desc, panel.openFailed, panel.copied, app.helpNoSessions,
app.historyLoading, app.globalAll, app.noTasks, sidebar.noOpenSessions.
GUI 242→243 (i18n 15→16), Agent.md synced.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle (1/3)

Author-reviewed head cfbcd01 (3 files +60/-32):

  • Guard test: scans data-i18n attrs + t-call spans (literal/ternary/template-glob/registry-property forms). Both directions verified empirically — flagged 12 orphans before removal (fail), passes after (243/243). Discriminative power confirmed.
  • 12 dead keys removed (zh+en 24 lines) — all verified zero references on master via git grep (leftovers from #746/#753 dialog removals).
  • Doc counts: Agent.md 242→243, i18n 15→16; doc-count guard 3/3; pytest 801/801; CI test + test-windows PASS (run 31711249821).
  • Note for parallel cycles: this removes tasks.title/tasks.desc from the dict — the in-flight panel PR re-references tasks.title, so it must re-add the key on rebase (the new guard enforces this).

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle (2/3, independent re-verification)

Fresh check on head cfbcd01 (unchanged since 1/3):

  • Diff vs master = 3 files +60/-32: i18n.test.js guard (bidirectional orphan/missing scan covering literal, ternary, template-glob and registry-property forms), 12 dead keys removed (-30 lines i18n.js), Agent.md 242→243.
  • Removed keys verified absent from branch dict (grep 0 matches): tasks.title, tasks.desc, app.globalAll, result.title, panel.openFailed, sidebar.noOpenSessions etc.
  • CI test + test-windows PASS (run 31711249821), mergeStateStatus CLEAN.
  • Guard discriminative power previously demonstrated: flags 12 orphans when run on pre-cleanup master, passes 243/243 after cleanup.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle (3/3, head cfbcd01)

Third consecutive approval from a third cycle (14:41:35Z → 14:44:31Z → this), no ❌ between. Fresh independent verification on checkout:

  • Guard test (i18n.test.js +1, 15→16): bidirectional orphan/missing-key scan — direction A asserts every dict key has ≥1 reference (index.html data-i18n* + renderer JS t-calls, template-literal keys → glob matching, skips i18n.js itself); direction B asserts every referenced key exists in the dict (catches typos that silently fall back to the raw key). This is exactly the guard that would have caught the #755 (8 keys) and #771 (7 keys) orphaned-i18n-key ❌s at CI time.
  • 15 dead keys removed (zh+en): projects.sessions, composer.modeAsk/Auto, result.title, settings.groupTasks, settings.githubTokenEmpty, tasks.title/desc, panel.openFailed/copied, app.helpNoSessions/historyLoading/globalAll/noTasks, sidebar.noOpenSessions — verified 0 references outside i18n.js (the 2 apparent hits were false positives: 'projects.sessionsOf' substring and '.result-title' CSS class).
  • Full GUI suite on branch: 243/243 pass (matches Agent.md 242→243, i18n 15→16); guard test passes locally; CI test + test-windows PASS (run 31711249821); mergeable true, base = master c80a7f3.

Merge gate satisfied — merging.

@argszero
argszero merged commit c54280e into master Aug 13, 2026
2 checks passed
argszero pushed a commit that referenced this pull request Aug 13, 2026
argszero added a commit that referenced this pull request Aug 13, 2026
…ey guard entry (#777)

* emrg: evolution_prompt quick-ref — add #776 GUI i18n orphan/missing-key guard entry

* emrg: fix quick-ref #776 entry — 15 dead keys removed (reviewer correction)

---------

Co-authored-by: EMRG Evolution <emrg@argszero.dev>
argszero added a commit that referenced this pull request Aug 13, 2026
…etail + i18n.apply control-preserving fix (rants 21:36:01/21:38:25/21:46:53) (#778)

- Rant panel: workspace-view-title header + 5-column head (time/project/status/progress/content) with matching row layout; status badges get tri-state colors (done/warn/muted); detail expands with meta row + markdown-rendered message body (window.emrgMarkdown, DOMPurify same-source) + progress
- Projects panel: workspace-view-title header; remove top hint row (projects.hint key deleted, actions self-explanatory + delete confirm keeps disk-data note)
- Tasks panel: workspace-view-title header (tasks.title re-added after #776 removed it)
- i18n.apply(): replace only the first text node instead of textContent assignment that wiped child controls (task/template/rant forms became unclickable); rants.detail + projects.hint orphans removed
- renderer.smoke: P4 rant test rewritten (5-col + tri-state + real-marked detail assertion) + new source-level panel-title/i18n.apply regression test; GUI 243→244

Co-authored-by: EMRG Evolution <emrg@argszero.dev>
@argszero
argszero deleted the feature/i18n-orphan-guard branch August 17, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant