Skip to content

Conversation

@zonble
Copy link
Collaborator

@zonble zonble commented Oct 26, 2025

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.
Copilot AI review requested due to automatic review settings October 26, 2025 08:35
@gemini-code-assist
Copy link

Summary of Changes

Hello @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

  • Roman Number Input: Introduced a new feature allowing users to input Roman numerals, ported from the macOS version of the project.
  • Build System Integration: Integrated the new Roman number conversion module into the build system (CMake).
  • Input State Management: Added new input states and key handling logic to manage Roman numeral input and conversion.
  • Test Coverage: Included dedicated test cases for the Roman numeral conversion functionality.
  • Page Navigation Refinement: Fine-tuned the logic for additional page up and down keys in candidate selection.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

Copilot AI left a 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.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

@zonble zonble requested a review from Copilot October 26, 2025 08:54
Copy link

Copilot AI left a 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.

Copy link
Collaborator

@lukhnos lukhnos left a 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.

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.

3 participants