fix: close results view before switching projects - #165
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new guard runs on all update_current_project_info() calls (including project_db_updated), which can close the Results panel even when no project switch occurred, diverging from the stated intent and potentially causing surprising UI behavior.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Fixes a UI navigation lock-up where switching projects while the Results panel is active (pending batch/import flow) can leave navigation buttons disabled by ensuring the Results panel is closed before proceeding with the project update.
Changes:
- Added a guard in
StanPresenter.update_current_project_info()to detect the active Results view and callhide_results()before switching project state.
File summaries
| File | Description |
|---|---|
| src/openstan/presenters/stan_presenter.py | Ensures Results panel is closed (re-enabling nav) before project switch logic runs. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
boscorat
force-pushed
the
160-bug-switching-projects-with-pending-batch
branch
from
August 26, 2026 19:52
5af9287 to
2f42112
Compare
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.
Fixes #160 — switching projects while a batch import is pending no longer disables all navigation buttons.
Problem
When the results view is active (import running or batch not yet committed/abandoned),
show_results()disables all four nav buttons. Switching projects via the combo box never re-enabled them, leaving the user stuck until restart.Fix
Added a guard at the top of
StanPresenter.update_current_project_info()that checks if the results view is the active content panel and, if so, callshide_results()to re-enable nav buttons and navigate back to the Import panel before proceeding with the project switch.This is safe because:
hide_results()re-enables nav and navigates to Import — exactly the reset neededclear_for_project_change()(called shortly after) clears in-memory results for the old projectTesting
ruff check,ruff format --check,pyrefly check— all pass