Hardcode AC_mouse_* aliases and sync executor command surface#179
Merged
Hardcode AC_mouse_* aliases and sync executor command surface#179
Conversation
The AC_mouse_left/right/middle aliases all delegated to click_mouse and
required mouse_keycode anyway, so the alias name was misleading. Worse,
stop_record() recorded them as {"mouse_keycode": "AC_mouse_left", ...},
which is not a valid keycode in the mouse table — recorded JSON could
not be replayed. Bind each alias to its hardcoded button and drop the
keycode from the recorder output so record/replay round-trips cleanly.
Other cleanups:
- Use default_shell_manager singleton in both action and callback
executors instead of constructing a fresh ShellManager per import.
- Remove the duplicate screenshot() in auto_control_image.py — it was
never imported and shadowed the canonical one in auto_control_screen.
- Add the ~25 commands that were registered but missing from the README
command tables (window, flow control, history, MCP, etc.).
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | -38 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Sonar flagged 39.8% duplication on the previous commit because the three single-button click adapters were defined identically in both action_executor.py and callback_function_executor.py. Generate them once in utils/executor/mouse_aliases.py via a small factory and have both executors import the same callables.
Sonar's per-file view on PR 179 showed two clusters of duplication: - The three AC_mouse_* registration lines were duplicated between action_executor.py and callback_function_executor.py. Move the three name->callable bindings into a MOUSE_BUTTON_COMMANDS dict on mouse_aliases.py and spread it (**) into both executors so the registration block exists in exactly one place. - The html / json / xml report smoke scripts were near-100% copies of each other. Extract the shared driver into report_smoke.py and reduce each script to a one-liner that names its report command.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
AC_mouse_left/right/middlenow hardcode their button. Previously they delegated toclick_mouseand still requiredmouse_keycode, so the alias name was misleading andstop_record()recorded{"mouse_keycode": "AC_mouse_left", ...}— a value not present in the mouse keycode table, which made recorded JSON unreplayable.default_shell_managersingleton instead of each constructing a freshShellManagerat import time.screenshot()inwrapper/auto_control_image.py(the canonical one lives inwrapper/auto_control_screen.py).AC_set_record_enable,AC_get_*_table,AC_add_package_to_*.test/unit_test/to match the new alias signature; also fixed a latent bug in those fixtures that passed the AC-prefixed name as a keycode toAC_press_mouse/AC_release_mouse.Test plan
py -m pytest test/unit_test/headless/ test/unit_test/flow_control/— 278 passedpy -m ruff checkon the changedje_auto_control/files — zero warningsimport je_auto_controlkeeps the package Qt-free (noPySide6modules loaded)default_shell_manager(event_dict['AC_shell_command'].__self__ is default_shell_manager)