Skip to content

Add McBopomofo plugin for macOS - #531

Merged
eagleoflqj merged 2 commits into
fcitx-contrib:masterfrom
sonnytf:feat/mcbopomofo
Nov 18, 2026
Merged

eagleoflqj merged 2 commits into
fcitx-contrib:masterfrom
sonnytf:feat/mcbopomofo

Conversation

@sonnytf

@sonnytf sonnytf commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Adds openvanilla/fcitx5-mcbopomofo (faa497211bd771a1190235dd7faa9ae384799b2b) support for macOS (arm64 and x86_64).

Changes

  • Submodule & Patch (fcitx5-mcbopomofo, patches/mcbopomofo.patch):
    • Pin fcitx5-mcbopomofo submodule at faa497211bd771a1190235dd7faa9ae384799b2b.
    • Fix PO_DIRECTORY paths (${CMAKE_CURRENT_SOURCE_DIR}) for subdirectory builds inside fcitx5-plugins.
    • Link fmt::fmt and PkgConfig::JSONC cleanly to McBopomofoLib and mcbopomofo.
    • Apply macOS WebPanel state-update ordering fix in src/McBopomofo.cpp (updateUserInterface after clearing/updating clientPreedit, preedit, and auxDown to avoid stale/empty candidate boxes).
  • Isolated Static Dependencies (scripts/install-mcbopomofo-deps.sh, .github/workflows/macos.yml, CMakeLists.txt):
    • Build static json-c (0.18-20240915) and icu4c (77-1, including --with-cross-build host tools for x86_64 on xcode-27) into an isolated prefix (build/macos-${arch}/mcbopomofo-deps/usr) so it does not overwrite keyman-core's bundled icu_73 in build/macos-${arch}/usr.
    • Guard MCBOPOMOFO under if (APPLE) in CMakeLists.txt and pass -DMCBOPOMOFO=OFF in .github/workflows/windows.yml.
  • Packaging (scripts/install.sh):
    • Enable mcbopomofo in macos targets and package both mcbopomofo and mcbopomofo-plain input methods into mcbopomofo-{arm64,x86_64,any}.tar.bz2.

Verification (on fork CI & live fcitx5-macos)

  • Built and verified both arm64 and x86_64 artifacts on GitHub Actions (macos, windows, and js builds passed; otool -L confirmed zero /opt/homebrew or /usr/local dynamic dependencies).
  • Verified mcbopomofo-arm64.tar.bz2 + mcbopomofo-any.tar.bz2 live on fcitx5-macos.

Summary by CodeRabbit

  • New Features
    • Added McBopomofo and PlainBopomofo input methods on supported platforms, including candidate selection and date macros.
  • Bug Fixes
    • Improved input-panel updates to clear outdated preedit text and auxiliary information when composing or committing text.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The pull request adds McBopomofo as a buildable and installable plugin. It adds ICU and JSON-C dependencies, adapts the subproject’s build and input-state code, updates platform build settings, and adds Playwright tests for both input methods and date macros.

Changes: McBopomofo integration

Layer / File(s) Summary
Source and dependency setup
.gitmodules, fcitx5-mcbopomofo, scripts/install-deps.sh
The project adds the fcitx5-mcbopomofo submodule and adds ICU and JSON-C to the macOS and JavaScript dependency lists. The installer extracts those archives to a separate dependency prefix.
Subproject build and input state updates
patches/mcbopomofo.patch
The patch adjusts translation paths and library links. It changes preedit and input-panel update behavior for several input states, clears stale preedit or auxiliary text in specified states, and changes iterator declarations without changing parsing logic.
CMake and workflow integration
CMakeLists.txt, .github/workflows/js.yml, .github/workflows/macos.yml, .github/workflows/windows.yml
CMake adds an enabled-by-default McBopomofo option and configures its dependency paths. The macOS and JavaScript build workflows apply the patch; the Windows workflow disables the option.
Plugin packaging and input tests
scripts/install.sh, tests/test-mcbopomofo.spec.ts
The installer adds the plugin to macOS and JavaScript plugin lists, extracts ICU for the plugin, and packages both input methods on non-Windows platforms. Playwright tests cover McBopomofo input, PlainBopomofo candidate selection, and date-macro candidates.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Possibly related PRs

Suggested reviewers: eagleoflqj

Merge Risk: Minimal · up to cf0f0

This adds the McBopomofo plugin for macOS and JS builds. It is disabled on Windows. No concrete defect was established. The one remaining unknown is whether the prebuilt ICU data archive supports date conversion on clean installs, and the author's live verification suggests it does.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Add McBopomofo plugin for macOS" matches the main change. The PR adds macOS support for the fcitx5-mcbopomofo plugin, including the submodule, the macOS build workflow, dependency builds, a…
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.
Full details: Title check

Explanation

The title "Add McBopomofo plugin for macOS" matches the main change. The PR adds macOS support for the fcitx5-mcbopomofo plugin, including the submodule, the macOS build workflow, dependency builds, and packaging of mcbopomofo and mcbopomofo-plain. The title omits the JS and Windows-related CMake and workflow edits, but those are secondary to the primary change.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 17ee5708-aa13-437d-8663-c131b7dbfa8b
Commits

Reviewing files that changed from the base of the PR and between 5a36301 and cf0f039.

Files selected for processing: 10

  • .github/workflows/js.yml
  • .github/workflows/macos.yml
  • .github/workflows/windows.yml
  • .gitmodules
  • CMakeLists.txt
  • fcitx5-mcbopomofo
  • patches/mcbopomofo.patch
  • scripts/install-deps.sh
  • scripts/install.sh
  • tests/test-mcbopomofo.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@eagleoflqj

Copy link
Copy Markdown
Member

The artifact works with fcitx5-macos, nice job!
I'll take on this PR, mainly

Once it is merged, I'll update fcitx5-macos to include the plugin and fix the User Data button issue.

@eagleoflqj eagleoflqj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM
Feel free to add an entry here so that your avatar appears in the main repo as well. Note: the plugin is a native addon and depends on chineseAddons (for traditional simplified Chinese conversion).

@eagleoflqj
eagleoflqj merged commit 46bdc81 into fcitx-contrib:master Nov 18, 2026
13 of 16 checks passed
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.

2 participants