Skip to content

feat(screenshots): Updated application screenshots#1558

Merged
amilcarlucas merged 1 commit into
masterfrom
automated_app_screenshots
Apr 27, 2026
Merged

feat(screenshots): Updated application screenshots#1558
amilcarlucas merged 1 commit into
masterfrom
automated_app_screenshots

Conversation

@amilcarlucas
Copy link
Copy Markdown
Collaborator

@amilcarlucas amilcarlucas commented Apr 27, 2026

Description

This updates the repository’s application screenshots and adds a fully automated script to regenerate them from live Tkinter windows.

  • Added scripts/regenerate_app_screenshots_fully_automated.py to capture AMC UI windows via Tk + pyautogui and save them under images/.
  • Refreshed multiple images/App_screenshot_*.png assets (About, connection, FC info/download, vehicle directory flows).

Checklist

  • Run pre-commit checks locally
  • Verified by a human programmer
  • All commits are signed off (use git commit --signoff)
  • Code follows our coding standards
  • Documentation updated if needed
  • No breaking changes or properly documented

Testing

Describe how you tested these changes:

  • Unit tests pass
  • Integration tests pass
  • Manual testing performed
  • Tested on flight controller hardware

Copilot AI review requested due to automatic review settings April 27, 2026 19:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.py to capture AMC UI windows via Tk + pyautogui and save them under images/.
  • Refreshed multiple images/App_screenshot_*.png assets (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.

Comment thread scripts/regenerate_app_screenshots_fully_automated.py
Comment thread scripts/regenerate_app_screenshots_fully_automated.py
Comment thread scripts/regenerate_app_screenshots_fully_automated.py
Comment thread scripts/regenerate_app_screenshots_fully_automated.py Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
12584 11858 94% 89% 🟢

New Files

No new covered files...

Modified Files

No covered modified files...

updated for commit: c8df7af by action🐍

@github-actions
Copy link
Copy Markdown
Contributor

Test Results

     4 files       4 suites   41m 51s ⏱️
 3 582 tests  3 580 ✅  2 💤 0 ❌
14 120 runs  14 096 ✅ 24 💤 0 ❌

Results for commit a9f97a4.

@amilcarlucas amilcarlucas force-pushed the automated_app_screenshots branch 2 times, most recently from 8c9e0f2 to 3ac6b2f Compare April 27, 2026 20:51
@amilcarlucas amilcarlucas requested a review from Copilot April 27, 2026 21:15
@amilcarlucas amilcarlucas force-pushed the automated_app_screenshots branch from 3ac6b2f to c8df7af Compare April 27, 2026 21:21
@amilcarlucas amilcarlucas merged commit ce3c562 into master Apr 27, 2026
22 of 25 checks passed
@amilcarlucas amilcarlucas deleted the automated_app_screenshots branch April 27, 2026 21:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 20 changed files in this pull request and generated 4 comments.

Comment on lines +501 to +504
browse_button = _find_descendant(
window.connection_selection_widgets.container_frame,
lambda w: _widget_text(w) == "...",
)
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.

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"
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +665 to +668
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))
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +810 to +814
pyautogui.FAILSAFE = True

if not args.vehicle_dir.exists():
logging.error("Vehicle dir does not exist: %s", args.vehicle_dir)
return 1
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
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.

2 participants