waveterm icon indicating copy to clipboard operation
waveterm copied to clipboard

[codex] Fix terminal IME composition handling

Open dandacompany opened this issue 6 months ago • 4 comments

Summary

  • Preserve IME composition state when adapting keyboard events.
  • Avoid Wave global/custom terminal key handling while IME composition is active.
  • Add broader CJK font fallback while keeping Hack as the primary terminal font.
  • Fix the .fixed-font CSS declaration to use a valid font: property.

Why

IME composition key events can flow through Wave keyboard handling and terminal custom key handling. In interactive terminal prompts, this can cause unexpected input while composing text with Korean, Japanese, Chinese, or other composition-based input methods.

The terminal font fallback also previously relied only on Hack/monospace. Keeping Hack first preserves the existing monospace behavior, while adding Noto CJK and common platform CJK fallbacks improves glyph coverage for multilingual terminal output.

Verification

  • npm run build:dev in a clean worktree from this commit
  • Build completed with exit code 0
  • Existing Vite warnings observed: browser externalization for fs/path, circular chunk warning for cytoscape/mermaid
  • Image optimizer reported missing optional sharp package, but the build command still completed successfully

dandacompany avatar May 24 '26 09:05 dandacompany

Review Change Stack

[!NOTE]

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • [ ] ▶️ Resume reviews
  • [ ] 🔍 Trigger review

Walkthrough

The PR propagates IME/composition state into keyboard adapters and makes global, terminal, and TermWrap handlers consume composing events early. It adds a DefaultTermFontFamily constant and default config key term:fontfamily, updates JSON fixed-font CSS to the expanded fallback, and changes terminal WebGL default handling so WebGL is disabled unless explicitly enabled.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title '[codex] Fix terminal IME composition handling' clearly and concisely describes the main change: fixing IME composition handling in the terminal, which is the primary focus of all changeset modifications across keyboard event handling, font configuration, and composition-aware input routing.
Description check ✅ Passed The description comprehensively explains the changeset: it documents IME composition state preservation, avoids terminal key handling during composition, adds CJK font fallbacks, and fixes CSS properties—all of which directly correspond to the actual file changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • [ ] Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot] avatar May 24 '26 09:05 coderabbitai[bot]

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar May 24 '26 09:05 CLAassistant

@coderabbitai review

dandacompany avatar May 24 '26 10:05 dandacompany

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

coderabbitai[bot] avatar May 24 '26 10:05 coderabbitai[bot]