Skip to content

App query change #5562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 27, 2025
Merged

App query change #5562

merged 9 commits into from
Mar 27, 2025

Conversation

willmcgugan
Copy link
Collaborator

@willmcgugan willmcgugan commented Feb 19, 2025

This hopefully fixes a common gotcha.

Previously when you do app.query it will query the active screen. This is completely reasonable from a definitional POV. But it is a frequent source of confusion because when you push a screen, previously working queries now fail.

This change ensures that app.query queries the screen that was composed by the App itself, i.e. the default screen. So it always queries the same screen. If you do want to query the current screen it is as simple as app.screen.query.

This shouldn't impact many apps, because as soon as devs run in to the query broken by push_screen gotcha, we advise them to be explicit about screens anyway.

@willmcgugan
Copy link
Collaborator Author

@darrenburns Any thoughts on this one?

@darrenburns
Copy link
Member

I think this is a better approach!

@willmcgugan
Copy link
Collaborator Author

On hold for a future major bump. I'm expecting at least one more bug fix release in the interim

@willmcgugan willmcgugan merged commit 8ca3a1b into main Mar 27, 2025
23 checks passed
@willmcgugan willmcgugan deleted the app-query-change branch March 27, 2025 14:05
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