custom phrase paging#384
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds pagination support to ChangesCustomPhrase Pagination, FooterView isSheet, and Appium Tests
fcitx5 Submodule Update
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
appium/test_custom_phrase.py (1)
107-108: ⚡ Quick winStabilize sheet-close verification with an explicit wait and helper reuse.
Lines 107-108 assert immediately after click; sheet dismissal is asynchronous and may intermittently fail. Reuse
close_sheetand wait untilKeywordfields disappear.🤖 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 `@appium/test_custom_phrase.py` around lines 107 - 108, Replace the direct click on the CloseSheet element with a call to the close_sheet helper function to properly handle sheet dismissal. Instead of immediately asserting that Keyword elements count is zero after the click, add an explicit wait that polls until all Keyword elements disappear before performing the assertion. This ensures the asynchronous sheet dismissal completes before verification, eliminating intermittent failures.appium/conftest.py (1)
81-81: ⚡ Quick winUse graceful pre-cleanup instead of unconditional SIGKILL.
Line 81 force-kills all
FcitxTestAppprocesses, which is brittle in shared/parallel test environments. Prefer graceful termination and non-fatal execution.Proposed change
- subprocess.run(["pkill", "-9", "FcitxTestApp"]) + subprocess.run( + ["pkill", "-TERM", "-x", "FcitxTestApp"], + check=False, + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, + )🤖 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 `@appium/conftest.py` at line 81, The subprocess.run call that kills FcitxTestApp processes uses the -9 flag (SIGKILL) which force-terminates without cleanup. Replace this with graceful termination by removing the -9 flag (which defaults to SIGTERM) and wrap the subprocess.run call in a try-except block to catch any exceptions and pass silently, making the cleanup non-fatal so that test failures in pkill do not cause the test suite to fail. This ensures processes are terminated gracefully in parallel test environments.
🤖 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/CustomPhrase.swift`:
- Around line 67-75: The currentPageSlice computed property's set closure
recomputes currentPageItems at write time, which can change if currentPage is
modified between the get and set operations, causing edits to land in wrong
rows. Stabilize the page range by capturing currentPageItems once when the
binding is created and use that captured value in both the get and set closures
instead of re-evaluating currentPageItems inside the set closure.
---
Nitpick comments:
In `@appium/conftest.py`:
- Line 81: The subprocess.run call that kills FcitxTestApp processes uses the -9
flag (SIGKILL) which force-terminates without cleanup. Replace this with
graceful termination by removing the -9 flag (which defaults to SIGTERM) and
wrap the subprocess.run call in a try-except block to catch any exceptions and
pass silently, making the cleanup non-fatal so that test failures in pkill do
not cause the test suite to fail. This ensures processes are terminated
gracefully in parallel test environments.
In `@appium/test_custom_phrase.py`:
- Around line 107-108: Replace the direct click on the CloseSheet element with a
call to the close_sheet helper function to properly handle sheet dismissal.
Instead of immediately asserting that Keyword elements count is zero after the
click, add an explicit wait that polls until all Keyword elements disappear
before performing the assertion. This ensures the asynchronous sheet dismissal
completes before verification, eliminating intermittent failures.
🪄 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: b9eff8c2-5ede-4a62-8c13-8c30732896b8
📒 Files selected for processing (18)
appium/conftest.pyappium/test_add_input_methods.pyappium/test_boolean.pyappium/test_custom_phrase.pyappium/test_entry.pyappium/test_group.pyappium/util/boolean.pyappium/util/button.pyappium/util/window.pyassets/zh-Hans.lproj/Localizable.stringsassets/zh-Hant.lproj/Localizable.stringsfcitx5src/config/Advanced.swiftsrc/config/CustomPhrase.swiftsrc/config/ExternalView.swiftsrc/config/FooterView.swiftsrc/config/InputMethod.swiftsrc/config/SplitConfig.swift
arm64 comparisonNo difference. x86_64 comparisonNo difference. |
Summary by CodeRabbit
New Features
Bug Fixes
Tests