-
Notifications
You must be signed in to change notification settings - Fork 16
Implements the feature to input Roman numbers #210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
zonble
commented
Oct 26, 2025
- The PR ports the feature to input Roman numbers from the macOS version. See Add Roman numeral input support McBopomofo#720
- Related test cases are added.
- Also fine-tunes the logic to handle the additional page up and down keys
A user can trigger the feature by pressing Ctrl + \ keys.
The FcitxKey_KP_Up and FcitxKey_KP_Down settings may conflict with the keys, so we should handle the additional page up and down keys first.
Summary of ChangesHello @zonble, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the input method by introducing the capability to input and convert Roman numerals. This feature, originally from the macOS version, is now integrated, providing users with more versatile number input options. Additionally, the PR includes improvements to candidate list navigation, making the overall input experience smoother. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ports the Roman numeral input feature from the macOS version of McBopomofo, adding the ability to input Roman numerals in three styles (alphabets, full-width uppercase, and full-width lowercase). The implementation includes a new RomanNumbers library with conversion logic, integration into the input state machine, and comprehensive test coverage.
Key Changes:
- Added new RomanNumbers library with conversion utilities and test cases
- Integrated Roman numeral input states into the key handling and UI rendering pipeline
- Refactored page navigation logic to fix timing issues with additional page up/down keys
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/RomanNumbers/RomanNumbers.cpp | Core conversion logic for Roman numerals with support for three output styles |
| src/RomanNumbers/RomanNumbers.h | Public API for Roman numeral conversion functions |
| src/RomanNumbers/RomanNumbersTest.cpp | Test suite covering conversion edge cases for all three styles |
| src/RomanNumbers/CMakeLists.txt | Build configuration for the RomanNumbers library |
| src/InputState.h | Added RomanNumber state and registered it in SelectingFeature |
| src/KeyHandler.h | Declared handler for RomanNumber input state |
| src/KeyHandler.cpp | Implemented RomanNumber key handling with digit input and conversion |
| src/McBopomofo.h | Declared UI rendering handler for RomanNumber state |
| src/McBopomofo.cpp | Implemented preedit rendering and moved page navigation logic earlier |
| src/CMakeLists.txt | Added RomanNumbers subdirectory and library linkage |
| src/ChineseNumbers/CMakeLists.txt | Fixed incorrect target reference in clang-tidy configuration |
| src/ChineseNumbers/ChineseNumbersTest.cpp | Renamed test cases for improved clarity |
| src/ChineseNumbers/SuzhouNumbersTest.cpp | Renamed test cases for improved clarity |
| CMakeLists.txt | Commented out data subdirectory |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
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 successfully implements the feature for inputting Roman numerals, complete with different styles and corresponding tests. The code is generally well-structured. My review includes several suggestions to enhance code clarity, minimize redundancy, and align with modern C++ conventions. I've highlighted areas where switch statements could be implemented more safely, where superfluous code can be eliminated, and where contemporary C++ library functions would be more appropriate. Additionally, I've identified some minor issues in the new header file and a missing newline at the end of a file. The adjustments to the page up/down key handling also appear to be well-executed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lukhnos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks! I left two comments below.