Skip to content

fix(annotation): localize reviewer result text and stats in English mode#46

Merged
singyichen merged 11 commits into
mainfrom
fix/prototype-i18n-annotation-results
May 15, 2026
Merged

fix(annotation): localize reviewer result text and stats in English mode#46
singyichen merged 11 commits into
mainfrom
fix/prototype-i18n-annotation-results

Conversation

@singyichen

@singyichen singyichen commented May 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add REVIEWER_RESULT_TRANSLATIONS lookup table and localizeReviewerText() helper to both annotation-list and annotation-workspace prototypes
  • Apply localization to annotator result tags, label stats summaries, NER/aspect diff text, score pills, and correction input values when UI is in English mode
  • Cover all six task types with Playwright tests asserting translated strings appear and Chinese originals are absent

Test plan

  • Playwright: annotation-list-routing.spec.ts — reviewer list localizes label stats and annotator results across 6 task types in English mode
  • Playwright: annotation-workspace-i18n.spec.ts — reviewer panel localizes aggregate stats and annotator results across 6 task types in English mode
  • Manual: switch UI to English and verify reviewer card shows English labels for all task types
  • Manual: switch UI to Chinese and verify no unintended translations occur

🤖 Generated with Claude Code

Review Resolutions

Round 1 — 2026-05-15

  • design/prototype/pages/annotation/annotation-workspace.html: Pre-sort REVIEWER_RESULT_TRANSLATIONS keys into SORTED_REVIEWER_TRANSLATION_KEYS outside localizeReviewerText; set document.documentElement.lang immediately in init() before async panel loading to fix English-mode race condition; append dry-run round label to #sampleListTitle in renderSampleListHeader
  • design/prototype/pages/annotation/annotation-list.html: Pre-sort REVIEWER_RESULT_TRANSLATIONS keys into SORTED_REVIEWER_TRANSLATION_KEYS outside localizeReviewerText
  • design/prototype/pages/task-management/task-detail.html: Pre-sort RESULT_LABEL_I18N keys outside localizeResultText and add full-width punctuation cleanup to the return value
  • design/prototype/tests/task-management/task-detail-settings-edit.spec.ts: Replace 'previewInputValues' in item with item.previewInputValues to satisfy TS18048 narrowing

Round 2 — 2026-05-15

  • design/prototype/pages/annotation/annotation-workspace.html: Eagerly update #langLabel / #mobileLangLabel in init() before loadAllAnnotationPanels() to eliminate the ensureEnglishMode toggle-click race condition where panels completing load mid-click would trigger applyLang('zh') and flip html.lang back to zh-TW

singyichen and others added 9 commits May 14, 2026 14:13
Co-authored-by: OpenAI Codex <noreply@openai.com>
Co-authored-by: OpenAI Codex <noreply@openai.com>
Co-authored-by: OpenAI Codex noreply@openai.com
Co-authored-by: OpenAI Codex <noreply@openai.com>
Co-authored-by: OpenAI Codex <noreply@openai.com>
Co-authored-by: OpenAI Codex <noreply@openai.com>
Co-authored-by: OpenAI Codex <noreply@openai.com>
Define placement and interaction model for the persistent Help button:
- Desktop: sidebar utility row as 3rd button alongside keyboard shortcuts and theme toggle
- Mobile: top bar icon button following the existing shortcutHelpBtn pattern
- Modal content: reuse existing dashboard onboarding 3-card layout

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add REVIEWER_RESULT_TRANSLATIONS lookup and localizeReviewerText() to
both annotation-list and annotation-workspace prototypes so that
Chinese sample data, label stats, and annotator result tags are
translated when the UI is in English mode.

Cover all six task types (classification, VA scoring, aspect list,
sentence pairs, NER, relation extraction) with Playwright tests that
assert translated strings appear and Chinese originals are absent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Complete

I've thoroughly reviewed this PR implementing the Annotation List and Annotation Workspace prototype features (spec 015-annotation-workspace). The implementation demonstrates:

Strengths:

  • Comprehensive test coverage with 42 Playwright test files covering all major user flows
  • Proper adherence to the functional specifications
  • Complete internationalization support (English/Chinese)
  • Proper routing and state management
  • Responsive design considerations for mobile/desktop viewports
  • Well-structured HTML templates with semantic markup

Scope:
This PR adds extensive prototype UI implementations for:

  • Annotation list views (annotator/reviewer roles)
  • Annotation workspace for multiple task types (classification, VA scoring, sequence labeling, relation extraction, sentence pairs)
  • Task management interfaces
  • Dataset analysis views
  • Comprehensive test coverage validating routing, i18n, UI states, and user workflows

No merge-blocking defects were identified. The implementation is ready for merge.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.


⚠️ This PR contains more than 30 files. Amazon Q is better at reviewing smaller PRs, and may miss issues in larger changesets.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request implements comprehensive English localization across the prototype, introducing translation mappings for annotation results, chart labels, and risk assessments. It standardizes layout consistency by aligning page headings to a shared baseline and refining container widths across modules. Key UI improvements include replacing image-based chevrons with inline SVGs for better theme inheritance and enhancing mobile navbar responsiveness. Additionally, a robust suite of Playwright tests was added to ensure i18n and visual integrity. Review feedback identifies opportunities to optimize localization performance by pre-sorting translation keys and ensuring consistent punctuation cleanup in the English interface.

Comment thread design/prototype/pages/annotation/annotation-list.html
Comment thread design/prototype/pages/annotation/annotation-workspace.html
Comment thread design/prototype/pages/task-management/task-detail.html
singyichen and others added 2 commits May 15, 2026 10:36
- Pre-sort reviewer/result translation keys outside localizeReviewerText
  and localizeResultText to avoid per-call sorting overhead
- Add punctuation cleanup to localizeResultText in task-detail.html
- Set html.lang immediately on init before async panel loading to fix
  English mode race condition in Playwright tests
- Append dry-run round label to sampleListTitle in renderSampleListHeader
- Fix TS18048: use truthy guard for optional previewInputValues property

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Eliminates a race condition where ensureEnglishMode reads #langLabel
as ZH (sidebar default), clicks langToggle, and then bindEvents fires
the handler (switching to ZH) just as panels finish loading.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@singyichen singyichen merged commit a1f2908 into main May 15, 2026
8 checks passed
@singyichen singyichen deleted the fix/prototype-i18n-annotation-results branch May 15, 2026 03:27
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