Skip to content

fix: block combo signals during project creation to prevent old project flash - #170

Merged
boscorat merged 1 commit into
masterfrom
167-ui-existing-project-visible
Aug 28, 2026
Merged

fix: block combo signals during project creation to prevent old project flash#170
boscorat merged 1 commit into
masterfrom
167-ui-existing-project-visible

Conversation

@boscorat

Copy link
Copy Markdown
Owner

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_add triggering currentIndexChanged with an intermediate index while the combo box re-queried the database.

Changes

  • project_presenter.py: Added project_switched signal and wrapped model.select() + setCurrentIndex() in a signal-blocking block to prevent intermediate index emissions. Emits project_switched after unblocking to trigger a single, clean UI update.
  • stan_presenter.py: Connected project_switched to update_current_project_info.

This follows the same pattern used in admin_presenter.py:refresh_combos for signal blocking.

Testing

  • ruff check — clean
  • ruff format --check — clean
  • pyrefly check — clean (0 errors)
  • pytest — 146/146 passed

Closes #167

@boscorat boscorat linked an issue Aug 27, 2026 that may be closed by this pull request
@boscorat
boscorat requested a lite review from Copilot August 27, 2026 20:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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_switched signal and blocks combo-box signals around model.select() + setCurrentIndex() during project creation.
  • Hooks the new signal into StanPresenter to 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.

Comment thread src/openstan/presenters/stan_presenter.py Outdated
Comment thread src/openstan/presenters/project_presenter.py Outdated
@boscorat
boscorat force-pushed the 167-ui-existing-project-visible branch from b2e51c5 to a7deabd Compare August 28, 2026 09:54
@boscorat
boscorat merged commit 5bfaa70 into master Aug 28, 2026
2 checks passed
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.

UI existing project visible

2 participants