Skip to content
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

Utilize shared state in dashboard #834

Merged
merged 7 commits into from
Feb 10, 2025

Conversation

proy30
Copy link
Member

@proy30 proy30 commented Feb 8, 2025

This PR leverages the new shared state functionality to simplify the dashboard code. Instead of making controller calls for tasks like validation and numeric conversion, we now use a single state change callback to handle these actions efficiently. This reduces redundant code and improves maintainability.

The changes in this PR apply to the input parameters and CSR sections. The distribution, space charge, and lattice configuration sections are not using the shared state approach due to their nested state structures.

Additionally, the docstring of the custom text_field method is updated for clarity.

@proy30 proy30 added the component: dashboard our browser based trame dashboard label Feb 8, 2025
@proy30 proy30 requested review from ax3l, cemitch99 and EZoni February 9, 2025 01:18
Since the state change converts the input value from a string to a numeric, we do not want the input value to be read in numerous times.
can't include others (distribution parameters/lattice config/space charge because either their states are nested by dictionary use or they use different validation errors. In the future, it would be good to have a single validation function than multiple separate ones.
@proy30 proy30 force-pushed the dashboard/use_global_state branch from 18b720b to 367ce8d Compare February 10, 2025 07:38
Copy link
Member

@ax3l ax3l left a comment

Choose a reason for hiding this comment

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

Great, useful!

@ax3l ax3l merged commit d8a963c into BLAST-ImpactX:development Feb 10, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: dashboard our browser based trame dashboard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants