fix: block combo signals during project creation to prevent old project flash - #170
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new project_switched wiring bypasses existing project-switch handling and the emitted index should be synchronized with the combo’s actual selected index.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR fixes a brief UI “flash” of the previously selected project during new-project creation by preventing intermediate currentIndexChanged emissions while the project combo box is being refreshed.
Changes:
- Adds a
project_switchedsignal and blocks combo-box signals aroundmodel.select()+setCurrentIndex()during project creation. - Hooks the new signal into
StanPresenterto trigger a single UI refresh after the combo update completes.
File summaries
| File | Description |
|---|---|
src/openstan/presenters/project_presenter.py |
Blocks combo signals during _finalise_project_add and emits a dedicated post-switch signal. |
src/openstan/presenters/stan_presenter.py |
Connects the new post-switch signal into the presenter to refresh current-project UI. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 2
- 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
167-ui-existing-project-visible
branch
from
August 28, 2026 09:54
b2e51c5 to
a7deabd
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.
Summary
When creating a new project, the old project’s info was briefly visible before the new project selection fired and updated the UI. This was caused by
model.select()in_finalise_project_addtriggeringcurrentIndexChangedwith an intermediate index while the combo box re-queried the database.Changes
project_presenter.py: Addedproject_switchedsignal and wrappedmodel.select()+setCurrentIndex()in a signal-blocking block to prevent intermediate index emissions. Emitsproject_switchedafter unblocking to trigger a single, clean UI update.stan_presenter.py: Connectedproject_switchedtoupdate_current_project_info.This follows the same pattern used in
admin_presenter.py:refresh_combosfor signal blocking.Testing
ruff check— cleanruff format --check— cleanpyrefly check— clean (0 errors)pytest— 146/146 passedCloses #167