feat(screenshots): Updated application screenshots#1558
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the repository’s application screenshots and adds a fully automated script to regenerate them from live Tkinter windows.
Changes:
- Added
scripts/regenerate_app_screenshots_fully_automated.pyto capture AMC UI windows via Tk +pyautoguiand save them underimages/. - Refreshed multiple
images/App_screenshot_*.pngassets (About, connection, FC info/download, vehicle directory flows).
Reviewed changes
Copilot reviewed 1 out of 20 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/regenerate_app_screenshots_fully_automated.py | New automation script to deterministically generate screenshots by instantiating UI windows and capturing screen regions. |
| images/App_screenshot_about.png | Updated About window screenshot. |
| images/App_screenshot_FC_connection.png | Updated connection selection screenshot. |
| images/App_screenshot_FC_info_and_param_download.png | Updated FC info/parameter download screenshot. |
| images/App_screenshot_Vehicle_directory.png | Updated vehicle directory opener screenshot. |
| images/App_screenshot_Vehicle_directory10.png | Updated (legacy/variant) vehicle directory opener screenshot. |
| images/App_screenshot_Vehicle_directory11.png | Updated vehicle directory creator screenshot. |
| images/App_screenshot_Vehicle_directory_vehicle_params2.png | Updated vehicle directory creator “vehicle params” flow screenshot. |
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified FilesNo covered modified files...
|
Test Results 4 files 4 suites 41m 51s ⏱️ Results for commit a9f97a4. |
8c9e0f2 to
3ac6b2f
Compare
3ac6b2f to
c8df7af
Compare
| browse_button = _find_descendant( | ||
| window.connection_selection_widgets.container_frame, | ||
| lambda w: _widget_text(w) == "...", | ||
| ) |
There was a problem hiding this comment.
This code assumes VehicleProjectOpenerWindow has connection_selection_widgets.container_frame. If that attribute doesn’t exist for the opener window (the name strongly suggests it belongs to the connection UI, not the project opener), this will raise AttributeError and prevent screenshot generation. Prefer searching from window.root (or the opener-specific container frame) and/or guard the attribute access with an explicit error that reports the available widget tree, so failures are deterministic and easier to diagnose.
|
|
||
| failures: list[str] = [] | ||
| for target in TARGETS: | ||
| output_path = args.images_dir / target.filename if args.overwrite else args.images_dir / f"{target.filename}.new.png" |
There was a problem hiding this comment.
When --overwrite is not set, this produces filenames like App_screenshot_about.png.new.png (double extension), which is awkward to reason about and can confuse tooling that keys off .png. Consider inserting .new before the suffix (e.g., App_screenshot_about.new.png) by using Path suffix handling (with_suffix) rather than string concatenation.
| if prev_gui_complexity is not None: | ||
| ProgramSettings.set_setting("gui_complexity", prev_gui_complexity) | ||
| if prev_usage_popup is not None: | ||
| ProgramSettings.set_display_usage_popup("parameter_editor", bool(prev_usage_popup)) |
There was a problem hiding this comment.
The restoration logic only runs when the previous values are non-None. If get_setting(...) returns None to mean “unset”, this script will leave a persistent setting behind (it sets values unconditionally, but may not revert them). To truly avoid side effects, restore the prior state in all cases—either by clearing/unsetting the key when the previous value was None, or by using a ProgramSettings API that restores defaults/removes keys.
| pyautogui.FAILSAFE = True | ||
|
|
||
| if not args.vehicle_dir.exists(): | ||
| logging.error("Vehicle dir does not exist: %s", args.vehicle_dir) | ||
| return 1 |
There was a problem hiding this comment.
Because this relies on pyautogui.screenshot(...), it will fail in headless environments (no active display / missing permissions). Adding an early, explicit environment check (e.g., for an available GUI display on Linux or a clear import/runtime check around screenshot capability) with a targeted error message would make CI failures and user runs much easier to diagnose.
Description
This updates the repository’s application screenshots and adds a fully automated script to regenerate them from live Tkinter windows.
Checklist
git commit --signoff)Testing
Describe how you tested these changes: