Merged
Conversation
Adds a collection of shields and badges to the README to surface repository metadata and CI/quality status. Badges include license, top language, Python version (3.14.0), repo size, contributors, last commit, issues, pull requests, forks, stars, watchers, latest release and release date, plus CI build and Codacy grade. Visual separators (---) were added to group badge sections and improve header presentation.
Update minimum versions in requirements.txt: pyinstaller upgraded to >=6.19.0 and pyinstaller-hooks-contrib to >=2026.0. This ensures the project uses newer PyInstaller tooling and hook updates; other requirements remain unchanged.
Replace Write-Host with Write-Output in build.ps1 so the final build message goes to the PowerShell pipeline/standard output rather than directly to the host. This allows the message to be redirected or captured (useful for CI/logging) without changing the reported path or other behavior.
Add blank lines around headings, lists, and code blocks in README.md to improve readability and visual separation between sections (Features, Structure, Quick start, Save & config, Default hotkeys). No functional content changes.
Extract helper methods in App to handle deletion checks, perform deletion and log results (_can_delete_events, _perform_deletion, _log_deletion_result). This centralizes deletion flow, clarifies logging, and ensures preview is updated after deletions. Replace large if/elif block in Player with a handler dispatch and separate methods for each event type (_handle_key_down, _handle_key_up, _handle_mouse_click, _handle_mouse_scroll, _handle_mouse_move) to improve readability and maintainability without changing behavior.
Annotate the local `handler` variable in Player.player to provide an explicit Callable union type when retrieving from the handlers mapping. This is a typing-only change to satisfy the type checker; there is no runtime behavioral change—handler is still looked up and invoked if present.
Split App._build_ui into smaller helper methods (_build_control_bar, _build_repeat_frame, _build_preview_tree, _build_log_area, _build_hotkey_editor) and added docstrings/return type hints. This improves readability and separates construction of the control bar, repeat input, preview tree, log area, and hotkey editor without changing behavior.
Explicitly initialize UI widget attributes (buttons, entry, treeview, log_text, repeat_var) and hotkey_labels in App.__init__ with type hints to avoid mypy/pylint complaints and potential attribute errors. Removed the duplicate hotkey_labels initialization from the hotkey frame builder. No functional behavior changes intended; this is a static typing / robustness cleanup.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR merges dev into master, focusing on refactoring the Tkinter UI construction and event-handling code to improve readability/organization, along with documentation and small build-script tweaks.
Changes:
- Refactors
App._build_uiinto smaller UI-builder methods and extracts deletion logic into helpers. - Refactors
Player._apply_eventinto a dispatch-based implementation with per-event handlers. - Updates documentation (badges) and adjusts build script output; bumps PyInstaller-related requirements.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| requirements.txt | Updates minimum versions for PyInstaller and hooks contrib. |
| pymacrorecorder/player.py | Replaces if/elif chain with handler dispatch + helper methods for event playback. |
| pymacrorecorder/app.py | Splits UI construction into focused methods; refactors deletion flow into helpers. |
| build.ps1 | Uses Write-Output for the completion message. |
| README.md | Adds a badge section and minor formatting tweaks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Annotate handlers in Player with dict[str, Callable[[dict], None]] and replace the previous long union type for handler with Optional[Callable[[dict], None]]. This clarifies the expected payload signature, improves readability and static type checking without changing runtime behavior. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Change the README Python badge from a specific 3.14.0 value to a minimum requirement of >=3.10 to reflect supported Python versions. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Fix deletion logging when removing selected events from the preview. Previously the code logged len(indexes) which could count selections that were out-of-range and not actually removed. This change adds a deleted_count that is incremented only when an event is popped and passes that value to _log_deletion_result so the logged count matches the real number of deletions.
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.
This pull request improves code organization and readability in the
pymacrorecorderapplication, especially in the UI construction and event handling logic. It also enhances the project documentation with informative badges and minor usability tweaks.Code refactoring and maintainability:
pymacrorecorder/app.pyby splitting_build_uiinto smaller, focused methods (_build_control_bar,_build_repeat_frame,_build_preview_tree,_build_log_area,_build_hotkey_editor), each with clear docstrings. This makes the codebase easier to maintain and extend. [1] [2] [3]pymacrorecorder/app.pyby extracting checks and operations into_can_delete_events,_perform_deletion, and_log_deletion_resulthelper methods, clarifying responsibilities and improving readability.Event handling improvements:
_apply_eventinpymacrorecorder/player.pyto use a handler dispatch dictionary and moved each event type’s logic into its own method (_handle_key_down,_handle_key_up,_handle_mouse_click,_handle_mouse_scroll,_handle_mouse_move), making the code more modular and easier to extend. [1] [2]Documentation and usability:
README.mdwith project badges for license, language, Python version, repo size, contributors, commit status, issues, pull requests, forks, stars, watchers, releases, build status, and code quality, making project status and metadata more visible to users and contributors.build.ps1by usingWrite-Outputinstead ofWrite-Hostfor build completion messages, which improves script output handling.Documentation clarity: