Save GUI values inbetween sessions#954
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces persistent, per-tab GUI state stored in state.json so that most user-adjustable controls restore their last-used values across application restarts, along with a settings-tab “reset to defaults” action.
Changes:
- Added a
TabStateabstraction to persist/restore Gradio component values per tab, including validation against bounds/choices. - Extended
settings.pywith a nested"tab-settings"store and atomic state writes. - Updated GUI tabs to build components through
TabState.persist()and added tests covering persistence/validation/reset behavior.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/gui/test_state.py | New tests for per-tab persistence, validation rules, and reset behavior. |
| birdnet_analyzer/settings.py | Adds tab-scoped settings storage, corrupted-state fallback, and atomic state writes. |
| birdnet_analyzer/lang/en.json | Adds localized strings for the reset UI. |
| birdnet_analyzer/gui/state.py | New persistence layer (TabState) plus reset support. |
| birdnet_analyzer/gui/utils.py | Wires persistence into shared GUI builders and adds reset button in settings UI. |
| birdnet_analyzer/gui/train.py | Persists training tab controls and ensures initial UI state reflects persisted values. |
| birdnet_analyzer/gui/species.py | Persists species tab filename input and passes TabState into shared builders. |
| birdnet_analyzer/gui/single_file.py | Persists single-file tab settings and passes TabState into shared builders. |
| birdnet_analyzer/gui/segments.py | Persists segments tab controls. |
| birdnet_analyzer/gui/search.py | Persists embeddings-search controls (crop mode, overlap, etc.). |
| birdnet_analyzer/gui/review.py | Persists review tab autoplay option. |
| birdnet_analyzer/gui/multi_file.py | Persists multi-file tab output options and computing settings. |
| birdnet_analyzer/gui/evaluation.py | Persists evaluation tab controls, including metrics toggles. |
| birdnet_analyzer/gui/embeddings.py | Persists embeddings tab preprocessing/computing controls. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.