Skip to content

Fix: Updated reset configuration to use dialog instead of popover which now closes on X button click, Submit Button Now Resets Widgets to default values by clearing config. #1792

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

Closed
wants to merge 1 commit into from

Conversation

Vamshi-Microsoft
Copy link
Contributor

Updated reset configuration to use dialog instead of popover which now closes on X button click, Submit Button Now Resets Widgets to default values by clearing config.

Does this introduce a breaking change?

  • Yes
  • No
    This pull request refactors the reset configuration functionality in 04_Configuration.py to improve user experience and code readability. The main change replaces the previous popover-based implementation with a dialog-based approach using st.dialog. Additional adjustments streamline the reset process and enhance session state handling.

Refactoring and User Experience Improvements:

  • Replaced the popover-based reset configuration UI with a dialog-based implementation using st.dialog, providing a more intuitive and consistent user interface for resetting configurations.
  • Improved session state handling by introducing a show_reset_dialog flag to control dialog visibility and clearing session state more effectively after a reset.
  • Enhanced button labeling for clarity, changing "Reset" to "Reset Now" to better convey the action's immediacy.

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid

  • ...

Other Information

This pull request refactors the reset configuration functionality in 04_Configuration.py to improve user experience and code maintainability. The changes replace the previous popover implementation with a dialog-based approach, streamline session state management, and enhance the reset confirmation process.

Refactoring of reset configuration functionality:

  • Replaced the st.popover implementation with an @st.dialog decorator for better UI consistency and clarity. The new dialog includes a confirmation input and reset button labeled :red[Reset Now].
  • Simplified session state management by using st.session_state.clear() to reset all session keys and ensuring proper handling of dialog visibility with the show_reset_dialog state variable.
  • Improved reset confirmation by requiring users to type "reset" in a text input before enabling the reset button, reducing the risk of accidental resets.

…ver, Clear cofig to reset streamlit widgets to default values.
@Vamshi-Microsoft
Copy link
Contributor Author

@Vamshi-Microsoft please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

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.

1 participant