Skip to content

Update the recent project history when opening projects#1329

Merged
amilcarlucas merged 1 commit intomasterfrom
update_recent_vehicle_history
Mar 1, 2026
Merged

Update the recent project history when opening projects#1329
amilcarlucas merged 1 commit intomasterfrom
update_recent_vehicle_history

Conversation

@amilcarlucas
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings February 26, 2026 23:37
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

Updates project-opening behavior so that opening a vehicle directory also records it in the “recently used” history (handled by the business layer rather than the UI).

Changes:

  • Persist “recently used vehicle directory” history when VehicleProjectManager.open_* succeeds.
  • Expand data-model tests to assert history is recorded on success and not recorded on failure.
  • Add frontend tests intended to ensure the view doesn’t write recent-history directly.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tests/test_frontend_tkinter_project_opener.py Adds UI-layer tests asserting history isn’t updated directly by the view.
tests/test_data_model_vehicle_project.py Updates manager tests to expect history updates on successful opens and no updates on failures.
ardupilot_methodic_configurator/data_model_vehicle_project.py Implements history recording inside open_vehicle_directory / open_last_vehicle_directory.

Comment on lines 919 to 922
# Act: Complete workflow – the manager method is responsible for
# updating the history, so we don't call store_recently_used_vehicle_dir
# explicitly here.
vehicle_path = manager.open_vehicle_directory("/vehicle/path")
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

manager.open_vehicle_directory(...) now calls store_recently_used_vehicle_dir(...) internally, which (by default) delegates to LocalFilesystem.store_recently_used_vehicle_dir(...). If this test doesn’t patch/stub that history-writing path in its setup, it may introduce real filesystem/config side effects and become flaky. Patch manager.store_recently_used_vehicle_dir (or LocalFilesystem.store_recently_used_vehicle_dir) in this workflow test and assert it was called with vehicle_path.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 27, 2026

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
11500 10473 91% 89% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
ardupilot_methodic_configurator/backend_filesystem_program_settings.py 97% 🟢
ardupilot_methodic_configurator/data_model_vehicle_project.py 97% 🟢
ardupilot_methodic_configurator/data_model_vehicle_project_creator.py 100% 🟢
ardupilot_methodic_configurator/data_model_vehicle_project_opener.py 96% 🟢
TOTAL 98% 🟢

updated for commit: 5339f33 by action🐍

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 27, 2026

Test Results

    2 files  ±0      2 suites  ±0   28m 15s ⏱️ -15s
3 017 tests +3  3 012 ✅ +3   5 💤 ±0  0 ❌ ±0 
6 034 runs  +6  6 024 ✅ +6  10 💤 ±0  0 ❌ ±0 

Results for commit 5339f33. ± Comparison against base commit e991dd6.

This pull request removes 2 and adds 5 tests. Note that renamed tests count towards both.
tests.test_data_model_vehicle_project_creator.TestVehicleProjectCreationWorkflow ‑ test_recently_used_directories_are_stored_after_successful_creation
tests.test_data_model_vehicle_project_opener.TestVehicleDirectoryOpening ‑ test_recently_used_directory_is_stored_after_successful_opening
tests.test_data_model_vehicle_project.TestDirectoryAndPathOperations ‑ test_creation_does_not_store_vehicle_dir_in_history
tests.test_data_model_vehicle_project.TestDirectoryAndPathOperations ‑ test_creation_updates_recent_history
tests.test_data_model_vehicle_project_creator.TestVehicleProjectCreationWorkflow ‑ test_creator_does_not_store_history_itself
tests.test_frontend_tkinter_project_opener.TestVehicleProjectOpenerWindow ‑ test_view_does_not_update_history_directly_when_opening_last
tests.test_frontend_tkinter_project_opener.TestVehicleProjectOpenerWindow ‑ test_view_does_not_update_history_directly_when_opening_manual

♻️ This comment has been updated with latest results.

@amilcarlucas amilcarlucas force-pushed the update_recent_vehicle_history branch from 15c51f5 to f5439bd Compare February 27, 2026 11:41
@amilcarlucas amilcarlucas requested a review from Copilot February 27, 2026 11:42
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 3 out of 3 changed files in this pull request and generated 1 comment.

Do not update history directly from the view when user selects a directory manually.

When the user picks an arbitrary existing vehicle directory through the selection widgets
the window should not update the history the manager is responsible for that.
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Missing punctuation between 'history' and 'the manager'. Add a semicolon, period, or em dash for clarity.

Suggested change
the window should not update the history the manager is responsible for that.
the window should not update the history; the manager is responsible for that.

Copilot uses AI. Check for mistakes.
@amilcarlucas amilcarlucas force-pushed the update_recent_vehicle_history branch from 623f0d5 to 5339f33 Compare March 1, 2026 20:42
@amilcarlucas amilcarlucas merged commit a9f5a87 into master Mar 1, 2026
31 of 34 checks passed
@amilcarlucas amilcarlucas deleted the update_recent_vehicle_history branch March 1, 2026 21:10
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