Skip to content

hide AnthyCommandConfig on other platforms - #23

Open
eagleoflqj wants to merge 1 commit into
masterfrom
hide
Open

hide AnthyCommandConfig on other platforms#23
eagleoflqj wants to merge 1 commit into
masterfrom
hide

Conversation

@eagleoflqj

@eagleoflqj eagleoflqj commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes
    • Corrected the command configuration naming for improved consistency.
    • Command settings are now hidden on Android, Apple, and Emscripten platforms where they are unavailable.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The configuration header corrects the misspelled Anthy command configuration type and wraps the command option in a platform-conditional visibility wrapper for Android, Apple, and Emscripten builds.

Changes

Anthy configuration

Layer / File(s) Summary
Corrected command configuration contract
src/config.h
Adds the conditional visibility include, renames AnthyCommnadConfig to AnthyCommandConfig, and hides the command option on Android, Apple, and Emscripten.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is clearly related to the change and captures the new platform-specific hiding behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hide

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 coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/config.h`:
- Around line 678-681: Guard the action handlers in the relevant state/config
command setup, including uses of config().command->addWordCommand and
config().command->dictAdminCommand, so they no-op or are conditionally
unavailable on Android, Apple, and Emscripten, matching ConditionalHidden in the
command declaration and preventing launch_program from receiving empty commands.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f8957272-4494-49b3-9b4f-d20cf5590cb2

📥 Commits

Reviewing files that changed from the base of the PR and between 84bf037 and 7ded11d.

📒 Files selected for processing (1)
  • src/config.h

Comment thread src/config.h
Comment on lines +678 to +681
fcitx::ConditionalHidden < fcitx::isAndroid() || fcitx::isApple() ||
fcitx::isEmscripten(),
fcitx::Option < AnthyCommandConfig >>
command{this, "Command", _("Command")};);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Downstream consumers unconditionally dereference config().command.

ConditionalHidden only affects UI visibility, so the option object should still exist on hidden platforms. However, src/state.cpp lines 1412-1422 unconditionally dereference config().command->addWordCommand and config().command->dictAdminCommand and launch them as programs. On Android/Apple/Emscripten these commands will likely be empty/default and launch_program on an empty string may fail or produce unexpected behavior.

Consider guarding those action handlers so they no-op (or are themselves conditionally hidden) on platforms where the command config is hidden.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/config.h` around lines 678 - 681, Guard the action handlers in the
relevant state/config command setup, including uses of
config().command->addWordCommand and config().command->dictAdminCommand, so they
no-op or are conditionally unavailable on Android, Apple, and Emscripten,
matching ConditionalHidden in the command declaration and preventing
launch_program from receiving empty commands.

@eagleoflqj
eagleoflqj requested a review from wengxt July 9, 2026 22:31
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