emrg: GUI i18n orphan/missing-key guard test + remove 12 dead keys - #776
Merged
Conversation
#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
commented
Aug 13, 2026
argszero
left a comment
Owner
Author
There was a problem hiding this comment.
✅ 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
commented
Aug 13, 2026
argszero
left a comment
Owner
Author
There was a problem hiding this comment.
✅ 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
commented
Aug 13, 2026
argszero
left a comment
Owner
Author
There was a problem hiding this comment.
✅ 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
pushed a commit
that referenced
this pull request
Aug 13, 2026
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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): scansindex.htmldata-i18n*("key")attributes + all renderer JS t-call sites and asserts both directions:Handles all observed usage forms: literal calls
_t("key"), ternary selection_t(cond ? "A" : "B"), template globst(tool.${base}.doing), and registry property valueshint: "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.